qemu USB Device Passthrough
This works with a Lenovo USB Headset allowing it to be detected and used in the Windows 10 Virtual Machine:
#!/bin/sh
qemu-system-x86_64 \
-cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time \
-smp cpus=2 \
-m 8192 \
-accel kvm \
-machine q35 \
-nodefaults \
-rtc base=localtime \
-vga virtio \
-display gtk,gl=on \
-usb \
-device usb-host,vendorid=0x17ef,productid=0x60f4 \
-usbdevice tablet \
-drive if=pflash,format=raw,unit=0,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \
-drive file=root.qcow2,format=qcow2,discard=on,if=virtio \
-drive file=Win10_22H2_EnglishInternational_x64.iso,index=0,media=cdrom \
-drive file=virtio-win-stable.iso,index=1,media=cdrom \
-device virtio-net-pci,netdev=nwif0,mac=00:12:34:56:78:9a \
-netdev tap,id=nwif0,ifname=tap4,script=no,downscript=no
References
- TODO