VirtualBox is an open-source cross platforms virtualization application that allows anyone to create a virtual machine on their computer. It is similar to the popular VMware, but much smaller in size and handles the virtual machine more efficiently.
Before you attempt to install any Windows OS as a virtual machine, make sure that your computer has enough memory (at least 1GB of RAM) and hard disk and you own a genuine Windows installer CD with valid license key.
Installing VirtualBox
Go to the VirtualBox download site. Under the Platform dropdown box, select Ubuntu 8.04 (x86). AMD users please select Ubuntu 8.04 (AMD64). Check the agreement box and click Continue.
Check the box Sun xVM VirtualBox 1.6 and click “Download selected with Sun Download manager”. The program should now download the virtualbox_1.6.2-31466_Ubuntu_hardy_i386.deb file to your desktop. If you don’t have java runtime installed, you can simply right click on the file link and select “Save link as”.
(Click to enlarge)
Once the downloading is done, double click on the virtualbox_1.6.2-31466_Ubuntu_hardy_i386.deb to install the program.
After the installation, VirtualBox will create a group call vboxuser. You will have to add your user name to the group. To do this, go to System -> Administration -> Users and Groups.

Click the Unlock button, follow by Manage Groups.

Scroll down until you see the vboxusers. Click Properties.

Put a check beside your user name and click OK. Done
Go to Applications->System Tools -> Sun xVM Virtualbox. If you can’t find the entry, reboot your computer.
You should see the VirtualBox main window (image below) upon opening the application

Click New to install a new virtual machine.
On the welcome screen, click Next to proceed.
Give your VM a name and determine its type. If you are installing Windows XP, simply put “Windows XP” under the name field and select Windows XP under the OS Type dropdown box.

In the next screen, set your base memory size. If you are installing Windows XP, it is recommended to allocate at least 256MB of memory. If you have lot of memory in your computer, you can always allocate up to 1GB or more.

Next, you have to create the virtual disk space. Click New.

A new window will pop up. Click Next on the new window to proceed.

Select “Dynamically expanding image” follow by Next.
Give the image a name (can be the same as your VM name) and allocate the size. Recommended is at least 8GB. Click Finish to complete the process.


This will close the window and bring you back to the previous window. Select the virtual disk you have just created and click Next. The last part is the confirmation where it will show you the summary of your configuration. If everything is fine, click Finish.


You should now see an entry of the virtual machine in the main screen. Highlight it and select Settings (just above the entry). On the left pane, select the CD/DVD ROM. On the right pane, check the box ‘Mount CD/DVD Drive’ and select Host CD Drive. Click OK.

