New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Libvirt, KVM USB redirection fails #27199
Comments
This needs more information. For example, you are not specifying via which user you are trying to do these things. |
User is in wheel and libvirtd. I have found the same issue discussed on arch, with some hack changing ownership of the device to group 'spice'. Also, from same thread, assigning the device manually before starting the VM should work(I havent tested this yet, ongoing) |
Changing the ownership of /dev/bus/usb to 'spice' and adding the user to it works. |
I'm facing the same issue with virt-manager. Also I have no group "spice". Can you tell me how you got it to work? Relevant portions of my configuration.nix:
|
I think I also have this issue. EDIT: Well, for what it's worth, I solved the issue for that device by adding a udev rule similar to https://github.com/sjau/nixos/blob/master/configuration.nix |
I use this brute force udev rule:
(Not sure it's a good idea in general. I'm afraid it may conflict with other more fine grained rules.) |
I run virt-manager with Another problem I have is that USB auto redirection is not working. Can you confirm this? Manual redirection doesn't work well when flashing firmware to a device that intermittently reboots with a different device id. |
I'd probably rather modify perms for a usb device via udev (I think this is actually sort of the generally accepted method) than run it as root. :/ If by auto redirection you mean automatically redirecting when you plug it in, I pleasantly discovered that's a thing by accident and it does in fact work with the udev solution. Presumably because it does keep it's ID. I don't know why your device changes it's iD? I thought device IDs were static values.... I really don't know if this is a good idea at all, but maybe it would be possible to just shotgun get access to all usb devices. It would be nice if the root cause for this could get fixed but I have no idea what the proper fix would be. I guess it's pretty useless to say this since that's probably what everyone wants. |
I also modified it by udev:
|
Yes your solution is what I used. :) Lucky google find. |
still annoying though :) |
Nice to hear that it's not generally broken on NixOS ;-) However, it's not a permission issue on my end. I have tried both, using |
Build with polkit and acl to enable usb redirection in virt-viewer and virt-manager. Fixes NixOS#27199 usb redirection requires a setuid wrapper, see comment in code.
i'm still experiencing this issue i tried adding the above rules: and i tried adding
from https://bbs.archlinux.org/viewtopic.php?pid=1628757#p1628757 and i still get the same error |
i think it may have been that i just needed to enable spiceguestadditions, under virtualization options, further testing may be needed |
Yes, all that should be needed is |
Issue description
Using USB redirect fails with 'Insufficient permissions'.
Steps to reproduce
Enable libvirtd and KVM, spin up VM with virt-manager/virsh, try to access USB on spice client.
Technical details
Nixos 17.09pre110213.01c3847b9c
The text was updated successfully, but these errors were encountered: