-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
spice-gtk: fix usb redirection #35214
Conversation
# the helper then uses polkit to check access | ||
# in nixos, enable this with | ||
# security.wrappers.spice-client-glib-usb-acl-helper.source = | ||
# "${pkgs.spice_gtk}/bin/spice-client-glib-usb-acl-helper.real"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could become a nixos module later.
@GrahamcOfBorg build spice-gtk |
Failure on x86_64-linux (full log) Partial log (click to expand)
|
@Mic92 it's spice_gtk |
@GrahamcOfBorg build spice_gtk |
Failure on x86_64-darwin (full log) Partial log (click to expand)
|
Failure on x86_64-darwin (full log) Partial log (click to expand)
|
Failure on aarch64-linux (full log) Partial log (click to expand)
|
Success on x86_64-linux (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
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.
rebased on current master |
I would actually suggest to resolve this not via suid wapper, but with an option to generate an appropriate group for usb devices and authorize users to access them. suid seems a little bit of an overkill, just for USB access? My configuration: # add new group for usb
users.groups = { usb = {}; };
# let all usb devices be in the usb group
services.udev.extraRules = ''
KERNEL=="*", SUBSYSTEMS=="usb", MODE="0664", GROUP="usb"
''; |
While this approach will work, it does statically give all such users access to all usb devices, whether they are currently in an active session or not - which is fine in a single- or trusted-user environment. The upstream solution follows a more dynamic approach: it uses Anyway, you can activate either approach by manual config (yes, this needs documentation). |
Ok, makes sence. |
Thanks for the hint, looks related indeed. |
Motivation for this change
Build spice-gtk with polkit and acl to enable usb redirection in virt-viewer and virt-manager.
Fixes #27199.
usb redirection requires a setuid wrapper, see comment in code.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)