How to install Virtualbox & run Windows XP / Office 2007 in Ubuntu

Virtualbox is a virtualisation package for Linux originally developed by Sun Microsystems. It’s an incredibly powerful and easy way of being able to run Windows XP or Vista from Ubuntu. This guide will talk you through the process of installing Virtualbox, after which we’ll look at installing Windows XP. Running XP inside Ubuntu has so many benefits, like file compatibility, using active-x in internet explorer and lots more.

Here’s a few shots of my PC running Ubuntu and Windows XP, BBC Iplayer and Microsoft Office 2007. Click the images for a full size view:

Ubuntu running Windows XP

virtualbox running Windows XP and BBC iplayer

Run Office 2007 from Ubuntu using Virtualbox

I took the screenshots while Compiz cube was in mid-rotate. Looks good doesn’t it? (If you haven’t done so already, I recommend you install compiz fusion!) Performance wise, Windows XP starts up just as quickly if not slightly quicker than a standard installation if you have a powerful machine. Just goes to show what a great operating system Linux can be. :-)

How is it done?

Installing Virtualbox is quite straightforward. There’s a simple process to follow to get up and running with your XP virtual machine. That process looks like this:

1) Install Virtualbox using Synaptic package manager

2) Add your user profile to the vboxusrs group so Virtualbox will work

3) Create a virtual machine in Virtualbox

4) Install Windows XP (from CD in this post) on your new virtual machine

5) Booting your virtual machine from the Windows XP installation CD

Installing Virtualbox using Synaptic Package Manager

Open Synaptic (System>Administration) – search for “virtualbox-ose” and install.

Add your user profile to the vboxusrs group

Once Virtualbox is installed, you’ll have to add your user profile to a group created by the install process called vboxusrs. Time to start using Terminal – here’s the command:

sudo adduser [your username] vboxusers

Create a virtual machine in Virtualbox

You’re now ready to start the application (Applications>System Tools>InnoTek VirtualBox) – here’s how it looks:

Virtualbox in Ubuntu

We’re going to create a new virtual machine called WinXP-2 so you can see the process from start to finish. There are about 8 steps to follow, begin by clicking the “New” button.

The virtual machine wizard dialogue. Click next to get started, give the new machine a name and select the type of OS you’re going to install.

Give the new machine a name and select the type of OS you’re going to install.

Create a “dynamically expanding image” – if you use up all the available space the disk image you’re creating will expand.

Now select the actual size of the image. This is how much virtual hard disk space you’ll have to play with when you first boot the machine. When you click next you’ll be given a summary of what’s happening so far.

You’re now taken to the Virtual hard disk dialogue and your new hard disk has been created and should display in the drop down. Click next. You’re given one final confirmation and that’s it, click finish.

Booting your virtual machine from the Windows XP installation CD

Clicking finish will take you back to the virtualbox user interface. Clicking “start” will initiate the first run wizard. There’s no need to use the wizard, actually it’s quite important to get used to the settings dialogue.

To be able to get your virtual machine booting from an XP install cd, we need to mount the CD/DVD drive. Click the settings button and you will see this window – click the CD/DVD-ROM tab.

Virtualbox settings

Make sure you select the “Mount CD/DVD Drive” checkbox.

While you’re in the settings window, familiarise yourself with the different tabs. Particulary, “Network” – it’s worth taking a look and making sure that the “cable connected” check box is selected – which enables your new virtual machine to get an internet connection. When you’re done, click OK.

Finally, with the Windows XP installation CD in your drive, click the start button. With any luck you’ll see a new installation happening right in front of you!

XP installing in Ubuntu

Once you’ve got XP completely installed, you might want to install the guest additions ISO, which will allow you a full screen resolution and a lot of compatibility between Ubuntu and XP. I’ve just published a post about doing this here. Enjoy!

seperator

