Give QEMU's guest (Win XP) USB access...
I would like to ask how I can further optimize QEMU to run Windows XP as guest. I am using QEMU version 1:2.8+dfsg-3. To start the guest (Windows XP), I use the command:
Code:
/usr/bin/qemu-system-i386 -drive format=raw,file=win_xp.img -enable-kvm -machine type=pc,accel=kvm & Code:
-usb -device usb-host,usbbus=1,usbaddr=3 The guest's performance is quite a good but it says no graphics drivers are being used. Can I further improve the graphics performance? I am on Devuan ASCII (equivalent to Debian Testing). With the latter, the host OS denied the VM access to USB telling me libusb couldn't grant permission. |
What EXACTLY is the error? (for Goog!e) http://www.linuxquestions.org/questi...emu-4175492519 ?
Can you strace it, to see where it fails? root privs? +1 for latest devuan! ;) Maybe Edit Title to include PRECISE error plus libusb version. |
I hit that thread before writing this new question. The decision as to why I am using a virtual machine to run Windows XP, stems from two limitations: a) my hardware is too new to be compatible with XP, b) I want to avoid accessing the internet or any network through Windows, any version. The reason is to free myself from having to have an antivirus running all the time eating precious CPU and RAM resources, and also, I do not want to update Windows. On this same machine I have a partition with Windows 8.1 installed that I can boot to use my USB oscilloscope.
Running a virtual machine as root is not attractive to me as it would mean having an aggregate of executables running with root privileges. To me it is the same as running XFCE or a heavier desktop as root. In short, when I try to run QEMU to virtualise Windows XP, I get the error: Code:
qemu-system-i386: -device usb-host,hostbus=2,hostaddr=3: failed to find host usb device 2:3 Code:
$ lsusb Reading the man page I changed the qemu-system-i386 command to: Code:
$ /usr/bin/qemu-system-i386 -drive format=raw,file=/home/edbarx/qemu/win_xp.img -enable-kvm -machine type=pc,accel=kvm -usb -usbdevice host:0002.0003 -usbdevice host:0001.0003 & Code:
[1] 6024 EDIT 2: The Cause. The following shows I do not have enough privileges to write to usb devices. Just inspect the permissions. Code:
edbarx@edbarx-pc3:/dev/bus/usb$ ls -l |
The reason was device file name permissions which udev assigns as o664 i.e. rw-rw-r--. For testing puposes, I changed that to rw-rw-rw-. Bringing up the virtual machine with the command:
Code:
/usr/bin/qemu-system-i386 -drive format=raw,file=/home/edbarx/qemu/win_xp.img -enable-kvm -machine type=pc,accel=kvm -usb -usbdevice host:001.009 & The udev device file I had to modify is under /dev/bus/usb/00x/. Hopefully this is enough to help anyone reading this thread. |
Thank you for the fix. This is still a problem with ASCII at the end of 2019.
For me, the solution was: Code:
chmod a+w /dev/bus/usb/003/064 Code:
-usb -device usb-host,hostbus=3,hostaddr=64 |
Actually, a longer term solution is as follows:
1. Edit /etc/udev/rules.d/flash.rules. Add this: Code:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", GROUP="users", MODE="0666" e.g. Code:
Bus 003 Device 001: ID XXXX:YYYY Linux Foundation 2.0 root hub Code:
qemu ....... -usb -device usb-host,hostbus=3,hostaddr=1 ..... |
All times are GMT -5. The time now is 10:55 AM. |