Now insert in the Windows XP/Vista installer CD. On the virtual box, highlight the virtual machine and click Start. The virtual machine should now boot up and you can follow the screen instruction to install Windows XP.
At any time, if you want to get out of the virtual machine screen, press right Ctrl button. Once you have finished installing the OS. Reboot into the virtual machine. Under the device menu, select Install guest addition. This will allow you to enjoy enhanced graphics and smooth mouse transition between the virtual machine and your host machine.
Great tutorial.
This is very helpful. I like the clear instructions with pictures.
Great guide, I encountered only an USB problem using VirtualBox. I tried the above install on a virgin Hardy install and it works great. When I try to edit a machine I get the following warning:
Failed to access the USB subsystem:
Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND). The service might be not installed on the host computer.
Anything I need to add you already have onboard?
Thanks,
OE
@Onno: You need to enable USB support on Hardy heron. Follow this guide http://maketecheasier.com/enabling-usb-support-for-vmware-server-in-hardy-heron/2008/05/05
Does VirtualBox really handle virtual machines more efficiently than VMWare?
@Damien, thanks it works. Please put a link in the article to make it even better.
Another thing: Under network I need to use “Host Interface” for server testing. Do you also have an artikel on bridging? Could you expand the artikel with (USB and) bridging?
Thanks again,
Onno
@Saman, under windows it does for me… with GUI and headless. Under Linux (Ubuntu) I still have to test it but the reviews favor VirtualBox.
Also VirtualBox has more flexibility (VMWare can give you that flexibility if you buy more products…), but the VB flexibility comes at some complexity cost (like cloning a server, machine + hard drive). And VirtualBox needs less resources…
Give it a try, if you need RDP, USB, iSCSI or SATA use the closed source version (as I do), otherwise try the open source edition. They are both free!
Regards,
Onno
This is very helpful tutorial and very easy. Every user understand easily.and i like clear instruction
with picture.
very-2 thanks for this tutorial.
VirtualBox kernel driver not installed. The vboxdrv kernel module was either not loaded or /dev/vboxdrv was not created for some reason. Please install the virtualbox-ose-modules package for your kernel, e.g. virtualbox-ose-modules-generic..
VBox status code: -1908 (VERR_VM_DRIVER_NOT_INSTALLED).
Result Code:
0x80004005
Component:
Console
Interface:
IConsole {1dea5c4b-0753-4193-b909-22330f64ec45}
There is a conflict in kernels in the latest Ubuntu Intrepid kernel update. Try to rebuild the vbox kernel:
sudo /etc/init.d/vboxdrv setup
i have this same error and everytime i try to type it in it says
vick@vick:~$ /etc/init.d/vboxdrv setup
open: Permission denied
open: Permission denied
* done.
open: Permission denied
/etc/init.d/vboxdrv: 311: cannot create /var/log/vbox-install.log: Permission denied
open: Permission denied
* Look at /var/log/vbox-install.log to find out what went wrong
Hi!
Did you thought about using the sudo command??
Try :
sudo /etc/init.d/vboxdrv setup
Tell us if that works! ;-)
vick@vick:~$ sudo /etc/init.d/vboxdrv setup
[sudo] password for vick:
* done.
* Look at /var/log/vbox-install.log to find out what went wrong
vick@vick:~$ /var/log/vbox-install.log
bash: /var/log/vbox-install.log: Permission denied
Is it possible for you to post your /var/log/vbox-install.log ??
you do gedit /var/log/vbox-install.log
Have a nice day!
By the way…. there were many bugs in Hardy when using Virtual Box…
We are in 2009!!! Upgrade your distro!
The virtual box installer has been improved, but only for these new Ubuntu versions…
There is no reason to continue using Hardy! ;o)
i am sorry to keep asking u these question but this is my first time ever working on ubuntu and i realy dont noe anything about it
after i did
gedit /var/log/vbox-install.log
i get
Makefile:127: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop.
Hi!
In order to help you further then is it possible for you to answer the following questions :
Which version of Ubuntu are you using?
(to know it open a terminal and do : uname -a )
Are you using a tar.gz package to install or if you are installing using apt-get (sudo apt-get install virtualbox-ose ) ??
Under Ubuntu, you just have to type in a terminal : sudo apt-get install virtualbox-ose to install it!
i am using ubuntu 8.04
vick@vick:~$ uname -a
Linux vick 2.6.24-24-lpia #1 SMP Fri Apr 17 18:49:17 UTC 2009 i686 GNU/Linux
then i did
vick@vick:~$ sudo apt-get install virtualbox-ose
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Couldn’t find package virtualbox-ose
vick@vick:~$
i want to remove ubuntu and just install windows xp how do i do that
Hi! (sorry for my english, my first language is french!)
Honnestly, i really don’t suggest you to learn Ubuntu using Hardy… that release is very old and there is most of the time many tweeks you have to do to make it work correctly..
The last release of Ubuntu, Karmic Koala, allow you to upgrade while keeping your personnal files and datas… go to ubuntu.com to download the latest release, open a terminal and type : sudo apt-get install virtualbox-ose
It will work right away after that!!! (it install under menu – accessories)
f you really want to keep your old Hardy you can do the following… it worked for me at the time i was using that old and hard-to-configure-Hardy version :-p
first download virtualbox… go to :
http://download.virtualbox.org/virtualbox/3.0.12/virtualbox-3.0_3.0.12-54655_Ubuntu_hardy_i386.deb
then double click on it’s icon to install it or, open a terminal, go to the directory where you downloaded it and type : sudo dpkg -i virtualbox_1.6.2-31466_Ubuntu_hardy_i386.deb
This will complete the installation.
Now, you have to setup the user permissions
Goto System -> Administration -> Users and Groups
Click on the “Unlock” button
Enter in your password and click on “Authenticate”
Click on the “Manage Groups” button
Find the “vboxusers” group which is probably at the very bottom of the list, highlight it by clicking again, and click on “Properties”.
Make sure there’s a check mark next to your user’s name, and click on ok you’re finished.
Now, go to Applications—>System Tools—>Sun xVM VirtualBox and create your first virtual machine!! :o) et voilà! :o)
DO THE FOLLOWING ONLY IF YOU WANT YOUR USB PORTS TO WORK UNDER YOUR VIRTUAL MACHINES (THIS IS REALLY NOT ESSENTIAL!!!)
Enable USB Support in Virtualbox
By default USB support was disabled in virtualbox, 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
Inside, 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
Change it to look like this (uncomment out the region by deleting the “#’s”):
#
# 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
Save the changes and exit.Now log out, and then log back in again for the changes to take place.
Does not include discussion on Guest Additions
Hi
I need some help can i install virtual box to be able to switch fast between XP and ubuntu IF i already have xp and ubuntu on my laptop ?
i got and hp dv9040us core duo 1.6GHZ 2Ram 2 HDD and both of my OS XP and ubuntu are on C drive
Can i still install virtual box even if i already have XP and ubuntu and i have a dual booting but i have to restart the laptop every time i want to change the OS or switch
For the first qn, the answer is No. If you are already dualbooting Ubuntu and Windows, you can’t use Virtualbox to connect to both and that is not what Virtualbox is meant for.
For the second question, as long as you have sufficient space in your hard disk, you can always install Virtualbox, regardless you are in Windows or Ubuntu.
Hi,
Thanks a lot, is there anyway or another software to use/load the already installed windows instead of installing it again from the scratch in the VirtualBox?
i’m also running a dual OS
No. If you are running a dual OS system, the best that you can do is to read/write files from the other OS partition. You won’t be able to use Windows and Ubuntu at the same time.
@Paul; what you have is a dual boot system; in other words: the OSes are running “next to each other but not at the same time” (hence dual boot). What virtualbox can do for you is: run the OSes “on top of each other at the same time” (hence you can switch on demand).
Example: I have a single boot laptop with Ubuntu on it. I installed Virtualbox and installed Win XP (and others!) in Virtualbox. I can switch between Ubuntu and Win XP by just moving the mouse out of Win XP to Ubuntu.
Hope this clarifies things…
Hi!
I have a little question : i can see i also have the option to install something call wined3d…
What is it usefull for? Do i have to install it absolutely?
Thanks in advance for your help!
This was a great help. I didn’t think of rebooting my computer until I found this helpful site.
The Wine3d is a module to enable 3D acceleration for Windows guest. It is not a must to install it, but if you host computer can support it, installing the Wine3d can give your Windows guest a much better graphics handling capabilities
Hi. Followed instructions, everything went well! Thanks for this how-to. Little trouble with ++g but got it working. Unfortunately, little problem with Ubuntu:
“Building and using a custom kernel will make it very difficult to get support for your system. While it is a learning experience to compile your own kernel, you will not be allowed to file bugs on the custom-built kernel (if you do, they will be Rejected without further explanation)”
(Taken from https://help.ubuntu.com/community/Kernel/Compile)
Just an FYI.
Works Like charm…thanks for sexy tutorial :)
Works fine for me. Good tutorial.
I am not much of a windows fan, but google’s decision not to bring video and voice to gtalk left me no other option rather than to run windows (After trying lots of options).
It loads and then gives me an error message saying I need 32 bit processing and then it stops. I am not sure how to change that.
Please help!
Thanks
What is your PC configuration? Are you using the 32-bit or 64 bit version?
Hi!
(sorry by the way for my english, my first language is french!!)
Honnestly, Ubuntu Hardy is something very old… …your kernel is too old to use the latests improvements in matter of virtualization… There is many tweeks to do, and i don’t think it is a good idea for a newbee to start with that one… Ubuntu is now very easy to use, but Hardy was a bit hard (as the name say! to configure for someone who don’t know a lot about Linux).
I don’t know why you are using that release!!! Under Ubuntu Karmic, the latest release, all you have to do to install Virtual Box is type in a terminal : sudo apt-get install virtualbox-ose
If you decide to upgrade to that new release, don’t worry for you files and datas : it is now possible, while installing from the live cd to keep you files and settings…
If you don’t want to reinstall everything on your pc, i suggest you to do the following… it worked at the time i was using Hardy :
First, download VirtualBox :
http://download.virtualbox.org/virtualbox/3.0.12/virtualbox-3.0_3.0.12-54655_Ubuntu_hardy_i386.deb
sudo dpkg -i virtualbox_1.6.2-31466_Ubuntu_hardy_i386.deb
This will complete the installation.
Now, you have to setup user permissions
Goto System -> Administration -> Users and Groups
In the window that will open, click on the “Unlock” button and then enter in your password and click on “Authenticate”
Now, click on the “Manage Groups” button
Find the “vboxusers” group which is probably at the very bottom of the list, highlight it by clicking again, and click on “Properties”. Make sure there’s a check mark next to your user’s name, and click on ok you’re finished.
Now, to open virtualbox go to Applications—>System Tools—>Sun xVM VirtualBox
To do the following is not essential, but may help if you want your usb ports to work under your virtual machine : (NOTE : THIS IS NOT ESSENTIAL.. IT MAY WORK WITHOUT DOING THIS!!!)
Enable USB Support in Virtualbox
By default USB support was disabled in virtualbox, 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
Inside, 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
Change it to look like this (uncomment out the region by deleting the “#’s”):
#
# 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
Save the changes and exit.Now log out, and then log back in again for the changes to take place.
Create a New Virtual Machine in Virtualbox and Voilà!!! :o)
Hope that will help!
Carl
Hi there. I’ve been looking for a tutorial like this but I’m wondering if you’re going to update it for 9.10 a.k.a Karmic Koala?
@Randal: I have been using the same steps from Ubuntu Hardy to Karmic and I can assure you that the above tutorial still works for Karmic. There may have some interface change in Virtualbox, but the steps are still the same.
Hi, I have virtual box 1.6.6 on Ubuntu 8.10, and Win XP. I am having a bit of trouble in folder sharing between the two machines. If anyone could help me, it would be greatly appreciated.
cheers
hi all,
i am new user for ubuntu and would like to install windows xp inside ubuntu 10.04 by using virtualbox.
i tried installing but it gives me a warning that Cd rom is not detected , so all functions may not work….
and the main thing is my cd rom is not working properly, so i want to know wether we can install the windows using USB with the help of virtualbox….
thanks.. and waiting for ur replys
@Sharath: There is no option to boot from USB in Virtualbox. An alternative is to create an ISO file from your Windows installer CD. You can then use this ISO to install Windows in Virtualbox.
@Kwanza: Check out this link http://maketecheasier.com/share-files-in-virtua… for information on file sharing in Virtualbox
Thanks Damien, all sorted out now, I haven't had the guest additions installed…