OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
apps-services low common DISPUTE

Fix "Redirect USB device" being greyed out in virt-manager

archomarchyendeavouroscachyosmanjarokvmlibvirtdesktoplaptop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

Checked on this Omarchy 4 workstation (omarchy 4.0.2-1, virt-manager 5.1.0-4, virt-viewer 11.0-4, spice-gtk 0.42-5, usbredir 0.15.0-1, qemu-desktop 11.1.0-1, libvirt 1:12.6.0-1) and against both cited wiki pages, fetched in full as raw wikitext. Both pages resolve and both support the record as written, so this is a case of the sources being stale rather than misread, and three things are wrong against what is actually installed. First, the cause is misattributed: I read the greying-out logic in /usr/share/virt-manager/virtManager/vmwindow.py (_console_refresh_can_usbredir sets sensitivity from vmwindow_viewer_can_usb_redirect()) and in /usr/share/virt-manager/virtManager/details/viewers.py, where the VNC viewer's _has_usb_redirection is an unconditional return False and the SPICE viewer's returns True whenever _spice_session and _usbdev_manager exist. Nothing in that path consults the domain for a controller or a <redirdev>, so the missing hardware is what makes redirection fail at connect time, not what greys the item out. The record's fix does the right things but buries the SPICE requirement in the middle, where it belongs at the top. Second, the virt-viewer path is dead: strings -a /usr/bin/remote-viewer shows the embedded virt-viewer-menus.ui has only action-menu and machine-menu with no File menu at all, and USB selection is a win.usb-device-select action on a toolbar and header-bar button opening a dialog titled "Select USB devices for redirection". The old *File > USB device selection* wording comes straight from the Arch QEMU page and has not been true for several virt-viewer releases. Third, the danger overstates the keyboard risk on Arch: libspice-client-glib-2.0.so.8 carries the default filter string 0x03,-1,-1,-1,0|-1,-1,-1,-1,1, which denies USB class 0x03, so the client refuses HID devices unless that filter is overridden, and the <hostdev> fallback is where the warning really bites. Confirmed unchanged and left alone: *Add Hardware > Controller > USB* exists (addhardware.py:234 plus DeviceController.TYPE_USB), *Add Hardware > USB Redirection* exists (addhardware.py:318), _Redirect USB device is still the menu label (ui/vmwindow.ui:99), the qemu-xhci model with ports='8' is valid, the <hostdev> block and its detach command are correct, and the qemu:///system note holds. I also added the Omarchy install step, because Omarchy ships none of this: /usr/share/omarchy/install/omarchy-base.packages matches only qemu-user-static-binfmt, and /usr/share/omarchy/bin/omarchy-update-pacman-guard aborts only on a combined sync plus sysupgrade, so publishing pacman -S --needed is safe. The packages that provide the feature today are qemu-hw-usb-redirect and qemu-chardev-spice (both hard dependencies of qemu-desktop, read from pacman -Qi) and spice-gtk, a hard dependency of virt-manager which itself hard-depends on usbredir, so no package has been renamed or dropped and nothing needs installing by hand. NOT exercised: I have no sudo and was told to leave libvirt alone, so I did not define or edit a domain, did not open a console, and did not redirect a device, and the greying-out behaviour is read from virt-manager 5.1.0 source on this machine rather than observed in the UI.

The cause above was rewritten on 2026-09-11 to match this note; the fix was corrected by the audit itself.
RISK

A redirected device is taken away from the host until redirection stops, so unmount a USB disk on the host before redirecting it or you risk corrupting its filesystem. spice-gtk 0.42 ships a default redirection filter of 0x03,-1,-1,-1,0|-1,-1,-1,-1,1, which denies USB class 0x03 and allows the rest, so the client refuses a keyboard or mouse rather than redirecting it. Do not override that filter: if you do redirect your keyboard or mouse you lose the input needed to reach the viewer's own menus and undo it, and the only way back is killing the viewer. The <hostdev> passthrough fallback has no such filter, so nothing there stops you making that mistake.

