Create "The Ultimate" Triple-Boot Mac

04/12/2009 14:42:22

Introduction

Most of these instructions were available elsewhere, and just had to be cobbled together. The process took several hours days to complete, including lots of trial and error. I’ll try and highlight some of the “gotchas” that I discovered.

WARNING: You can really screw up your computer if you do this wrong. This is the approach I used, but I can’t guarantee I documented every little step. Read the pages I link to. Several times. Make sure you understand the approach, and follow along on these pages during the actual process so you don’t forget anything. I don’t guarantee that any of this will work for you, or that you won’t frag your drive.

WARNING: As with all activities like this, be sure you have a working backup before you start doing this. On more than one occasion, I had moments of panic when I worried that I may have wiped my OS X partition. In fact, I never lost any data (that I’m aware of yet, anyway). But you want to be darn sure you’re covered.

Why Should One Do This?

I recently bought an Eee PC and converted it to dual-boot Windows XP and Ubuntu. I enjoyed trying out Ubuntu again (it had been a while), but it was sort of cramped on the small screen. I decided I should try out booting a “real” installation of Ubuntu on a “real” laptop using Boot Camp and see what it was like.

I had never tried Boot Camp before, as I anticipated wanting to be able to launch Windows/Linux briefly, do a task, and then resume using Mac OS X, rather having to reboot every time I wanted to switch the OS.

But if I could run the same installation within Parallels and Boot Camp, that would be incredible!

After digging around on the internet, it appeared that what I wanted to do should be possible. And it is.

Limitations

Linux, being an open-source project, is well suited to this. I am not an expert on Windows, but one potential gotcha is that your Windows installation may think it is running on two separate computers if you run it from Boot Camp and from Parallels. From what I read, Windows Genuine Advantage may cause problems with this - you can try Google to see if there will be a workaround for you.

Overview

Basically, I needed to:

  • free up empty space at the end of my OS X partition
  • Repartition the drive into 3 partitions - Mac, Linux, Windows
  • Install Windows using the Boot Camp setup
  • Get Parallels to work using that Windows installation
  • Repeat the process with Linux

It turned out to be somewhat complicated, but very possible.

Preparing the disk drive

The goal is to:

  1. Delete files as necessary to create enough free space for your Linux and Windows partitions (I created approximately 45 Gb of free space to dedicate).

  2. Use either Disk Utility or Boot Camp to create a partition for Windows at the end of your disk.

If you encounter errors in the resizing process, it may be caused by large files that cannot be moved off of the area of the disk being affected. In my case, when I removed some larger disk images (prior Parallels installations and large video files, for example) everything worked fine.

I had errors when using Boot Camp to create the partition, so after deleting possible culprit files, I ran the 10.5 install disk and used Disk Utility to shrink my hard disk by 45 GB. Then, I grew the partition by 45 GB in order to return to the full size. This effectively moved all files out of the last 45 GB of disk space, “defragmenting” the empty space. Boot Camp ran fine after this.

Run Boot Camp Assistant

Now, run the Boot Camp Assistant application. Create a partition big enough for your Windows Installation (we’ll do Linux later). Then, basically follow the instructions to install Windows. Reboot into Windows, make sure it’s all working, and that you’re happy with the setup.

NOTE: My Windows installation came from a DVD that was scripted to automatically install Windows and several other updates. It’s critical to follow the directions appropriately, and one of the steps is to reformat the Windows partition from within the Windows Installer. If you are not presented with this option, you can intentionally corrupt the Windows partition to force a reformat. I had to do this, using the command (be sure to read about this before using):

dd if=/dev/zero of=/dev/rdisk0s3 bs=1m count=100

Be absolutely sure you chose the proper partition (e.g. rdisk0s3 in the example), or you could kill your Mac partition and wipe all data!! I then used NTFS as the format.

I wouldn’t spend too much time installing software or configuring things at this point. Just in case you have to try it over…

Set up Parallels

At this point, you can try running Parallels to configure it to work with your Boot Camp Windows installation. If you have Parallels 3, you can probably get it to work with a dual boot system, but I could not get it to work with a triple boot system (i.e. 2 non-Mac partitions). From the internet, it appeared that it should work, but I was unsuccessful.

Parallels 4.0, however, made this set up a snap.

When you run Parallels, it should have a setting for the Hard Disk that allows you to use your Boot Camp partition. Set it up for Windows, and run it to make sure everything seems to work properly. Again, don’t get too attached — if you’re adding Linux, you’re going to have to change the configuration later on.

Status Check

At this point, you should have:

  • A working Mac OS X install on the first “real” partition of the boot drive

  • A working Windows Boot Camp installation on the last partition of the drive

  • A Parallels Virtual Machine that allows you to run your Boot Camp installation within the Mac OS.

Installing Linux

This is a little bit trickier — but again, most of the effort was in figuring out what works…. I got most of this from http://fosswire.com/post/2009/3/how-to-ubuntu-810-on-white-macbook/. I recommend reading it thoroughly before beginning. Keep in mind that they overwrote the Windows Boot Camp partition to create a dual boot setup, whereas we are creating a new partition to build a triple boot machine. The overall process is the same.

  1. Install rEFIt. This utility will help keep EFI and MBR in sync, allowing all this to work. It will save your life a couple of times during this process. Google to learn more about how it works - I can’t explain it well….

  2. Use Apple Disk Utility to shrink your Mac Partition, freeing up enough space for Linux. You can create a new partition if you like, or you can leave the space empty. The empty space should be between the Mac disk (first visible partition) and the Windows (last visible partition).

  3. Reboot from your Ubuntu Installation CD. I used Ubuntu 8.10. I had some trouble with Kubuntu 8.10 for some reason. I also had lots of trouble trying to build a custom install using Minimal Ubuntu. Ubuntu 9.04 should work, but Parallels Tools won’t build for it yet, so you might be better of waiting to upgrade for a bit.

  4. Install Linux — you want to use the Manual option for the hard disk. You will want to reformat the Linux partition (should be called /dev/sda3) as ext3, and designate it as mount point /. If you already had a linux installation here, I do recommend reformatting the partition. I had strange errors when I didn’t…. NOTE: It is important that the GRUB bootloader be installed into the Linux partition (/dev/sda3). The default is into the MBR, which I understand would be really bad….

  5. Once it’s installed, reboot and let the rEFIt menu come up. Go to the Partition Tool icon, and allow it to sync the MBR. Shut down the Mac for a few seconds and turn it back on.

  6. Hold down the option key when you power up to load the Boot Camp selector. You should see two options (Mac/rEFIt and Windows). Choose Windows, and the result should be to come to a GRUB bootloader screen that allows you to select between Ubuntu and Windows. If so, boot into Linux and Windows and ensure that everything seems to be working.

  7. If you don’t get a successful boot via GRUB (I did not), then you need to reboot off of the Ubuntu installation CD, and choose the Ubuntu live option (first choice). Once Ubuntu is loaded, go to the Places->Computer menu, and then select the icons for your three partitions (they may be identified by their sizes, rather than real names) and mount them by right-clicking on one of them. Once all three are mounted, open a Terminal window and run the following (assuming that Linux is installed onto the third partition, counting the “invisible” EFI first partition). Again, read up about grub to feel comfortable that your commands are correct for your setup:

    grub root (hd0,2) setup (hd0,2) quit

At this point, you should be able to reboot, hold down option, select Windows, and be presented with the GRUB menu. Boot into Linux, and ensure everything works.

  1. Boot Windows again, and ensure everything works.

  2. Now, you can boot back into the Mac OS, and create a new Parallels Virtual Machine to run Linux. In my testing, I had to select both Boot Camp partitions to be mounted in order for either Linux or Windows to boot. Attempt to run Linux within Parallels and make sure everything works properly.

  3. Since you added a new partition, and moved the boot loader, your previous Windows Virtual Machine won’t work. You can create a new one, or simply configure the existing one to mount both the Linux and Windows partitions, and try again.

Final Notes

I have left rEFIt installed (in case I do any more tweaking). Any time you repartition your drive, you will need to use it to “resync” the MBR and EFI setups. However, if you’re happy with your partitions, I suppose you could remove it and use the option key whenever you wanted to boot to a non-Mac OS. I haven’t tried this yet.

Again, this was a tedious process (it took me a few days to get everything working properly). I tried to outline the process to save some time — now that I figured things out, I could probably do the whole thing within 4–5 hours, including time to install Windows/Linux and repartition drives. Now, I have a functional Windows installation and a Linux installation on my machine, either of which can run from boot, or within a Parallels Virtual Machine.

I realized that more and more of what I use a computer for can be accomplished in Firefox, Thunderbird, and a good text editor. I have Firefox and Thunderbird installed in every OS I use, and on a portable thumb drive for use at work. Now, I just need to find a text editor as good as TextMate for Linux and Windows….

Similar Pages

Old Comments

(Forwarded on behalf of Troy)

I received an “UNMOUNTABLE_BOOT_PARTITION” blue screen when booting windows after this process. Fixing the boot.ini file to the correct partition did not help (using the fixboot, bootcfg /rebuild, or manually).

I then noticed that the windows partition was being listed as /dev/sda3/ and the linux partition as /dev/sda4/ even though the windows partition was physically after the linux partition. I suspect this was because the linux partition was the last one built.

The fix was to boot into a linux live cd and use the ‘parted’ utility to manually fix the partition table. The procedure was to remove the entries for both windows and linux, and then add them back, linux first. For this to work, you must first write down the starting and ending sectors for both of the partitions (as well as the file system type and label) and use those exact locations when recreating the partition listings (or your partitions will be corrupt). Once this is done, linux shows up as /dev/sda3 and windows as /dev/sda4. I was then able to do the boot.ini fix using ‘bootcfg’ from windows recovery mode and all was well.

I have done some reading that windows expects to be the last partition. This must apply to the logical partition location as well as the physical. Hope this helps someone.