NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.16k stars 14.19k forks source link

libvirt fails when redirecting a usb device to the vm #106594

Closed symphorien closed 3 years ago

symphorien commented 3 years ago

Describe the bug when redirecting a usb device to a vm, a permission error is raised when running setfacl

this is due to a missing setcap wrapper for spice-client-glib-usb-acl-helper

To Reproduce Steps to reproduce the behavior:

  1. Install libvirt:
    { config, pkgs, lib, ... }: {
    config = {
    virtualisation.libvirtd = {
      enable = true;
      qemuRunAsRoot = false;
      onBoot = "ignore";
    };
    users.users.symphorien.extraGroups = [ "libvirtd" ];
    environment.systemPackages = [ pkgs.virt-manager pkgs.virt-viewer ];
    };
    }
  2. create a vm in qemu:///system, start it
  3. redirect any usb device to it
  4. Error setting facl: operation not permitted

Expected behavior ticking the checkbox works

Screenshots image

Additional context I'll open a PR shortly

Notify maintainers cc @fpletz @globin @xeji maintainers of spice and libvirt

Metadata

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module: libvirt spice
symphorien commented 3 years ago

A possible solution is implemented in #106595

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

wucke13 commented 2 years ago

FFR: setting virtualisation.spiceUSBRedirection.enable to true should fix this