Apple Mac Triple Boot HowTo

Introduction

In this HowTo I will cover how to configure a triple boot Apple Mac machine to boot openSUSE, Windows Vista and Mac OS X.

The Problems

Apple Macs are EFI systems and as such they do not have BIOS. Even though EFI does support the standard partition scheme (MBR), Apple is using the added support for a GUID partition table (GPT). GPT has a limit of 4 partitions and 1 is already used.

Linux supports the GPT and can boot by using elilo as a bootloader. However the lack of BIOS will not allow the video card drivers to operate properly.

Windows doesn’t support GPT.

The Solutions

Video

Apple has updated the firmware to allow emulation of BIOS for its Boot Camp tool to work. It should be noted that while Boot Camp offers an easy way to set up a dual boot Windows/OS X machine it does not come in handy for the purpose of this HowTo.

Partitioning

While GPT is a new scheme, it doesn’t fully replace the MBR, but rather keeps it in the beginning for compatibility reasons. Fortunately one can abuse that and create a MBR partitioning table to match the GPT one. It is very important that the MBR partioning table is kept in sync with the GPT one, because else it will provide false information for the actual physical layout to the software reading it.

Since there are only 3 free GPT partition table slots one can install the three OSes. Linux works just fine with swap on a file in /.

Booting and MBR/GPT syncing

There is an awesome tool available called rEFIt. It includes is not only a boot loader, but also has a built in MBR/GPT partition synchronization tool. It automatically recognizes bootable OSes by scanning the partitions (also scans external devices).

The HowTo

Partitioning

Boot from your Mac OS X CD 1 and use Disk Utility from the menu on top to create one partition for Mac OS X, one Unix type partition and one FAT32 type partition. It appears that it is crucial to have the Windows partition as the last one, else Vista will complain and won’t even install and Windows XP will install, but will throw missing hal.dll error and won’t boot.

Install Mac OS X

Install Mac OS X and update it to the latest version. Reboot and install rEFIt. Reboot and use the sync tool (called “Partition Tool” in the menu) in the rEFIt menu to sync MBR to GPT.

Install Windows Vista (setup NTFS partition)

In Vista’s setup select the FAT32 partition, format it and install there. After the first reboot during the installation use rEFIt sync tool again. This is just to get the NTFS partition in place. Do not finish off the installation now, but rather procceed to the Linux installation. Windows won’t be able to boot after the sync anyway.

Install Linux (openSUSE)

Crucial elements during the installation of openSUSE before the first reboot:

  • Install Linux (yes, everything) on the single UNIX type partition. Use custom partitioning to format the UNIX type partition to ext3 and set mount point to /. Do not create a swap partition and do not even think about resizing partitions.
  • Set the boot loader to LILO, because GRUB will fail to install.
  • Install the boot loader in the boot record for the partition. REFIt can boot it fine and also the master boot record will be free for Windows later on.
  • Remove the Windows entry from the lilo menu, because it causes LILO’s installation to fail.

Unfortunatly for unknown reasons to me after the first reboot during the installation the MBR partitioning table will be gone, so one has to use rEFIt to resync GPT and MBR. This of course will break lilo’s previous setup, so we have to reinstall it before continuing the installation. This can be done by boot from the openSUSE cd/dvd again and once the setup has loaded Ctrl + Fx to a terminal. From that point on we have to mount the partition where we have Linux installed and rerun lilo:

mkdir /media/suse;
mount /dev/sda3 /media/suse
mount --bind /dev /media/suse/dev
chroot /media/suse
lilo -v

Reboot and resync GPT/MBR once more (so that rEFIT sets proper partition types) and then reboot for the last time. You should see OS X, Windows (won’t boot) and Linux icons in the rEFIt menu now. Select the Linux one and finish your openSUSE installation.

Install Windows Vista

Run the Windows Vista installation from the start (again by formatting the partition) to end now. Do not sync MBR/GPT after!

Additional Notes

parted, fdisk, Boot Camp

Do not use parted nor fdisk once you have a working system. I have had very bad experiences with both of those. As bad as in missing GPT and/or MBR partition table after. Do not use Boot Camp as well.

Linux swap on a file

It works fine and can be done as follows. Example sets 2gb swap.

dd if=/dev/zero of=/swap bs=1024 count=2097152
mkswap /swap
swapon /swap
echo "/swap swap swap pri=1 0 0" >> /etc/fstab

Linux Built-in iSight WebCam Driver

Here or possibly supplied by your distribution of choice as uvcvideo patched with my isight patch.

Apple Mac Windows Driver CD iso

After installing Boot Camp the driver cd image is here: /Applications/Utilities/Boot Camp Assistant.app/Contents/Resources/DiskImage.dmg.

Have fun!

  • Twitter
  • Facebook
  • FriendFeed
  • StumbleUpon
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Reddit
  • Tumblr
  • PDF
  • Print
  • email
Rating: (No Ratings Yet)
Loading ... Loading ...
View Comments
Published: May 14th, 2007 (Views: 3,108)
Categories: Coding
Tags:
  • tad_ghostal
    So it seems that I am having some issues. After installing refit, partitioning using BootCamp, then fixing the NTFS partition with my Ubuntu 9.10 Live CD, installing Ubuntu, etc. I can no longer boot into my Mac.

    When I power on, without holding alt, the refit menu comes up, and gives me the option to boot Mac OS X or legacy. If I try legacy, occasionally it will boot Ubuntu, but sometimes not. If I try Mac, it will pull up the little gray apple logo, and not go anywhere from there. On the rEFIt menu, when I go in to sync, it tells me the tables are already sync'd and press any key to continue...I don't get an option to sync anyway. So how would I go about syncing? Also, when I try the EFI terminal, and try to run gptsync.efi, it gives me the same message.

    Further, when I try to boot from my original Mac OSX cd, it won't boot the CD. I backed up everything with time machine prior to trying this out, so I'm not too worried....but what to try now?

    I appreciate any help.
  • Alex Bowyer
    Hi

    Thanks for the write up it has proved very useful.

    I have just spent the last few hours getting my Mac Mini up and running with a rEFIt-based triple boot of Leopard, Ubuntu 7.10 and Windows XP Pro SP2

    During this I was able to use the above instructions as a guide, but I thought I'd add some extra details based on my experiences (for anyone else who comes here via google as I did)

    Gotchas with the instructions above (and other general tips)

    1. I couldn't find any way in Disk Utility to format the second (i.e. Linux) partition as UNIX (I didn't see that as an option). I just formatted as Mac OS X Journaled, then when it came to the step about installing Linux, I reformatted the partition as Linux ext3 as part of the Ubuntu install process.

    2. Also, don't worry if you want to use NTFS - it's fine to define the 3rd (Windows) partition as FAT (enough that the Windows installer can see it) then reformat it as NTFS as part of the Windows install process later.

    3. Don't worry if you don't have to sync the MBR & GPT as often as these instructions say - I only had to do it once, after installing rEFIt - I didn't have to do it after windows install or elsewhere - I just went in to the partition tool and checked the partitions were the same at the stages mentioned and all seemed to go fine without needing to sync again.

    3. I found that the best point to leave windows install is after the "blue screen based parts" finish - when its about to reboot into a Windows like environment to set up keyboard layout etc. and do the actual install. I found once it reboots its fine to jump into the linux stuff and next time you boot from the windows partition it will pick up the windows install process where you left off.

    4. When installing Ubuntu you are better off using Grub. I found that stopping and trying to use lilo screwed up my linux install and I had to start again. Its not a problem anyway because you only install that loader to linux partition not MBR so you'll never use it anyway (u will use rEFIt)

    5. I didn't see the problem about "MBR partition table will be gone" after linux install, I think that may be OpenSUSE specific

    6. On first boot into Windows you will need to tell Windows where to find the drivers for your Mac hardware. Some hits on Google and the notes on this page suggest looking inside the package of Boot Camp Assistant for a CD image - this probably applies to pre-Leopard versions of Boot Camp only. If you have Leopard just insert the Leopard Mac OS X Install Disc into windows - it will autorun and install a shedload of drivers. You should find sound, network etc are now recognised. You may find Bluetooth keyboard and mouse need to be added manually under Control Panel > Bluetooth Devices. Useful to have a standard wired USB mouse on standby if you find yourself unable to control anything as it's not recognised your mouse.

    7. Make sure after installing the Mac hardware drivers that you connect to Windows Update and download ALL recommended updates - for me, there were 97! :-( . If you do not do this, you will hit problems later if you plan to use VMWare Fusion, Parallels etc - this happened to me and my Windows partition got trashed by the VMWare virtual disk manager's setup process and was Blue-Screen-Of-Death-ing both in and outside of VMWare with a STOP error 0x7B - I had to reinstall Windows all over again. Once the security updates are installed that problem seems to go away.

    8. To use VMWare Fusion with the partition for Windows you've installed, ignore the usual setup wizards to create a New VM and go straight to the Virtual Machine Library. You'll see an entry called "Boot Camp partition" - Run that, that's your windows partition.

    9. If you are using VMWare Fusion, you'll need to install VMWare Tools within Windows (go to Virtual Machine > Install VMWare Tools from the VMWare Fusion menus while Windows is loaded). This allows drag and drop of files, copy and paste etc, and most importantly lets you use the Unity feature to load Windows apps as Mac appication windows.

    Problems not yet solved:

    Something is not right with my Linux install under rEFIt. It boots ok but is dumping to a text login and I can't start gnome - Guess I could install that stuff with apt-get etc but am tempted to reinstall linux completely. Seems it will be safe to do that any time, since Windows didn't need to do an MBR update after Windows install (as I was expecting it to). For now, I just created a Virtual Disk install of Ubuntu as a file on OS X. Not ideal but good enough for now. I am still having issues getting VMWare tools to install within Ubuntu (it says its installs, and the toolbox loads, but it doesn't seem to be recognised on the OS X side).

    Also, I have been playing with getting Portal working under Windows on the Mac. I can load it when booting direct from rEFIt (provided I use -dx 90 option to specify direct x 9) - however something is not right with the lighting, its very white. Also I can't seem to load it at all within VMWare Fusion running Windows off the same partition

    Well, have fun all. Hope this info is useful.

    Any questions drop me a line - firstnamelastname at gmail dot com

    Thanks
    Alex Bowyer
  • Pavan
    Is it possible to have four partitions on the disk? Three for each of the
    operating systems and one as a common partition? I have a 500g disk
    that I whish to use on my macbook.
    Thanks
  • No, because 1 special partition is always reserved for the EFI boot stuff so that leaves you with only 3 that you can use. - one for each OS.
  • tazmusica
    I was actually able to get a triple boot system with a separate swap partition for linux, as well as a common partition (so a total of 5 partitions). I did this on my Macbook Pro unibody 17". If anyone is interested, I can try posting some instructions.
  • menks
    I'm just looking for that. Triple boot withou a commom partition has no mening for me.
  • tazmusica
    Here is how I did it:

    1) Boot from the Mac OSX install DVD and run disk utility
    2) Create the partitions you want (I created 5 partitions: a common one for data to share between OSes, Linux, Windows, Mac OSX, and Linux Swap - in that order, be sure to add the labels as it will help identify partitions in installation of the other OSes). All of the partitions are "formatted" as MS-DOS FAT32, except the one where we install Mac OS (/dev/disk0s5 - the fourth of the partitions we created).
    3) Install Mac OS X into the 4th of the partitions you created (this is actually the 5th partition (/dev/disk0s5) on the disk since the EFI partition is partition 1 (/dev/disks1)
    4) Boot into Mac OS X and install rEFIt 0.13 or later and ntfs-3g.
    5) Boot with the windows install CD, and install Windows to partition 4. DO NOT do any partitioning during the windows installation. You can format the partition where you are installing windows as NTFS. After installing Windows, you can install the apple device drivers from the Mac OS X install DVD. I waited until I finished installing Linux to do this.
    6) Install the Linux of your choice to partition 3 (/dev/disk0s3), and assign the swap partition as /dev/disk0s6. I installed Debian Linux (kernel 2.6.26). During the Linux installation, I installed rEFIt so that I could use gptsync to synchronize the gpt prior to installing LILO. After installing LILO, I had to edit initframs.conf (under /etc/initrafs-tools/) and change "MODULES=most" to "MODULES=dep" (this is required otherwise you get a kernel panic). I also installed ntfs-3g to enable read/write access to the Data partition. At this point I finished the installation and booted using the rescue mode and ran a shell in /dev/disk0s3 and executed the command: update-initramfs -k 2.6.26-2-amd64 -u -v (I tried executing this command before rebooting, but I got an error, which was solved by rebooting)
    7) Reboot and re-synchronize the gpt (it should already be OK at this point, but run it just to be sure)
    8) You are good to go with a triple boot system, a shared partition, and a linux swap.

    Hope that helps.
blog comments powered by Disqus