Howto: Install VirtualBox in Ubuntu Hardy Heron with USB Support in 5 easy Steps!

*update* New Verson of Virtualbox Just released! Click Here!
When I last checked Virtualbox did not update their repositories for Hardy Heron, its not a problem, their is a hardy package without a repository. I have created a howto last year on howto setup VirtualBox completely and to seamlessly integrate windows xp into your ubuntu desktop here

So lets install the brand new virtualbox package for Hardy Heron...

Lets Install the essential build utilities so the vbox kernel module builds.
sudo apt-get install build-essential linux-headers-`uname -r`
Install i386 VirtualBox without repository:
wget http://www.virtualbox.org/download/1.5.6/virtualbox_1.5.6-28266_Ubuntu_hardy_i386.deb ; sudo dpkg -i virtualbox_1.5.6-28266_Ubuntu_hardy_i386.deb
Install amd64 Virtualbox without repository:
wget http://www.virtualbox.org/download/1.5.6/virtualbox_1.5.6-28266_Ubuntu_hardy_amd64.deb ; sudo dpkg -i virtualbox_1.5.6-28266_Ubuntu_hardy_amd64.deb

Check Here for updated Virtualbox Packages since the repository isnt added yet

Alternate install with Gutsy repository as some people have suggested works fine, just copy/paste these exact commands into the terminal:
sudo sh -c 'echo "# VirtualBox repository for Ubuntu Gutsy
deb http://www.virtualbox.org/debian gutsy non-free" \
> /etc/apt/sources.list.d/gutsy-virtualbox.list'
wget http://www.virtualbox.org/debian/innotek.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install virtualbox


Now you Must add your self to the vboxusers group:
sudo adduser $USER vboxusers
Adding user `ionstorm' to group `vboxusers' ...
Adding user ionstorm to group vboxusers
Done.

Setup VirtualBox USB Support:
USB is disabled by default, so you'll probably want to enable it. Otherwise you'll get an error when you go into the "Settings" of your virtual machine. To correct this, you'll need to edit the mountdevsubfs.sh file:
sudo gedit /etc/init.d/mountdevsubfs.sh
You'll see a block of code that looks like this:
#
# 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 uncomment the last 4 lines above to look like this:
#
# 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


Ok now logoff, then log back in so the vbox driver see's you are logged in to the vboxusers group.

If the above doesnt work try rebooting, if that doesnt enable usb you can try this:
Grab the vboxusers group id:
grep vbox /etc/group
vboxusers:x:124:ionstorm

Edit the fstab with the group id # in bold:
sudo gedit /etc/fstab
Append this to the fstab then save/exit:
## usbfs is the USB group in fstab file:
none /proc/bus/usb usbfs devgid=124,devmode=664 0 0

Now lets edit the mountkernfs.sh file with the gid in bold:
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


You may not need to reboot, try doing:
sudo /etc/init.d/mountkernfs.sh

If not, reboot, and virtualbox should detect your usb devices!

You can follow my directions here to learn how to integrate Windows XP into your desktop!

Checkout the Official VirtualBox User Manual Here

Comments (66)

Loading... Logging you in...
  • Logged in as
John Lee, VirtualBox 1.5.6 works fine on my Ubuntu 8.04

Try to add that line to sources.list, after that sudo-apt get install VirtualBox works!

deb http://www.virtualbox.org/debian gutsy non-free

1.6.0 will be avaible in the nearest future!
got almost everything to work, except the windows vm doesn´t recognize my ipod. Device manager says it won´t start.
I have added a gutsy repository method as suggested to the howto since the gutsy version works just fine
I have a questions how do you do the last part it is confusing me for some reason
This is the part I am getting stuck at: Now lets edit the mountkernfs.sh file with the gid in bold:

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

## Mount the usbfs for use with Virtual Box

domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev,devgid=124,devmode=664
Thanks a lot! I was resigned to waiting for virtualbox to release their hardy version before I could get usb support. Your instructions worked without a hitch!
I seem to have this up and running just fine, but I noticed that 1.6.0 just came out, how would I go about updating to this newest version?
Excellent article...but can anyone lend a hand here? I have everything working, except that my guest XP install can't find a the virtualbox usb driver...so, even though VB can access my usb ports correctly, I can't get my devices recognised doesn't think it has a working USB port. I have searched everywhere and no one else seems to have this problem. Any ideas?
1 reply · active 877 weeks ago
vrtualbox-ose is now in the universe repo with Hardy
Now lets edit the mountkernfs.sh file with the gid in bold:

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

Obviously, this should be :

sudo gedit /etc/init.d/mountkernfs.sh
So which is it, mountdevsubfs.sh or mountkernfs.sh ? And where in this file should you append the new line ? Just somewhere among the other domount lines ?
1 reply · active 881 weeks ago
Gee, wish I'd seen this before I toodled on over to Sun's website, downloaded and installed VirtuaBox 1.6.1 by simply double-clicking on the download. Oh, yeh. Dragged a link to the desktop for easy access. Old-style thinking (going to the source of the software) is what caused me all that trouble. :-)

Nice to know there are multiple ways to do the install, though.
Thanks a lot buddy. Worked for me on a ThinkCentre A55 with Kubuntu Hardy Kde4 with WinXP guest.
Thanks! I thought for awhile it wasn't working - until I remembered to check VirtualBox's setup screen and enable USB support. Now I think I can get rid of my Windows partition.
followed both instructions for enabling the USB ports. this page is the closest thing i can find to a tutorial, but it's still not working. hardy, kde4, xp sp1 guest, ipod photo.
Dominic Bartel's avatar

Dominic Bartel · 880 weeks ago

worked for me! thanks!!
I'm using virtualbox-ose from the repositories, all the usb enabling steps went through smoothly, but still, no USB in virtual box..

Anything else I could do?
1 reply · active 879 weeks ago
great man, finaly was perfect.
how can i write in bold in text editor?

please im new in linux
Perfect, worked like a charm! thanks a lot. I posted it to my blog (http://mytechnicalthoughts.blogspot.com/)
Mike Smith's avatar

Mike Smith · 877 weeks ago

I am on 1.6.-2 I have clicked on the enable USB drivers. It sees my drives. I have followed this instructions and the WIn XP drives sees my USB drivers but not my drives?

Any ideas?
You do not explain why you do all that, why not? Digo, estaría bien entender la estrategía de lo que estamos haciendo y no solo hacer lo que dice sin saber porque cada paso.
1 reply · active 876 weeks ago
For the sake of preserving the value of your post, please defend your interests here:

http://forums.virtualbox.org/viewtopic.php?t=7255...

Thanks in advance!
thanks!
Pedestrian's avatar

Pedestrian · 875 weeks ago

You just have forgotten to add in the end word 'start' :-)

You may not need to reboot, try doing:

sudo /etc/init.d/mountkernfs.sh start <----

And you do not need to reboot -(It's LINUX , YOU DO NOT NEED TO SAY and DO 'REBOOT' like as in windows platform where from scratch 'software architect' from 2 year forgot insert a lot of things!

Post a new comment

Comments by

Clicky Web Analytics