Problem passing through usb devices in qemu
I'm running qemu without libvirt on slackware 14.1. I want to pass through a usb device from host to guest. I start the quest machine as root and add -usb. Typing info usbhost in guest monitor gives: USB host devices not supported.
Some tutorials mention looking at permissions in /proc/bus/usb/devices. But I only have /proc/bus/input and /proc/bus/pci. But lsusb works and shows my devices. Could this be related to my problem? I have tried with both ubuntu and slackware as guests. Versions: Slackware 14.1 32 bit (host) qemu 1.7.0 |
I use qemu without libvirt on Slackware as well. I use the following to connect to my HP printer from the guest:
Code:
-usb -device usb-host,vendorid=0x03f0,productid=0x1312 Coming back to your problem, I don't know how you installed qemu - but I used the SlackBuilds.org script. If you want to use usb redirection, you have to install first the usbredir package - than build qemu and the SBo build script will automatically enable usbredirection for qemu. The usbredir package can be found here: http://slackbuilds.org/repository/14...earch=usbredir Otherwise, if you compile qemu by hand, you will have to install somehow the usbredir package first, and then pass --enable-usb-redir when configuring qemu. Hope the above helps. |
Thanks for helping out.
I tried uninstalling qemu, then building and installing usbredir-0.6, and then building and installing qemu-1.7.0, both from slackbuilds. info usbhost in guest monitor still gives: USB host devices not supported. I also tried with the command line options suggested: Code:
>>>qemu-system-i386 -usb -device usb-host,vendorid=0x0781,productid=0x5151 slack.vmdk All I want is to pass through usb from host to guest. So I think that what I need is libusb, not usb-redir: Code:
>>>./configure --help | grep usb Code:
>>>./configure --target-list=i386-softmmu,x86_64-softmmu --enable-kvm --enable-libusb |
Hmm - yes, thinking about it libusb sounds the more likely candidate. I'm not really sure though why the config process can't find it. On the other hand, looking at my qemu.Slackbuild script, it looks like I didn't add --enable-libusb, so it must get enabled automatically if it finds libusb. Maybe somebody with a bit more experience of libraries/compilation issues could weigh in.
On my box, I get the following when searching for libusb, in case it helps: Code:
# ls /var/log/packages/ | grep libusb |
I also have libusb-1.0.9.
It is strange because qemu 1.6.1 (and 1.7.0) have this line in configure: Code:
if $pkg_config --atleast-version=1.0.13 libusb-1.0 >/dev/null 2>&1 ; then xj25vm, if you have the time could you check this. Goto the monitor prompt of any guest machine and run 'info usbhost' and post the result. Did your version of qemu compile with libusb support? Post the output of: Code:
grep libusb /tmp/SBo/qemu-1.6.1/config-host.mak |
|
Ok, I got it working.
I switched to libusb-1.0.18 and then built qemu-1.7.0 using the slackbuild script. Started qemu with -usb option and now I can add usb devices in qemu monitor with usb_add. I also had to check permissions for the device I wanted to pass through in /dev/bus/usb/bus/port. |
Great stuff. Glad it is working. It's strange that you needed libusb-1.0.18 as at least qemu 1.6.1 seems to be happy with libusb-1.0.9
|
Sorry for re-open this old thread.
I need "passing through usb devices in qemu" release 2.1.2 Reading this old thread and comments in slackbuilds.org qemu.SlackBuild: http://slackbuilds.org/slackbuilds/1...emu.SlackBuild #usb passthrough may fail since Slackware's libusb is too old. # Slackware-14.1 ships with an ancient libusb. Check for updates to enable. Are there known issues with last release (libusb-1.0.19)? Lib is used in many other Slackware packages... anyone have try it? why has not been updated in a long time? P.S. seems there is new site http://libusb.info/ |
All times are GMT -5. The time now is 07:49 AM. |