qemu & USB devices

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1484
Joined: Fri Aug 29, 2003 8:39 pm

qemu & USB devices

Post by ^rooker »

I'm using QEMU with kqemu and qemulator to run virtual machines on Ubuntu Hardy. Runs like a charm, even on an (already older) AMD 64 3500+

In order to use USB devices within the virtual machines, you must make the deprecated "/proc/bus/usb" available. Thanks to the instructions found in "Howto: Install VirtualBox in Ubuntu Hardy Heron with USB Support in 5 easy Steps!", it was no problem.

Simply do the following:

1) Open /etc/init.d/mountdevsubfs.sh in your favorite text editor - as root (!).
2) Look for this code:

Code: Select all

#
# Magic to make /proc/bus/usb work
#
#mkdir -p /dev/bus/usb/.usbfs
#domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
#ln -s .usbfs/devices /dev/bus/usb/devices
#mount --rbind /dev/bus/usb /proc/bus/usb
3) Uncomment the last 4 lines to make it look like this:

Code: Select all

#
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb
Now either restart your computer or simply type the following command into a console:
sudo /etc/init.d/mountdevsubfs.sh start
If all went well, the output of "ls /proc/bus/usb/" will match the output of "ls /dev/bus/usb/" - making the devices available to Qemulator's device list.

4) In Qemulator, enable USB support for your virtual machine:
- Select "My Machines"
- "show settings" and select "Hardware". Check "enable usb" in the lower right corner.
- Start the virtual machine
- in Qemulator, open the "Running jobs" tab and right-click on your virtual machine entry and click "open control monitor"

5) In the control monitor, you have a tab called "USB" where you should now see all attached USB devices in the upper half.
Just select a device you want to use and click "add". It should now show up in the virtual system as if it had just been plugged in.


Enjoy! :)


open the "Running jobs" tab and right-click on the
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply