Friday, August 8, 2008

How to Enable USB devices in VMware server

In my memory, VMware workstation grabs USB devices automatically, and it works every time as long as the USB device is not claimed by the Linux host kernel driver. I have just installed VMware server tonight and I was trying to attache my USB stick to VMware client, however VM->Removeable Devices->USB Devices shows Empty; it has detected nothing! And then I spent 3 hours in googling the answer.

The following is how I solved this problem on Ubuntu 8.04 Hardy Heron:

1. edit /etc/fstab and add this line


# USB for vmware
none /proc/bus/usb usbfs devgid=46,devmode=664 0 0
2. edit /etc/init.d/mountdevsubfs.sh and uncomment these 4 lines

#
# 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. reboot

4.
You need to do this step when your guest is turned off. In the VMware server window click "Edit virtual machine settings" -> Click "Add" in the lower left -> Select usb controller -> click finish.

5. Start your guest and click VM -> Removable devices -> USB devices -> Select the USB device which you want to access in your guest

This works for me and should work with all modern Linux distributions with a tiny bit of change.

No comments: