How do I automatically redirect a USB device to a remote KVM? preferrably filtered by ID.
I have a KVM running on a server (QEMU+SSH), and the display protocol is Spice. How could I always redirect a USB device with a specific ID to the remote machine when the viewer is opened?
Iv'e been searching, but did not found a configuration that fits my use case.
I've tried:
- Adding a TCP redirection, but it prevents the machine from starting with a error and it's not clear to me how to specify a address filter.
<redirdev bus='usb' type='tcp'>
<source mode='connect' host='localhost' service='4000'/>
</redirdev>
- adding a host device, but this does not seem to work on a remote setup because the USB device is not attached to the server, but to my local machine.
<devices>
<hostdev mode='subsystem' type='usb'>
<source startupPolicy='optional'>
<vendor id='0x1234'/>
<product id='0xbeef'/>
</source>
<boot order='2'/>
</hostdev>
</devices>
a section on spice's manual, but i'm not sure how to apply to my use-case
And a few other things where virt-manager would simply 'delete' or 'correct' the XML, probably indicating that it is not a supported option.
Also, manually redirecting the USB device works, but is not a viable solution for my use-case.
this: https://libvirt.org/formatdomain.html helped a bit.
the only guide I could find, was paywalled.