20

I have a USB ADC/DAC and a HASP protected proprietary data acquisition system for it, both of which do not work in linux. I am trying to make it work in Windows virtual machine using qemu. Here are the devices:

$ lsusb
...
Bus 003 Device 011: ID 0529:0001 Aladdin Knowledge Systems HASP copy protection dongle
Bus 003 Device 010: ID 16b2:1001

$ ls -l /dev/bus/usb/003
...
crw-rw-r-- 1 root qemu 189, 265 дек 22 18:29 010
crw-rw-rw- 1 root qemu 189, 266 дек 22 18:29 011

My user is a member of qemu group. Qemu command line:

qemu-system-x86_64 \
    -enable-kvm \
    -m 2G \
    -device usb-ehci,id=usb,bus=pci.0,addr=0x4 \
        --device usb-host,vendorid=0x16b2,productid=0x1001 \ # ADC/DAC
    -device piix3-usb-uhci,id=usb1,bus=pci.0,addr=0x5 \
        --device usb-host,vendorid=0x0529,productid=0x0001 \ # HASP
    -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

The problem is, both devices are showing in guest, but do not work. ADC/DAC should identify as a USB block drive, and is showing as one in device list, but doesn't work. I've installed HASP drivers for my dongle on the guest system, but the DAS software doesn't recognize it. What am I doing wrong? Windows guest screenshot

2 Answers 2

26

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

1
  • 6
    The correct syntax for the updated version is -usb -device usb-host,productid=0x16b2,vendorid=0x1001. Note the comma after usb-host.
    – user0815
    Feb 20, 2020 at 18:01
3

You guys mixed up vendorid and productid, the correct syntax is:

-usb -device usb-host,vendorid=0x16b2,productid=0x1001

You must log in to answer this question.

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