Symptom

In virt-manager's *Virtual Machine > Redirect USB device* menu the entry is greyed out, or the dialog opens but lists no devices, so a USB stick / YubiKey / phone plugged into the host never appears in the guest.

Cause

Two separate things are in play and the record's symptom covers both. The menu item's *greyed out* state depends only on the console type: in virt-manager 5.1.0, /usr/share/virt-manager/virtManager/vmwindow.py sets the item's sensitivity from vmwindow_viewer_can_usb_redirect(), and /usr/share/virt-manager/virtManager/details/viewers.py implements that as an unconditional return False for the VNC viewer and return True for the SPICE viewer whenever the SPICE session has a USB device manager. It is not gated on the domain's hardware at all, so a SPICE domain with no USB controller and no redirector shows a *selectable* menu item and then fails at connect time because there is no free redirection channel, which is the "lists no devices or will not connect" half of the symptom. So SPICE graphics are what make the item selectable, and a USB controller plus one <redirdev bus='usb' type='spicevmc'/> per simultaneous device are what make the redirection actually succeed. Neither the controller nor the redirector is part of a default domain definition.

Fix

Check the **display** first, because that alone decides whether the menu item is selectable. With sudo virsh edit <vm-name> the graphics must be SPICE:


<graphics type='spice' autoport='yes'/>

VNC has no redirection channel and virt-manager greys the item out unconditionally on a VNC console.

Then shut the VM down and give it the hardware redirection needs. In virt-manager: *Add Hardware > Controller > USB* (model USB3/qemu-xhci is fine), and *Add Hardware > USB Redirection* once per concurrent device you want. Equivalently, sudo virsh edit <vm-name> and add inside <devices>:


<controller type='usb' index='0' model='qemu-xhci' ports='8'/>
<redirdev bus='usb' type='spicevmc'/>
<redirdev bus='usb' type='spicevmc'/>

Boot the VM, open its console, then *Virtual Machine > Redirect USB device* in virt-manager. The client paths differ by tool: in remote-viewer from virt-viewer 11.0 there is **no File menu**, the control is the USB button on the toolbar or header bar and it opens a dialog titled *Select USB devices for redirection*. In spicy from spice-gtk it is *Input > Select USB Devices for redirection*. Use the **system** connection (qemu:///system) if the device needs privileged access.

If redirection still will not cooperate, attach the device directly instead. This works without redirectors but requires the VM to be running and the device to be present:


lsusb
sudo virsh attach-device <vm-name> --live --file /tmp/usb.xml

<!-- /tmp/usb.xml -->
<hostdev mode='subsystem' type='usb' managed='yes'>
  <source>
    <vendor id='0x1050'/>
    <product id='0x0407'/>
  </source>
</hostdev>

Detach with sudo virsh detach-device <vm-name> --live --file /tmp/usb.xml when done.

**On Omarchy 4 none of this stack is installed.** /usr/share/omarchy/install/omarchy-base.packages carries only qemu-user-static-binfmt, which runs foreign-architecture binaries and is not a VM hypervisor. Install it first. The Omarchy ALPM guard aborts only when a sync and a sysupgrade flag appear in the same transaction, so a plain install is not blocked:


sudo pacman -S --needed qemu-desktop libvirt virt-manager virt-viewer dnsmasq
sudo systemctl enable --now libvirtd.socket virtlogd.socket
sudo usermod -aG libvirt "$USER"

Nothing extra is needed for redirection after that. qemu-desktop depends on qemu-hw-usb-redirect and qemu-chardev-spice, which are the QEMU side, and virt-manager depends on spice-gtk, which itself depends on usbredir, which is the client side.

Verify

The *Redirect USB device* menu item is selectable once the console is SPICE, and picking a device succeeds rather than erroring, which needs a USB controller and a free <redirdev>. After ticking one, lsusb inside the guest shows it. A keyboard or mouse will not be listed, because spice-gtk's default filter denies USB class 0x03.

Sources

virt-manager-redirect-usb-greyed-out