If you've installed VirtualBox as instructed in my tutorial "Install and configure VirtualBox for virtual OSes" you most likely have discovered that the open source edition of VirtualBox does not have USB support. In fact there are a few other features the open source edition does not offer that the closed-source edition does (such as offering the Remote Display Protocol so you can connect to a virtual machine remotely). But to get these features you will have to uninstall your current VirtualBox OSE installation, install the closed source version, and then configure your set up to allow USB support. It's not difficult so pretty much anyone can undertake this. In this article you will see how to uninstall VirtualBox OSE, install VirtualBox, and configure VirtualBox to allow USB support. For the purposes of this article, I will using a Ubuntu 9.04 installation to make things easy. NOTE: If you have virtual machines installed you will lose the data on those VMs.
Remove VirtualBox OSE
This is the easiest part of the tutorial. All you need to do is open up a terminal window and issue the command:
sudo apt-get autoremove virtualbox-ose
Once the OSE version has been removed it is time to install the closed source version of VirtualBox.
Installing closed source VirtualBox
The first thing to do is to add the proper sources to your /etc/apt/sources.list file. Open up that file, with your favorite editor, and add the following line to the end of that file:
deb http://download.virtualbox.org/virtualbox/debian jaunty non-free
Now save the VirtualBox repository key on your machine (for the sake of simplicity place it in ~/Downloads) and issue the following command:
sudo apt-key add ~/Downloads/sun_vbox.asc
which will add the repo key to your system. Before you run the install update apt with the command:
sudo apt-get update
Now you can install the closed source version of VirtualBox with the command:
sudo apt-get install virtualbox-2.2
During the installation you will also have to OK the compilation of the proper kernel module. If you do not do this you may not be able to create any VMs.
The last step for the installation is to add your user to the vboxusers group. Do this with the following command:
sudo gpasswd -a USERNAME vboxusers
Where USERNAME is your login. You will be prompted for your username.
Now it's time to configure the system to allow USB support. You have to get the user ID of the vboxusers group. To do this issue the following command:
grep vboxusers /etc/group
which will report something like:
What you need to now do is add a line to the /etc/fstab file. This line will be (if we stick with the user ID report you see above):
none /proc/bus/usb usbfs devgid=123,devmode=664 0 0
With that file saved you are ready to reboot and start up VirtualBox with USB support.
There are a lot of reasons why you would want to have USB support added to VirtualBox. For those iPhone owners out there it will give you a means to administer your phone without having to have a separate machine (or dual boot) in order to do so. This also greatly expands the capabilities of VirtualBox. The only downfall is you are giving up the open source version in order to gain USB support. For many this will be a worth wile trade-off. For others, giving over to closed sourced software isn't worth having USB support. It would be nice, however, if Sun would open source the USB supported version.Advertisement
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.