If you have a Mac and if you want, please download my new Dashboard App 2.0 HERE! This widget it works with OSX: 10.4 Tiger 10.5 Leopard 10.6 Snow Leopard 10.7 Lion 10.8 Mountain Lion Enjoy, loren.
Last year I managed to get Ubuntu 10.10 running on my 13" Macbook Pro so that I could boot into it natively, AND have it accessible as a virtual machine via Virtualbox. When I did that, I wrote a guide. It has been hanging around on my desktop for too long, so I am just going to paste it here, and be done with it.
These instructions are slightly out of date, but they should work, more or less.
What you want is a Macbook Pro that can dualboot OSX and Ubuntu 10.10, AND run the on-disk Ubuntu instance as a guest inside a virtualbox on the MaxOSX host? Well look no further.
So here is what you do.
1. Install Ubuntu
You already have a Macbook with OSX on it, likely Snow Leopard.
You have made space (30Gb or more probably) for Ubuntu by creating a new unformatted partition with Disk Utility, and resizing your macosx partition.
You install rEFIt and then Ubuntu, just like they tell you to. Separate /boot partition, maybe a little swap partition. Leave a little unallocated space somewhere - it can be as little as a meg - I will tell you why later. Install the bootloader to the root primary disk device - don't worry, it won't hose your macosx.
I have done this successfully with a boot and a swap and a 2meg empty partition and the rest as the root mountpoint, and a similar configuration but with no swap space. I was scared that formatting them ext4 would mean I couldn't access them from macosx, but then I realised it would be VirtualBox doing the accessing, not macosx per se, so obviously ext4 is going to work - VB will load the linux ext4 drivers and you will be fine. However, I still prefer to use ext2, in case something goes wrong with VB and my linux install - would be good to be able to retrieve data with macosx
2. Get rid of UUID
Then you are going to want to get rid of all the UUID stuff - virtualbox seems like it doesn't like this. So you boot up your ubuntu, and edit /etc/fstab.
Take out UUID's in /etc/fstab, replace them with proper device nodes (/dev/sda3, /dev/sda4 etc)
sudo update-grub. This builds your new grub config.
3. Create the bootloader image
Now the kicker - we need to build the correct image to be loaded by the bootloader, which is generated by the config file. It needs to end up in a place that the MBR/EFI can access. Normally you would just go sudo grub-install /dev/sda
This breaks on a macbook, because of its EFI and non BIOS ways.
You get the dreaded "warn: This GPT partition label has no BIOS Boot Partition; embedding won't be possible!."
SO this is where that 1mb of space comes in handy.
Fire up gparted (on a fresh ubuntu install you will probably need to do sudo apt-get install gparted, run it as sudo with sudo gparted) and format it (I used ext2) and mark it as a grub-bios partition (you may need to do these as two separate steps.).
Then run sudo grub-install /dev/sda. Should work just fine - the best message to see is: Installation finished. No error reported.
Reboot and boot into your Ubuntu install just to be sure. While you are there, take note of what is mounted - where is root (/dev/sda4?) /boot? (/dev/sda3?) swap? etc. How about that little grub-bios partition? Write those down or commit them to your infallible memory.
4. Configure VirtualBox
Boot into macosx, and install Virtualbox if you haven't already.
Now, we want to set up a vmdk file which can access the partitions we need for Ubuntu. Those would be: The ubuntu root partition (/), /boot, the swap, and that little grub-bios area.
So you will want to chmod /dev/disk0sx to be readwrite by you, so that you can set this up.
Then you follow the instructions here: http://blog.jardinmagique.info/2009/08/setup-virtualbox-on-macosx-to-boot.html
Namely, you run
sudo dd if=/dev/disk0 of=gpt.vmdk bs=512 count=40
This creates an image of our GPT. We will need it in a minute.
sudo gpt -r show /dev/disk0
This will print out a table, like so:
pt show: /dev/disk0: Suspicious MBR at sector 0
start size index contents
0 1 MBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 427398472 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
427808112 656
427808768 194560 3 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
428003328 446464 5 GPT part - 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
428449792 2048 6 GPT part - 21686148-6449-6E6F-744E-656564454649
428451840 59942912 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
488394752 2383
488397135 32 Sec GPT table
488397167 1 Sec GPT header
Then, we are going to edit the extent descriptions in <somewhere.vmdk> file to be in line with this. The main thing is to include the gpt.vmdk at the start, and make sure you get all the partitions in between, annotating the ones that Ubuntu needs access to.
Mine ended up looking like this:
# Extent description
RW 40 FLAT "gpt.vmdk" 0
RW 409600 ZERO
RW 427398472 ZERO
RW 656 ZERO
RW 194560 FLAT "/dev/disk0s3" 0
RW 446464 FLAT "/dev/disk0s5" 0
RW 2048 FLAT "/dev/disk0s6" 0
RW 59942912 FLAT "/dev/disk0s4" 0
RW 2383 ZERO
RW 33 ZERO
You save that, and you boot it. It should totally work! Except, GDM will probably fail, and you end up in text mode instead of in X.
This is where you need Virtualbox Guest tools. http://www.virtualbox.org/wiki/Downloads
You boot up your guest (ubuntu) and then attach the guest tools iso (click on the little virtualbox cd down the bottom.) Then you mount it in ubuntu, and run the VBoxLinuxAditions.run
That installs your guest tools. You get features like better hardware support, particularly video.
So now, you reboot ubuntu, and you should have a fully working system.
You may need to chmod /dev/disk0s3 etc each time you want to run this though…