28 Comments

  1. ubuntugeek
    July 20, 2008 at 10:52 am | Permalink

    Very useful post thanks!!

  2. asd
    July 21, 2008 at 8:37 am | Permalink

    no cube ): everyone loves that cube..

  3. samm
    July 21, 2008 at 8:49 am | Permalink

    you might want to add that if you turn off emerald with metacity –replace you can run windows seamlessly in virtualbox…it’s a beautiful setup…

  4. July 23, 2008 at 5:54 am | Permalink

    so confused. im a bit of a noob, need more explanations. at least i got ubuntu running…

  5. Mark
    July 23, 2008 at 11:59 am | Permalink

    Great tutorial, thanks!

  6. gnarlygnome
    July 23, 2008 at 8:12 pm | Permalink

    @ ALLEN

    It’s pretty easy, whats the problem apart from the fact you are not going to be able to get the USB port to work on your guest OS (The tutorial didn’t deal with that fact) .

  7. Kristof78
    July 24, 2008 at 9:46 am | Permalink

    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.

  8. scott
    July 24, 2008 at 10:27 pm | Permalink

    to the poster – virtualbox was ORIGINALLY developed by innotek. you really should read this – http://www.sun.com/software/innotek/. it is great software, and i’m not sure if this changed since sun acquired them but it used to be the compiled binaries supported usb etc and the ose (open-source-edition) that is in the repositories did not have that and some remote features etc. correct me if this has been added since sun acquired them!

  9. scott
    July 24, 2008 at 10:30 pm | Permalink

    and yes, there are differences in the editions. see http://www.virtualbox.org/wiki/Editions.

  10. Jeff
    July 25, 2008 at 2:45 am | Permalink

    Nice post. Now you can point the readers to the Seamless Windows with Compiz-Fusion in Ubuntu Forums.

    I run it here on my machine, for the one program in windows I must have. I get all the effects, and it works great. The method I used doesn’t seem to mind emerald, either.

  11. Zack
    July 28, 2008 at 4:12 pm | Permalink

    Just a note: I had to install virtualbox-ose-modules-generic before I could start virtualbox.

    sudo apt-get install virtualbox-ose-modules-generic

  12. bramlet
    August 2, 2008 at 2:45 pm | Permalink

    What system requirements do you need to get this to work nicely. I have 2 ghz athlon 64, and one gig ram, and 8500 nvidia card.

  13. cool
    August 8, 2008 at 9:55 pm | Permalink

    nice post, thank you.

  14. August 10, 2008 at 4:00 pm | Permalink

    Nice one will try once with my Ubuntu box, Thankx

  15. toby
    August 18, 2008 at 9:43 pm | Permalink

    how is this different than just running vmware?

  16. Jake
    August 19, 2008 at 5:03 pm | Permalink

    I’m sort of not-so-linux-knowledgeable… but I guess this tutorial should work for Kubuntu as well, right?
    Thanks!
    (BTW, this is fantastic news: I am still dependent on some Windows programs)

  17. Tom Moss
    October 14, 2008 at 3:01 pm | Permalink

    Hey I tried to do as above however when I am asked to agree to the lisence agreement of windows in the setup it needs me to press F8. It doesn’t read this it just adjusts the brightness of my mac! Is there any way to get around this? When i press other keys it works!

  18. October 14, 2008 at 5:30 pm | Permalink

    @Tom Moss

    Hi Tom! That’s quite a problem. It sounds like Vbox isn’t listening to your keyboard, or the host key has been pressed. You *should be able to get round this by clicking with the mouse in the vbox window first. Let me know if that works, and sorry if you’ve already tried.

    I’m actually not a MAC person (I’m an Ubuntu?!) But I did find this: did find this. Hope that’s useful!

  19. E. Zachary Knight
    November 6, 2008 at 6:50 pm | Permalink

    I have been trying to install XP in Virtual Box for a few days now, but can’t get it to work. Both of my XP install disks are multi disk installs. The first is the Gateway OS install disk that came with my laptop. It starts off with a red driver disk and then asks for the blue OS disk. When I stick the blue OS disk in, it won’t read the disk.

    The Second is an XP home upgrade disk. I stick the XP disk in and it starts alright. Then it prompts for a previous version of Windows. I stick in the 98 disk and it verifies and asks for the XP disk again. When it gets to that point it fails.

    I am running on Ubuntu 8.04 with 2.8ghx processor and 1.5gigs of RAM.

  20. November 6, 2008 at 8:21 pm | Permalink

    Hi There E. Zachery. Yeah, you’re going to need a full xp install cd, not an upgrade disk. There’s no point messing around with old upgrade cds / OEM installation CD’s for branded machines. Get an XP licence and you’ll be fine!

  21. E. Zachary Knight
    November 7, 2008 at 4:21 am | Permalink

    Thanks Richard. I actually found a way to work with upgrade disks. I haven’t tried the trick for OEM disks though.

    Basically, I made a iso copy of all the disks in the process and used the cd change icon in the VirtualBox window to swap isos when disks needed swapping. Worked like a charm and I am now installing XP.

    I will touch back when I try it with my OEM disk.

  22. E. Zachary Knight
    November 10, 2008 at 2:28 pm | Permalink

    I tried the OEM disks the same way with the ISOs. It installed just fine, but does not recognize that it is on the same original laptop. So it treats it like a 30 day trial.

    Oh well. Not much I can do there as OEM licenses are not transferable.

  23. November 10, 2008 at 4:49 pm | Permalink

    Yeah – you’ve got to get a full Windows XP licence. If I were you I’d get a new CD too! Thanks for the update!

  24. alienkid
    January 22, 2009 at 10:22 pm | Permalink

    at step 4 it says “(from CD in this post)” but there is no “CD” in this post so what do I do?

  25. January 22, 2009 at 10:43 pm | Permalink

    @alienkid – step 4 is the bit where your virtualbox machine is ready to boot into a windows XP installation CD. If you don’t have one, make one. You’ll need a Windows XP licence.

  26. Wordsmith
    April 9, 2009 at 1:24 am | Permalink

    I have a full XP install disk and VirtualBox works great on my Mac, but when I put the XP disk in, I get a “you’ve put a blank disk in” message. What gives? (And I am a little technologically challenged.”

  27. Georgi Hockaday
    May 7, 2009 at 1:14 am | Permalink

    I wiped out my Windows OS on Dell Dimension 2400 desktop and completely installed Ubuntu Hardy Heron about six months ago. Now I would like to be able to use software that is only Windows compatible.

    1) Please confirm that I understand correctly: To install WinXP in Virtual Box, I CANNOT use my Dell re-installation CD. I will need a new installation disk with a new license.

    2) If I cannot buy a WinXP disk, can I install Vista Home Edition on Virtual Box instead?

    System: 63G hard disk free, Intel Pentium 4, 2.80GHz CPU, highest grade NVidia compatible graphics card for age of computer. Will this handle Vista?

    3) Not sure I understand how I can run Windows software on an Ubuntu system. Doesn’t Windows software require MS drivers?

  28. Dread
    May 25, 2009 at 10:51 am | Permalink

    nice it works very well.
    cpts

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*