[libvirt-users] USB passthrough of all USB-slots to guest

eGerlach egerlach at aiai.de
Thu May 17 22:04:42 UTC 2012


how can I define passthrough of all USB-slots to a guest with libvirt? 

With qemu it's very easy: 

# kvm -usb -usbdevice host:0.* -usbdevice host:1.*  -usbdevice host:2.* -usbdevice host:3.*  ...

This configuration of the VM gets *all* 4 USB-Slots. Every time somewhat USB-device 
is plugged in the VM gets it. 

virt-install manpage offers: 

--host-device 001.003
    USB by bus, device (via lsusb). 

I installed a VM with option --host-device 001.001 according to output of lsusb. 
The XML-file generated:

    <hostdev mode='subsystem' type='usb' managed='yes'>
        <vendor id='0x1d6b'/>
        <product id='0x0002'/>

But no USB device is passed through automatically. I always need
  virsh attach-device virtualM myusb.xml

with exact vendor and product ID. I want to plug in somewhat USB-Stick or other USB stuff 
without exploring vendor and product id before. 

Who can help? 


More information about the libvirt-users mailing list