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.
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!
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/mountdevsubfs.sh
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 workReboot Ubuntu.
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
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