Qemu USB passthrough (windows guest)

I finally got help on the other forum. The issue seems to be with the USB bus implementation in I440FX chipset that is emulated by qemu by default (details here). The workaround is emulating the ICH9 chipset instead. This is done by adding -M q35 parameter. I also changed the way the USB devices are specified and the final command line looks like this:

qemu-system-x86_64 \
    -enable-kvm \
    -M q35 \
    -m 2G \
    -usb -usbdevice host:16b2:1001 \
    -usb -usbdevice host:0529:0001 \
    -usbdevice tablet \
    -net nic \
    -net bridge,br=br0 \
    -vga qxl \
    -spice port=5930,disable-ticketing \
    -device virtio-serial-pci \
    -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
    -chardev spicevmc,id=spicechannel0,name=vdagent \
    -drive file=/mnt/data/win-patch.img,if=virtio

Everything works perfectly now.


Update for 2019: the usb-device option was deprecated; you can achieve the same by replacing it with -usb -device and specifying product and vendor id in hexadecimal numbers, likewise:

qemu-system-x86_64 \
    -enable-kvm \
    -M q35 \
    -m 2G \
    -usb -device usb-host:productid=0x16b2,vendorid=0x1001 \
    -usb -device usb-host:productid=0x0529,vendorid=0x0001 \
    -usbdevice tablet \
    -net nic \
    -net bridge,br=br0 \
    -vga qxl \
    -spice port=5930,disable-ticketing \
    -device virtio-serial-pci \
    -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
    -chardev spicevmc,id=spicechannel0,name=vdagent \
    -drive file=/mnt/data/win-patch.img,if=virtio

reference: https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/usb2.txt;hb=HEAD