This article is now deprecated as 10.04 has been released. Comments will be disabled. Check back for an updated version.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So Ubuntu 9.10 got released several weeks ago and people have been asking about how to get my old tutorial working for 9.10.

The problem is that Ubuntu 9.10 uses the new grub 2 boot loader which changes LOTS of things. In this tutorial I will be showing you how to get Ubuntu 9.10 (or any other linux OS with grub2) working under your Windows installation.

Before we begin, you should have a dual boot setup. I will NOT be showing you how to setup a dual boot, if you need help plenty of other guides out there.

Step 1: Creating a grub 2 boot iso

The grub iso file will allow you to specify which partition to boot into.

  1. Boot into Ubuntu
  2. (OPTIONAL) Configure your /boot/grub/grub.cfg This is so that you don’t accidentally boot into your Windows partition from inside Windows! Bad things will happen if you do!!!
    $ gksudo gedit /boot/grub/grub.cfg
    Comment out your Windows Menu, should be towards the bottom
  3. Create the bootable iso
    $ grub-mkrescue –overlay=/boot/grub GRUB2CD.iso
  4. (DO THIS STEP ONLY IF YOU PERFORMED STEP 2)
    $ gksudo gedit /boot/grub/grub.cfg
    Uncomment out your Windows Menu, so you still can boot into windows after the reboot!
  5. Move the iso into a location that is accessible by windows

Step 2: Creating the .vmdk file

This creates a file which tells Virtualbox what partition to actually load as the harddrive. Unfortunately, unlike VMWare Workstation, Virtualbox does not support a GUI interface for selecting RAW hard disks as the “virtual hard drive”.

  1. Boot into Windows
  2. cd into the directory you installed virtualbox
  3. Find out which drive contains Ubuntu (if you don’t know already)
    Run the command: VBoxManage.exe internalcommands listpartitions -rawdisk \\.\PhysicalDrive1
    (where 1 is the number of the hard drive ubuntu is installed on. E.g. Master should be 0, you’re second hard-drive should be 1 etc…The output should be something like:Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
    1       0×07  0   /32 /33  1023/254/63        902023         2048
    5       0×83  1023/254/63  1023/254/63         49677   1847346543
    6       0×82  1023/254/63  1023/254/63          2164   1949086188

    In this example, my Ubuntu partition is number 5 and the swap is number 6. So my Ubuntu partition lies in PhysicalDrive1

  4. We now create the VMDK file with the given information
    Run the command: VBoxManage.exe internalcommands createrawvmdk -filename C:\ubuntu.vmdk -rawdisk \\.\PhysicalDrive1 -register

Step 3: Setup Virtualbox

Now everything should be ready to setup Virtualbox. Create a new virtual machine. Select the .vmdk file we just created as the hard drive and mount the grub.iso file we created at Step 1.

Step 4: Running the VM

Due to the way grub 2 works, whenever you put into it you now have to load the appropriate grub config file.

grub2

Just type the above into terminal and grub should load and boot into your Ubuntu 9.10 installation.

If this has helped you in any way, please take the time to drop a comment (or a donation)! If you have any problems, just post a comment or send me an email through the “Contact me” page.

ISSUES:

  1. For some reasons Grub does not recognise the partition if you specify the EXACT partition entry of Ubuntu. You have to specify the entire drive for it to be recognised.
  2. It doesn’t seem to like nvidia drivers in this release so you might have to reset your x.org for it to work inside a VM. Just have to live with the lack of acceleration!

References:

Boot an existing XP (Physical HD) install with VirtualBox

Linux Bash Commands for GRUB2