I made this tutorial because I have been searching for an open source virtualization solution. I've tried VMware, but didn't like the GUI (it felt too slow) and the fact that it was closed source. Virtualbox was more appealing because it is open source and because it doesn't currently require a hack to get running in Hardy. After tons of research, I've found that the solution couldn't be simpler.
Please read or skim the tutorial before attempting it. Note: This tutorial was tested to work with VBox 1.6 and may not work for users w/ SATA drives.
Step 1: Create a grub boot cd
Creating a grub cd will let you boot straight into your target Windows partition.
Following method adapted from grub manual.
Configure /home/you/iso/boot/grub/menu.lst to boot your target partition. Remove the "savedefault" option from your target entry if it exists. Then run the following to create the grub.iso file,
cd ; mkdir -p iso/boot/grub ; cp /usr/lib/grub/*-pc/stage2_eltorito /boot/grub/menu.lst iso/boot/grub
Step 2: Create a virtual disk (.vmdk)
cd ; mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o grub.iso iso
When creating such a disk, it's preferable to only specify your Windows partition. This is a safety precaution that will prevent a data corruption problem that results from booting into the currently running OS. As a preliminary step, you must add yourself to the disk and vboxusers groups,
Log out and log back in here... and edit the following command to point to your WinXP partition: (I specified my WinXP partition - /dev/sda2 - with "-partitions 2")
sudo usermod -G disk,vboxusers -a `whoami`
Step 3: Create a new hardware profile in WinXP
VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/WinHD.vmdk -rawdisk /dev/sda -partitions 2 -relative -register
- Click Start > Control Panel > System
- On the Hardware tab, select Hardware Profiles
- Click Copy, name the new hardware profile Physical
- Rename the current profile to Virtual
Step 4: Change Windows XP's IDE controller
- On the Hardware tab, select Device Manager
- Right-click the IDE Controller and click Update Driver
- Click No,.. and Next
- Click [Advanced] and Next
- Click Don't search... and Next
- Select Standard Dual channel PCI IDE controller
- Click Next, Finish, then Close and Reboot into Linux
Step 5: Run VirtualBox
- Realize that you may have to reactivate your copy of XP
- Create a machine that uses the created .vmdk (in the drop-down menu of the HD selection section)
- Have this machine boot the CD-ROM first and mount the grub.iso file
- You may have to try between the two IDE controllers types (Settings/Advanced) to see which works for you
- Enable the IO-ACPI option and run your VM!
Step 6: Bypass Windows Activation [Experimental]
- Follow the directions in this post
- Give your feedback here
- I will remove or improve this section as a result
*** Warning! ***Note: This problem may not exist for later versions of VBox (post-1.6).
About Guest Additions!
Installing Guest Additions may cause the Windows installation in an existing partition to be unbootable (natively) - you might only be able to boot it from VirtualBox from there on out. This is a result of VirtualBox changing a significant amount of hardware in your configuration in order to have a user friendly virtual machine. If you already have installed Guest additions, you can try to remove it from within VirtualBox, and rebooting natively to XP.
- Find fix for native booting problem DONE*
- Easy .vmdk creation that doesn't require installation of another large or closed source program. DONE*
- Creation of boot.iso for direct booting w/o system's grub DONE
- Port tutorial to Ubuntu community documentation and official VirtualBox page
- Find constant-activation fix NOPE (see update)
Sources & Helpful Links:
VBox-migr, squidoo-virt, mazimi-virt, mazimi-bypass, mesbalivernes-virt, Dutch Translation
Comments and suggestions welcome!