Monday, July 21, 2008

VirtualBox with external USB drive

(Ubuntu 8.04 - VirtualBox 1.6)

I use the obsolete WinXP-OS from time to time under VirtualBox. VirtualBox is a great visualization program that gives you the opportunity to try out various distros, run WinXP on you Linux-box, etc.

In it's "basic" configuration, the virtual machine has no connection with the outside world. However, you can enable network, share folders with the host OS, use the CD/DVD-drive, etc. Everything is easily enabled via the control panel for VirtualBox.

External USB-drives can be a bit tricky to enable. This link provides great instructions to get the USB drives to work.

sudo gedit /etc/init.d/mountdevsubfs.sh

Look for this section and uncomment the last four lines (which is already uncommented here):

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


I also had to add this to my fstab (check your correct USB-group number under "System" "Administration" "Users and Groups", mine was no. 124):

none /proc/bus/usb usbfs devgid=124,devmode=664 0 0

Now, I needed more editing of my /etc/init.d/mountdevsubfs.sh

sudo gedit /etc/init.d/mountkernfs.sh

Paste the 2 lines below above the line: "# Mount spufs, if Cell Broadband processor is detected"

## Mount the usbfs for use with Virtual Box
domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev,devgid=124,devmode=664

After having used my USB-drive, VirtualBox still holds on to the USB-drive. I guess there is an easy way to fix this, but for now, I log out and in again after finishing my virtual session.

No comments: