Triple-Boot a Mac

This guide documents a process for setting up a Intel-based Mac to be able to boot into three operating systems: Mac OS X Leopard, Windows XP, and Ubuntu Linux (version 8.04).

It utilizes the rEFItboot menu, and takes advantage of the method first presented by Steven Noonan in October 2008 for allowing all three operating systems to boot directly from a rEFIt menu, without an intervening GRUB menu choice required, and for allowing as many Linux partitions as desired.  (EDITED JANUARY 7, 2012: Steven Noonan has an updated (2010) guide to quad-booting a Mac which is worth reading.)

Requirements

  • An Intel-based Macintosh computer
  • Mac OS X Leopard install disk (Note: If your computer is newer than Leopard (that is, your computer came with Leopard installed), you must use the system software disk which came with your computer – you cannot use a retail Leopard disk. The retail Leopard disk does not contain the drivers needed to boot your computer.)
  • Windows XP install disk (Must include Service Pack 2. If yours does not, you can create a slipstreamed installation disk which does.)
  • Ubuntu 8.04 LiveCD (You can download a disk image, or request a physical disk, from the Ubuntu website. This guide uses version 8.04 because of the long-term support offered, but the process should be similar if you choose to use a more current version (8.10 as of this writing).
  • An internet connection

The computer you are setting up to triple-boot should be able to connect to the internet to download software updates, drivers, etc. Because the drivers for the wireless network card are only available online for Ubuntu, a wired (ethernet) connection is a good idea.

Back Up Data

This process can, in theory, be completed without wiping your hard drive – but the chances of a mistake or problem causing you to need to format the drive and start over are non-trivial. Back up all your data first. If you don’t already use Time Machine, you should – it makes backup easy, and makes restoring from a backup seamless.

Remove Additional Hard Drives

Windows will install only on the last partition of the last hard drive. Therefore, you must have only one hard drive – the boot drive – installed. You can attach/install others after the installations are complete.

Install OS X

If you have an existing installation of OS X which you want to keep, that’s fine – as long as it is only one partition, occupying the whole hard drive (i.e., no Boot Camp setup). Otherwise, follow the steps below to install OS X:

  • Start from the Leopard disk (hold down C when starting up).
  • Select your language (this guide assumes English) and press Enter.
  • “Welcome” screen: click “Continue”.
  • EULA screen: read, and if you agree, click “Agree”.
  • “Select a Destination” screen: select the main hard drive (which should be your only choice). Click “Options”, and choose “Erase and Install”. Leave disk format as “Mac OS Extended (Journaled)”. Click “OK”, and then click “Continue”.
  • “Install Summary” screen: click “Customize”, and uncheck any printer drivers you don’t need. Uncheck any language translations you don’t speak. Uncheck any trial software you don’t know that you want. Make sure you leave additional fonts and X11 checked. Click “Done”, and then click “Install.”

The Leopard installer will run; then the computer will restart itself and play a welcome video.

  • “Welcome” screen: select your country, then click “Continue”.
  • “Do You Already Own A Mac?” screen: at this point, you can transfer information from an old Mac, or from a previous Time Machine backup of this Mac. If you don’t want to do this right now, you can do it later using Migration Assistant. Click “Continue”.
  • “Select A Wireless Service” screen: log in to a wireless connection, or connect to a wired connection, here. Then click “Continue”.
  • “Enter Your Apple ID” screen: log in if you have one; otherwise, leave it blank. Click “Continue”.
  • “Registration Information” screen: fill this out, then click “Continue”.
  • “A Few More Questions” screen: fill this out, uncheck the spam request box, then click “Continue”.
  • “Create Your Account” screen: fill this out as you like, then click “Continue”.
  • “Try MobileMe Free” screen: decline this unless you want it; then click “Continue”. Click “Go” at the next screen, and you’re done installing.

Now run Software Update (under the Apple menu) and restart, as many times as needed, until there are no more updates available. At this point you can eject the Leopard CD.

Partition With Boot Camp Assistant

Use Boot Camp Assistant to create a “Windows” partition whose size equals the total size of all the Windows and Linux partitions you want to create:

  • Open Boot Camp Assistant (Cmd-Space to launch spotlight and search for it)
  • “Introduction” screen: click “Continue”.
  • “Create a Partition for Windows” screen: drag the slider so that the “Windows” partition is as big as all the Windows and Linux partitions you want to create, put together. (In my example, I will use 60GB.) Then click “Partition”.
  • “Start Windows Installation” screen: click “Quit & Install Later”.

Partition With GParted

Launch the GParted utilty on the Ubuntu LiveCD:

  • Insert the Ubuntu CD.
  • Restart, and hold down C to start from the CD (or Option, to see a boot menu – in which case the Mac may identify the Ubuntu CD as “Windows”).
  • Ubuntu boots into a language menu; this guide assumes you pick “English”.
  • At the Ubuntu welcome screen, choose “Try Ubuntu without any change to your computer”.
  • When Ubuntu has started, go to the System menu and choose “Administration” and then “Partition Editor”, which is, in fact, GParted.

Now, delete the existing “Windows” partition and create several in its place:

  • Select the last partition – the FAT32-formatted one, probably named /dev/sda3 – and click “Delete”.
  • Create a 100MB boot partition:
    • Select the “unallocated” space, and click “New”.
    • Set “New Size (Mib)” to 100.
    • Make sure Filesystem is ext2.
    • Set “Create as” to “Primary Partition”.
    • Click “Add”.
  • Create a Windows partition:
    • Select the “unallocated” space, and click “New”.
    • Set “New Size (Mib)” to 30720. (This gives a 30GB partition, for this example.)
    • Make sure Filesystem is ntfs.
    • Set “Create as” to “Primary Partition”.
    • Click “Add”.
  • Create Linux partition(s). You can have as many partitions here as you want, and there are extensive debates about how many you need. Contrary to common wisdom, in current versions of Ubuntu, a swap file is just as fast as a swap partition, and so there is no need to give up future flexibility by creating a swap partition. There are plenty of other good reasons to have more than one partition for your Ubuntu install, but for this example, I just create one more partition, for the entire Ubuntu install:
    • Select the “unallocated” space, and click “New”.
    • Set “New Size (Mib)” to the default – everything left.
    • Make sure Filesystem is ext2.
    • Set “Create as” to “Primary Partition”.
    • Click “Add”.
  • Click “Apply”, confirm in the warning dialogue that follows, and click “Close” when it is done.
  • Select the ntfs-formatted partition, and choose “Manage Flags” under the “Partition” menu. Check “boot”, click “Close”, and close GParted.
  • Shut down the computer. (It may hang on shutdown, and have to be forced.)

Install rEFIt and Repair Partition Map

Install rEFIt and use it to reconcile the partition maps:

  • Start up the computer (it should launch into OS X).
  • Download rEFIt (use the Mac disk image) and install it.
  • Restart twice. The second time, you should land in the rEFIt boot menu. Use the arrow keys to select “Start Partitioning Tool”, and press Enter.
  • Let it repair your partition map; restart.

Install Windows XP

Start up from the Windows XP disk, and install Windows:

  • At the rEFIt menu (or in OS X), eject the Ubuntu CD and insert the Windows CD.
  • Restart, and hold down the Option key. Choose the Windows CD and press Enter.
  • Press any key to boot from CD! If you miss your chance, force restart and try again.
  • “Windows XP Professional Setup” screen: choose “set up Windows XP now”.
  • “Windows XP Licensing Agreement” screen: if you agree, press F8.
  • “Windows XP Professional Setup” screen: choose the last option, drive C: , labeled NTFS.
  • “Windows XP Professional Setup” screen: leave the current file system intact (no changes).
  • Windows will install, and reboot. At rEFIt, choose “Boot Windows from Partition 4″.
  • Windows continues to install, with some dialogues. None of these choices are critical, although I decline automatic updates (later, you can set Windows to notify you when they are ready, and let you choose whether to install them).
  • When Windows reboots, at rEFIt, choose “Boot Windows from Partition 4″. When Windows has finished installing, boot into it once to check that it works, and then shut down.

Install Ubuntu

Install Ubuntu 8.04:

  • Start up into OS X; eject the Windows XP disk and insert the Ubuntu disk.
  • Restart, and hold down the Option key for boot menu. Pick the Ubuntu CD, which may be identified as “Windows”.
  • At the language selection screen, make your choice (this guide assumes English).
  • Choose to install Ubuntu at the main menu.
  • “Welcome” screen: select language (again, this guide assumes English). Click “Forward”.
  • “Where are you?” screen: select your location, and click “Forward”.
  • “Keyboard layout” screen: select “USA” and “USA – Macintosh”, and click “Forward”.
  • “Prepare disk space” screen: select “Manual” and click “Forward”.
  • Prepare the various partitions. Depending on what choices you made in your partition setup, your steps here may be slightly different:
    • Select the 100MB partition (/dev/sda3 for me) and click “Edit Partition”; set it to the Ext2 filesystem and “/boot”.
    • Select the 30GB ext2 partition (/dev/sda5 for me) and click “Edit Partition”; set it to Ext2 filesytem and “/”.
    • Check the “Format” boxes for the partitions you will use for Ubuntu.
    • Click “Forward”.
    • Ubuntu will show an error about no swap partition being created. You can accept this error, because you will later create a swap file.
  • “Who are you?” screen: fill this out, and click “Forward”.
  • “Migrate Documents and Settings” screen: leave this as none, and click “Forward”.
  • “Ready to Install” screen: click “Advanced…” and select the small 100MB partition you placed /boot on as the device for boot loader installation.
  • Install!
  • At the end of the install, it will eject the Ubuntu CD, and may hang on a black screen and have to be force-shutdown.

Checks and Repairs

Boot into each OS in succession using the rEFIt menu to make sure everything runs smoothly. At this point, you should be able to boot directly from rEFIt into each OS, and although you may see GRUB go by on the way to Ubuntu, you shouldn’t have to make any choices there, and it shouldn’t hijack your attempt to boot one OS into another (as older triple-boot methods would unless you intervened).

If Windows or Linux give the error “No bootable device — insert boot disk and press any key.”, force-shutdown, and use the rEFIt partition tool to repair the partition map; then try again.

Set Up Windows to Run On a Mac

Boot into Windows from rEFIt and use the Leopard disk to install Mac drivers for Windows:

  • Boot into Windows from rEFIt.
  • Insert the Leopard install disk. It should autorun; if not, manually launch it from My Computer.
  • “Welcome to the Boot Camp installer” screen: click “Next”.
  • “License Agreement” screen: read it, and proceed if you accept.
  • “Choose Additional Features and Settings” screen: leave Apple Software Update for Windows checked; click “Install”.
  • “Boot Camp Installer” screen: the installation is completed; click “Finish”.
  • The installer will request that you restart. Boot back into Windows at rEFIt. (There may be a long black screen here.) Boot camp Help opens; you can close it.
  • Connect to the internet. In the Start menu, choose “All Programs” and then “Apple Software Update”.
  • Download and install all software updates; restart; repeat until there are none available.

Set Up Ubuntu to Run On a Mac

Boot into Ubuntu from rEFIt and create a swap file:

  • Boot into Ubuntu from rEFIt, and log in.
  • Open Terminal by choosing the “Applications” menu, then “Accessories”, then “Terminal”.
  • Enter a command of this form to create a swap file:
    sudo dd if=/dev/zero of=/mnt/2048Mb.swap bs=1M count=2048

    The important part of this command is the number which indicates the size of the swap file in megabytes. In this example, I’ve used 2048, or two gigabytes. You should use a number equal to or twice the size of your physical memory (RAM). (Depending on the size you choose here, the command may take several minutes to execute.)

  • Enter a command of this form to make the file a swap file:
    sudo mkswap /mnt/2048Mb.swap

    Make sure you use the number you used before.

  • Make the swap file available to the system:
    sudo swapon /mnt/2048Mb.swap

    You can check that this is working by running the command:

    cat /proc/meminfo

    Look for a line which reads “SwapTotal”, the value for which should be similar to the size of the file you have just created and activated.

  • Edit the fstab file to make this permanent. First, use this command to open that file:
    gksudo gedit /etc/fstab

    Then, add this line at the end:

    /mnt/2048Mb.swap none swap sw 0 0

    Again, make sure that the filename number you use matches what you used above. When you are finished, save and close the file.

At this point, all that is left to make Ubuntu run happily on your Mac are hardware-specific drivers. A good first step at this point is to connect a physical network cable (as Ubuntu probably does not include drivers for your wireless card) and run Ubuntu’s software update (the red arrow in the menu bar, just to the right of your name and to the left of the date). You may need to restart and run it more than once, until there are no more updates available.

You can also consider enabling restricted drivers by clicking on the small circuit-board icon next to the software update icon. Ubuntu will explain the ramifications of this choice to you, then offer you the chance to enable and install the drivers in question. (On my late-2008 aluminum MacBook, restricted drivers were available for my wireless card and video card, but the video card driver renders my installation unbootable.) If you get into trouble here, and have difficulty booting your Ubuntu install, make use of the recovery mode options available as GRUB goes by during boot-up. I managed to recover my broken installation this way. If all else fails, there should be no problems reinstalling Ubuntu.

You can also examine the wiki and forums in the Mactel Ubuntu community. (They can also confirm that the bugs you experience are known and being worked on, which is a great stress relief. For example, they confirmed my discovery that ‘shut down’ is safe – but ‘restart’ can lead to an irrecoverable hang, on my particular hardware, and no one is yet sure why.)

Next Steps

At this point, you should have a fully functional triple-booting computer! You can reattach any hard drives you removed for this process, and all that remains is to set up each operating system for your daily use.

Previous: Those Whiskers!
Next: Highways