Since I got a Macbook around six months ago I planned a triple-boot setup but didn’t really do it until recently. One of the first things I did when I got the laptop was using Bootcamp to repartition the hard-drive and install Ubuntu. When I then wanted to add Windows to the mix I found out it wasn’t that easy after struggling a bit with partition schemes and installers that don’t mix so well. The result was I just gave up for some time resorting to run Windows from VMware Fusion.
A few friends that own Macs and do Windows and Linux are happy running the OSes inside virtual machines. I was not. Windows under VMware runs nicely and the Unity integration features are quite cool but since I got the laptop with 1 GB or RAM running heavy enterprisey development tools for Windows among other stuff wasn’t working that well. Besides, OS X is fine and before the triple boot setup I got mostly used to run it all of the time but from time to time I run benchmarks, show demos or give talks and I needed the real Linux running on top of the bare metal. So I went for the real thing
Since I’ve switched to this machine as my primary computer I needed more RAM and disk space so I upgraded it from 120 GB to 250 GB and from 1 gigs of RAM to 2 gigs. Since I was going to have Leopard installed in a brand new disk this was the chance to finally go for the triple boot setup.
So the story starts with Boot Camp, Apple’s utility tool for resizing the Leopard’s HFS+ partion and have Windows Vista or XP installed aside of Mac OS using the drivers included in the Leopard installation media. As you might guess, given the propietary nature of Apple, Boot Camp is not the most flexible tool around and demands the hard drive to be formatted as a unique HFS+ partition using the whole disk. The good news is the process of installing Windows with Boot Camp is pretty smooth and works correctly almost every time. My experience was not the exception.
There are quite a few guides all over the Internet proposing different strategies for having OSX coexists with Windows and Linux on the same hard-drive and almost all of them are very emphatic on following the instructions to the letter. I read most of them but given my previous experiences and the information I had gathered I went for my own approach with I’ll briefly describe in this post.
GUID Partition Table (GPT)
GPT is a modern partition scheme that is part of the Extentensive Firmware Interface standard proposed by Intel. This is the scheme Apple uses for all Intel-based Macintoshes and Leopard’s installer only agrees to install the OSX on a GPT-partitioned hard drive so that’s one of the first things you must be aware of. GPT is an alternative to the old and well-know MBR partition scheme most of us are used coming from a PC world. EFI is a replacement of the old PC BIOS. EFI uses GPT where BIOS uses MBR. Nonetheless, Boot Camp uses a mixed GPT-MBR partition scheme under EFI in order to simulate the PC BIOS and have BIOS/MBR-only OSes like Windows XP installed in the new Macs. That’s why you CAN’T use Windows partitioning tools you might be used to like fdisk. They’ll simply ruin the setup and you’ll have to start all over again by partitioning the hard drive under GPT.
The current versions of Ubuntu Linux, like Feisty or Hardy, support GPT-partitioned hard drives in the installer, so they are not a problem. Windows Vista being a new OS only seems to support this in some 64-bits versions. That’s why you’ll want to rely on Boot Camp for the Windows installation and then try to mess the less you can with the arrangements the software has made
Installing Windows
There are many guides around for this part. I’ll link here to Apple’s official instructions in the 101: Using Windows via Boot Camp with Mac OS X 10.5 Leopard article of their support site. When installing XP don’t even think of creating or deleting the partitions. At most you can switch from NTFS to FAT but I went for NTFS since Linux is already supporting it well and my partition was 60 GBs big. You can opt for the quick formatting option for reformatting the drive C: but don’t try reformating, I repeat, since you’re not installing over an MBR-partitioned standard PC hard drive.
After booting XP you’ll find the look is so lame compared to OSX or Linux with Compiz that you’ll want to make the appearance a little bit more decent so I turned on the ClearType option, the Royale theme, XPize and finally Y’z Shadow for adding extra transparency and drop shadows to the windows.
Since Macs only have one click you’ll find useful the tiny Apple Mouse utility for XP which switches the left and right click options while you’re holding the Ctrl key. Just run it from XP’s start folder adding the /s parameter to the executable path for avoiding the start dialog and you’ll have right-click working the same way as under OSX.
rEFIt
So after Windows install my MacBook was booting straight into Windows. Horrible!
Yes, I could still choose from which partition to boot by pressing the right Option (Alt) key or setting my choice using the Startup disk dialog under OSX’s System Preferences but I wanted a cool graphical bootleader that soon would be spotting a cute Linux penguin so I went with rEFIT, a superb opensource bootloader for EFI-based hardware that dynamically detects your partitions and even bootable media.
I grabbed rEFIt as a DMG file and run the graphical installer under OSX. When I booted again it wasn’t working so I had to resort to running the manual installation instructions which are a breeze to follow using the OSX terminal app. Rebooted and the nice rEFIT screen was welcoming me featuring both OSX and Windows icons.
Installing Ubuntu
So at this point my Mac was dual-booting Leopard and XP but I need to add Hardy to the mix. Since the biggest partition was Leopard’s I had to shrink it in order to make space for Linux. There are a few options for doing this: I could have used the opensource gParted tool included in the Ubuntu Live CD or OSX’s own diskutil command under the terminal, or even the Disk Utility GUI under Applications/Utilities but I went with iPartition, a commercial product included in a Coriolis Recovery CD a friend had lend me. The partitioning worked nicely and I had 60 gigs for getting Ubuntu installed to the hard drive.
The problem here was the brand new partition for Ubuntu is physically the third one but Boot Camp will only want to boot Windows from the last partition, in this case the third. So the trick comes here: I booted the laptop with Ubuntu’s LiveCD which at disk point is offered as a boot option represented by rEFIT as a Linux penguin with a tiny CD icon and had the new partition formated as NTFS and Boot Camp’s windows installation copied to the third partition. Of course I had to do all of disk manually so I used mkfs.ntfs over /dev/sda4 to create the new partition, then mouted both /dev/sda4 (Boot Camp’s Windows installation) on /bootcamp and /dev/sda4 (new Windows location) on /windows and had all the files copied by simply issuing a “cp -r /bootcamp/* /windows” command and waiting for it to complete before starting the Ubuntu installer.
Then, when perform the actual Ubuntu installation I switched to manually setting the partition in which Ubuntu was to be installed, /dev/sda3 in this case, created no SWAP partition since many guides replaced it by a swapfile inside the main Linux ext3 partition and had GRUB installed not in the MBR but in /dev/sda3 and everything worked nicely.
Due to Ubuntu’s bug #222126 the Ubuntu’s installer clears the MBR and after rebooting you’ll get a “no bootable device” error when selecting the Linux or the Windows icon from rEFIT. I knew about this problem and the fix from my previous attempts so I didn’t panicked
It only takes to run the eEFIT’s built-in partition tool to resync the GPT and MBR partitions and you’re done. At this point my system had a fully operational triple-boot setup.
Configuring Hardy to use the MacBook’s hardware
For this part I mostly followed the instructions at the MacBook Santa Rosa and MacBook Santa Rosa on Hardy pages from the Ubuntu wiki. Sound is working. Wireless is working too. The only thing I’m missing is having the laptop suspend correctly which is currently preventing me from using Ubuntu extensively when relying on the laptop’s battery. I’ll be looking into this issue soon and will be updating the article properly.
Conclusions
Triple-booting Leopard, Hardy and XP wasn’t an easy but a fun journy. Yes, it can take quite a bit of time waiting for the installations to complete and even much more configuring the system so I really helps to know what your’re doing since you risk loosing data or at least a good piece of your precious time. Was the price well worth for my? Definitely, yes. It’s not just all the cool kids who happen to be Linux geeks and own a Mac are doing this but the chance to use all of the system resources running under the proper drivers and being able to forget for the most part what is the hardware platform you’re using what has value to me. Of course, it all depends on your very specific needs. Due to academic reasons I do a lot of team work with other people and at some points we switch laptops or I have mine used by someone else to complete a task. In this situations I’m now booting into Windows and forgetting about any ocassional OSX interferences like switching to a different desktop using OSX’s Expose. It’s also way easier to have Windows run from it’s own partition and not a VM’s disk if you plan to install a ton of software as I’m having to do this days. So for me, it’s working nicely and I can still use Virtual Machines under any of the three OSes to virtualize any of the two others or a different one if that’s what I need. So i’m happy with the end result.
I really hope this post is interesting and useful to some of you out there on the internets
For further reference most links are available from my Delicious account under the tripleboot tag.




















Zomg! That’s me in the Ubuntu screenshot! I’m fucking famous, just like mom promised!