Monday, November 5, 2007

Step 1: Getting VirtualBox up and running


There are two versions of VirtualBox, the OSE (opensource edition) and the closed source, binary one. The OSE edition is the one you will find in the Ubuntu repositories (add/remove programs), but it lacks some features of the binary one, most notably, USB support. For this reason, I would advice using the binary. For Gutsy, download it here:


After downloading virtualbox, open it, and proceed with the installation.

After installing, you will get a warning that you need to add users to the vboxusers group. Let's do so now:

System menu > administration > users and groups > manage groups

Select the “vboxusers” group > properties > check any users you want to be able to use VB.

Now log out, and log in again for these changes to become effective.

Configure VirtualBox

Run VirtualBox from Applications > System Tools
Fill out the registration form, and create a new VM, give it a name, select the appropriate OS Type for what you intend to install (XP in my case):

Select the amount of RAM you want to give to your VM. For XP you will need at least 256 Mb RAM, depending how much RAM you have and on what windows applications you intend to run 500Mb or more is probably better:

Create a new virtual hard disk

Select Dynamically expanding. Give it a name and size. Important! you will not be able to increase the size after creating it (although you can add other virtual drives). Since unused space on your virtual drive will take no room on your real hard disk, make this disk large enough!
Click finish.

Prepare booting your VM

Click on “Settings” to modify some properties of your VM. If you use Gutsy, you may now get this error: "Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND)":

To fix it, we need to enable usbfs. Open a terminal and type:

sudo gedit /etc/init.d/

Find this part:

# 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

remove the # sign in front of the last 4 lines so it 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
Reboot Ubuntu.

Restart virtualbox, select your VM, then click settings. You should have no error messages now.

Go to CD-DVD-ROM, and select the “mount CD/DVD drive” checkbox. Verify that the device is correct ((/dev/cdrom in my case).

You probably also want to enable sound in audio /enable audio. ALSA is the most likely choice. If you want any USB devices to be available to windows, go to USB, enable it and click the tiny “add from..” button, select the device(s) you need.

Setting up some shared folders is a good idea too, these will be network drives available in your VM. In this example I mapped my home folder:

Now insert your windows installation disk (not a recovery disk!) in the cd drive, and start your virtual machine. Windows setup should boot from the CD.

Install windows as you would normally.

If the VM "steals" your mouse and keyboard, the default key to release them is the right control key on your keyboard. You can change that, but we will change this behaviour later anyway.

Proceed with Step 2


egrad said...

My XP wont install. setupdd.sys could not load error 4. I looked it up and its a "bad hardware" problem I'm not sure what to do. Any help would be great.

Anonymous said...

Thank you for your tutorial. I really enjoyed your movie (youtube) too.
Viele Grüße


Anonymous said...

im really appreciating this tutorial mister. i have yet to use ubuntu and im waiting to get everything down so i can install beryl on my ubuntu and dual boot it with my existing windows vista. but anyway i have a question.

is it possible to install the VB so that it boots only when my external hard drive is plugged into the usb port, that way i dont lose everything i have installed in my vista ?

Anonymous said...

Great tutorial, helped me a lot


Anonymous said...

I am new to ubunto, however not new to using virtual pc's (VMware). I want my laptop to boot ubunto and auto-start compiz and virtualbox to run my windows os 9as you say, its MAGIC).
Few questions:
-What version of ubuntu and what sub-version(?) (hardy, gutsy).
What is the diff between hardy and gutsy?
-Viryualbox version?
-compiz version?

are my current 'virtualbox pc's' (migrated from vmware to virtualbox) still usable?

Please let me know.


Anonymous said...


This tutorial is pretty easy to follow nice one. Typing:
sudo gedit /etc/init.d/
brings up a page of script but i cannot see anywhere:
# 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 tried copying and pasting it into various places with out the #'s but it still brings up the error message. I am not using Gutsy, I am using 8.1 Ubuntu (2.24.1).

Any advice?

Anonymous said...

Oh and my email is:

Timothy said...

I'm trying this product for the first time. My OS is a Windows 7 Ultimate 64 bit. I installed Windows 7 Home Premium 32 bit and when i went to settings, the program told me that the USB is turned off and I had to install this extension pack which I did. The problem is that even after I did so, it keeps giving me this warning message every time I click on settings:

Failed to access USB subsystems.
Result Code: E_FAIL (0x00004005)
Component: Host
Interface: IHost {35b004f4-7806-4009-bfa8-d1308adba7e5}
Callee: IMachine {662c175e-a69d-40b8-a77a-1d719d0ab062}

Any idea what all this is about?