Loading
Loading
1
3
Есть USB-ЦАП/АЦП и софтина к нему, под онтопиком ни то, ни другое не работает. Софтина шибко проприетарная, защищена HASP ключом. Я пытаюсь заставить всё это работать в виртуалке.
Собственно, девайсы:
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
Пользователь добавлен в группу qemu.
Команда запуска qemu:
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 # USB-девайс, ради которого весь сыр-бор
-device piix3-usb-uhci,id=usb1,bus=pci.0,addr=0x5
--device usb-host,vendorid=0x0529,productid=0x0001 # USB-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
Проблема: оба девайса в госте видны, но не работают. ЦАП/АЦП должен определяться как USB носитель, так он и определяется, но как-то не совсем. Дрова на HASP ключ в гостя поставил, но софтина его всё равно не видит. ЧЯДНТ?
To correct the issue, shut down the Windows 10 guest. From Virtual Machine Manager (aka virt-manager), open the properties of the Windows 10 guest. Click the tab «Controller USB 0», change the Model from the default of «USB 2» to «USB 3», and click button «Apply». Start the Windows 10 guest, perform the USB Redirect, read a disc, and verify that the USB resets and disconnects have ceased.
Additionally, after changing «Controller USB 0» to Model «USB 3», read performance increased from 4 MB/s to 13 MB/s.
The host’s USB controller is USB 2.0. The USB to SATA bridge is USB 2.0. From what I’ve read, USB Redirect is limited to USB 2.0. I find it baffling that this minor configuration change has corrected the issue, but after reading discs for weeks without issue, it certainly is fixed.
I spent several weeks troubleshooting this, and I hope it helps others.
———- Current Working Configuration ———-
Host:
Linux Mint 19.1 x64 Cinnamon (Tessa) running QEMU/KVM and Virtual Machine Manager
Supermicro X9SCM system board (C204 USB Enhanced Host Controller (EHCI))
StarTech USB2SATAIDE USB 2.0 to IDE or SATA Adapter Cable (JMicron JM20337 - USB 152d:2338)
Asus BW-16D1HT, LG WH16NS40, Pioneer BDR-209D, and Pioneer BDR-209M
Guest:
Windows 10 x64 version 1909 (no additional Windows updates)
Architecture options: x86_64
OS type: Windows
Version: Microsoft Windows 10
Memory (RAM) MiB: 8192
CPUs: 2
Network selection: Bridge br0: Host device enoX
NIC: Device model: virtio
Chipset: Q35
Enable boot menu: <checked>
Hard drives: Advanced options: Disk bus: VirtIO
Optical drives: Advanced options: Disk bus: SATA
Display Spice: Address: Localhost only
Channel spice: spicevmc; virtio; com.redhat.spice.0
Controller USB 0: USB 3
USB Redirector 1: Type: SpiceVMC
USB Redirector 2: Type: SpiceVMC
drivers installed from "virtio-win-0.1.173-5.iso" and QEMU Guest Agent "qemu-ga-x86_64.msi" installed
host/guest copy/paste from "spice-guest-tools-0.141.exe"
AnyDVD HD v8.4.2.0
IsoBuster Pro v4.5
I’m not sure why you are getting that error, but you’d barely want to use -usbdevice
anyway, since it can only attach a device in «full-speed» mode (12M), even if it is a «high-speed» (480M) device on the host side:
It may not even work at all if you are attaching a «superspeed» (5000M) device (xHCI enabled on the host side):
So instead, you would want the more modern and generic -device usb-host
approach, with an emulated host controller of your choice (e.g. -device nec-usb-xhci
):
It should also work for «high-speed» (480M) devices:
as well as «full-speed» (12M) devices:
Possbile choices of emulated host controller are:
[tom@localhost ~]$ qemu-system-x86_64 -device help |& grep usb.*hci
name "ich9-usb-ehci1", bus PCI
name "ich9-usb-ehci2", bus PCI
name "ich9-usb-uhci1", bus PCI
name "ich9-usb-uhci2", bus PCI
name "ich9-usb-uhci3", bus PCI
name "ich9-usb-uhci4", bus PCI
name "ich9-usb-uhci5", bus PCI
name "ich9-usb-uhci6", bus PCI
name "nec-usb-xhci", bus PCI
name "piix3-usb-uhci", bus PCI
name "piix4-usb-uhci", bus PCI
name "usb-ehci", bus PCI
name "vt82c686b-usb-uhci", bus PCI
[tom@localhost ~]$ qemu-system-x86_64 -device help |& grep ohci
name "pci-ohci", bus PCI, desc "Apple USB Controller"
name "sysbus-ohci", bus System, desc "OHCI USB Controller"
nec-usb-xhci
should work best and fine in most cases.
Btw, there are also ways other than vendorid
+productid
to specify which device you want to attach with -device usb-host
. For example, hostbus
+hostaddr
:
Or, hostbus
+hostport
:
Which are handy when there are multiple devices of the same model in the system.
Ref.: http://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/usb2.txt;hb=HEAD