tobimensch / aqemu

Official AQEMU repository - a GUI for virtual machines using QEMU as the backend
https://sourceforge.net/projects/aqemu/
GNU General Public License v2.0
509 stars 86 forks source link

After adding a usb device vm will not start any more #111

Open CosmicDuck opened 3 years ago

CosmicDuck commented 3 years ago

This issue is created after adding a bug report for debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987765 I copied the created text here and will watch it on gh. Because on that the problem is not not in the list of allready fixed bugs nor in the list of open issues it was created:

Package: aqemu Version: 0.9.2-2.3 Severity: important

Dear Maintainer,

aqemu starts my vm with Win7 without any problems as long I do not add a usb device. I tried now to add my usb card reader ReinerSCT CyberJack Standard to my vm so I used aqemus menu for that. If I start the vm now it will shows me a normal warning about the fd device and then ends so the vm will never start. I checked how aqemu will start the vm before and after adding the usb device:

Before which is working but no usb: usr/bin/qemu-system-x86_64 -monitor stdio -k de -machine accel=kvm -m 4096 -no-fd-bootchk -fda /home/user/qemu/Win7/floppy -cdrom /home/user/qemu/cd.iso -hda /home/user/qemu/Win7/hda.qcow2 -hdb /home/user/qemu/Win7/acronis.qcow2 -boot once=c,menu=on -net nic,macaddr=00:ef:55:f9:d7:d9,model=rtl8139 -net user -rtc base=localtime -name "Win7"

After which will not start the vm: usr/bin/qemu-system-x86_64 -monitor stdio -k de -machine accel=kvm -m 4096 -no-fd-bootchk -fda /home/user/qemu/Win7/floppy -cdrom /home/user/qemu/cd.iso -hda /home/user/qemu/Win7/hda.qcow2 -hdb /home/user/qemu/Win7/acronis.qcow2 -boot once=c,menu=on -net nic,macaddr=00:ef:55:f9:d7:d9,model=rtl8139 -net user -usb -device usb-host,bus=usb.0,hostbus=,hostport= -rtc base=localtime -name "Win7"

I get the following error if I try to start it in console: (qemu) qemu-system-x86_64: -device usb-host,bus=usb.0,hostbus=1,hostport=6: Bus 'usb.0' not found

lsusb shows me the following for the device: lsusb|grep Reiner Bus 001 Device 007: ID 0c4b:0500 Reiner SCT Kartensysteme GmbH cyberJack RFID standard dual interface smartcard reader

I tried to modify the parameters but never could start the vm.

After searching the web I found a work around by using vendor and product id. Replacing the bus.0 etc. parameters by that values works, the vm is starting and the device is usuable in the vm:

usr/bin/qemu-system-x86_64 -monitor stdio -k de -machine accel=kvm -m 4096 -no-fd-bootchk -fda /home/user/qemu/Win7/floppy -cdrom /home/user/qemu/cd.iso -hda /home/user/qemu/Win7/hda.qcow2 -hdb /home/user/qemu/Win7/acronis.qcow2 -boot once=c,menu=on -net nic,macaddr=00:ef:55:f9:d7:d9,model=rtl8139 -net user -usb -device usb-host,vendorid=0x0c4b,productid=0x0500 -rtc base=localtime -name "Win7"

By the way for the moment I cannot use aqemu if I want to add a usb device so I must start the vm from console.

The problem with vendor:productid is, if I e.g. two same devices this will not further work.

The permissions in dev for the usb device are ok. I'm in the same group scard with my user. But against using vendor/productid it should not work if the permissions are wrong.

I must typed the commands because could not copy&paste them. I hope they are correct. (I found a typing issue after adding on debian bug report, which I fixed here)

-- System Information: Debian Release: 10.9 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Foreign Architectures: i386

Kernel: Linux 4.19.0-16-amd64 (SMP w/16 CPU cores) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE:en (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system)

Versions of packages aqemu depends on: ii libc6 2.28-10 ii libgcc1 1:8.3.0-6 ii libqt5core5a 5.11.3+dfsg1-1+deb10u4 ii libqt5dbus5 5.11.3+dfsg1-1+deb10u4 ii libqt5gui5 5.11.3+dfsg1-1+deb10u4 ii libqt5network5 5.11.3+dfsg1-1+deb10u4 ii libqt5printsupport5 5.11.3+dfsg1-1+deb10u4 ii libqt5test5 5.11.3+dfsg1-1+deb10u4 ii libqt5widgets5 5.11.3+dfsg1-1+deb10u4 ii libstdc++6 8.3.0-6 ii libvncclient1 0.9.11+dfsg-1.3+deb10u4 ii qemu 1:3.1+dfsg-8+deb10u8

Versions of packages aqemu recommends: ii qemu-kvm 1:3.1+dfsg-8+deb10u8

aqemu suggests no packages.

-- no debconf information

Additional information:

uname -a
Linux nihilnihil 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux
cat /etc/debian_version 
10.9
BETLOG commented 1 year ago

Same issue. fails...: -usb -device usb-host,bus=usb.0,hostbus=1,hostport=1 works: -usb -device usb-host,vendorid=0x30fa,productid=0x1340 I am interested in using the first method because the USB mouse I am attempting to attach is not being recognised by its own programming software in the guest win10, and I figure I should try the default suggested method. I'm surprised that I cannot. (qemu) qemu-system-x86_64: -device usb-host,bus=usb.0,hostbus=1,hostport=1: Bus 'usb.0' not found

Kubuntu 23.04 Linux betlogbeast 6.2.0-27-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 12 22:39:51 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

qemu-system-x86_64 --version QEMU emulator version 7.2.0 (Debian 1:7.2+dfsg-5ubuntu2.2)

Bus 001 Device 011: ID 30fa:1340 INSTANT USB GAMING MOUSE X10-G6 7200 DPI - https://www.aliexpress.com/item/1005005472754782.html software suggested by seller software from youtuber review of higher DPI version

CosmicDuck commented 2 months ago

Hello,

I tried it again but the 0x is not headed for vendorid and productid:

fails: -device usb-host,bus=ehci.0,vendorid=0fce,productid=0dde works: -device usb-host,bus=ehci.0,vendorid=0x0fce,productid=0x0dde

Addition now it is: ii aqemu 0.9.2-3 amd64 Qt5 front-end for QEMU and KVM on: ~# uname -a Linux nihilnihil 5.10.0-32-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64 GNU/Linux ~# cat /etc/debian_version 11.10