2

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.

1 Answer 1

1

For what it is worth, that Red Hat Customer Portal link is paywalled by account only (accountwalled?) There's no payment required to view, you just need to create an account.

The article does not say a whole tonne. "Updates in RHEL 6.6 have enabled support for both automatic and manual SPICE USB redirection in virt-manager." plus a few supporting sentences and a link to the relevant advisory https://access.redhat.com/errata/RHBA-2014:1447.html.

As far as resolving your issue is concerned, if you are using the Virtual Machine Manager GUI then under Edit > Preferences > Console there is a an option to toggle Spice USB Redirection as manual or automatic. I was looking to disable it when I found your post. Unfortunately in your case, this is only an enable/disable toggle with no way to filter how it is applied (at least through this interface).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .