2

I try to run a windows vm on linux with qemu/kvm and pci-passthrough, but I get the following error when I start the vm:

qemu-system-x86_64: -usbdevice host:046d:c227: could not add USB device 'host:046d:c227'

lsusb output:

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 046d:c227 Logitech, Inc. G15 Refresh Keyboard
Bus 001 Device 004: ID 046d:c226 Logitech, Inc. G15 Refresh Keyboard
Bus 001 Device 002: ID 046d:c223 Logitech, Inc. G11/G15 Keyboard / USB Hub
Bus 001 Device 005: ID 8087:0a2b Intel Corp. 
Bus 001 Device 003: ID 1038:1384 SteelSeries ApS 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Startscript:

qemu-system-x86_64 \
-enable-kvm \
-m 16392 \
-cpu host,kvm=off \
-smp 4,sockets=1,cores=2,threads=2 \
-vga none \
-usb -usbdevice host:046d:c227 -usbdevice host:046d:c226 \
-device vfio-pci,host=01:00.0,multifunction=on \
-device vfio-pci,host=01:00.1 \
-drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd \
-drive if=pflash,format=raw,file=/tmp/my_vars.fd \
-device virtio-scsi-pci,id=scsi \
-drive file=/var/iso/win10.iso,id=isocd,format=raw,if=none -device scsi-cd,drive=isocd \
-drive file=/home/icehawk/images/windows10.img,id=disk,format=raw,if=none,cache=writeback -device scsi-hd,drive=disk \
-drive file=/var/iso/virtio-win-0.1.126.iso,id=virtiocd,if=none,format=raw -device ide-cd,bus=ide.1,drive=virtiocd

I tried to pass through the whole bus or other various combinations, doesn't work either. Everytime, the first usb device is listed in the error message. I looked into this thread, but the answers doesn't help me: USB passthrough for QEMU gets error "qemu: could not add USB device"

I use the newest qemu version 2.7.9 (aka 2.8 rc0)

Any ideas? Thanks in advance!

EDIT: Found a solution: Had to compile qemu with --enable-libusb and --enable-usb-redir

2

Found a solution: Had to compile qemu with --enable-libusb and --enable-usb-redir

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.