Currently you're dual booting, but that sucks.
No worries, the latest version of Virtualbox allows to wrap an existing physical partition as a virtual machine.
Here's how to do it.
1. Install Virtualbox
Firstly; do not install the Virtual box which comes standard in the Ubuntu repositories. In order to support this functionality you have to download the closed source version from Sun. BTW I give Kudos to Sun for being .deb friendly.
2. Setup your permissions.
After you've installed virtualbox you will need to assign your user to certain groups in order to access the physical partition and virtualbox for that matter.
The commands are as follows:
- "sudo usermod -a -G disk
- "sudo usermod -a -G vboxusers
You will need to log out of your terminal and then log back in for the changes to take effect.
3. Prep your Windows installation.
Since Virtualbox imposes a Virtual hardware environment to the guest operating system, Windows is going to try install all the new drivers for Virtualbox's virtual hardware environment. This is a problem if you wish to boot back into that Windows partition. For this reason you have to create two separate hardware profiles in Windows; one to run physically and one to run as a guest operating system. This can be done under System Properties > Hardware > Hardware profiles.
Next you have to run a utility called MergeIDE which you can get here. As it turns out Windows writes some registry information about your physical IDE controller into the registry. MergeIDE does some funky rewiring of the registry in order to get around this so that you can "move" your Windows installation onto another hardware environment.
4. Create a virtual hard disk for Virtualbox (VMDK file).
The first thing you need to do is determine which partition your MBR (master boot record) lives on. You can determine this using fdisk or checking your Grub settings.
Finally when you have all this information you create the VMDK file using the command:
VBoxManage internalcommands createrawvmdk -filename [Absolute_Path_to_output_File] -rawdisk /dev/sda -register
You then start Virtualbox, create a new Virtual machine and select this created VMDK file as the hard disk for this VM.
5. Modifying your VM settings for Windows.
In the settings for your virtual machine, under "general" you need to enable the IO APIC and VT-x/AMD-V options in the "advanced" tab.
6. Fixing the licensing issues.
The Windows XP volume license registers your license key against the BIOS for that machine. When Virtualbox loads your guest operating system it presents virtual BIOS information to that OS, which obviously invalidates the license you currently have installed for XP since from it's point of view it's now on a different machine.
In order to fix this you have to modify the settings of your VM config file in order to report your physical BIOS information.
First you have to get the information using the dmidecode command. To get the DMI bios information and the the DMI system information run: dmidecode -t0 and dmidecode -t1 respectively.
You then have to append this information as a set of key-value pairs to your virtual machine settings. A list of all the variables can be found in section 9.13 of the VirtualBox user guide.
The user guide explains how to do this using the "VboxManage" command I found it easier to add the variables myself to the config file of your VM which can be found at ~/.VirtualBox/Machines/My_Windows_Machine/My_Windows_Machine.xml and can be added under the <ExtraDataItems> element.
And that should be it, now you can fire it up!
Some final information.