Welcome!
Wednesday 08 September 2010 @ 15:13 CEST

Triple boot OSX Leopard, Ubuntu 8.04 and Widows Vista

TechI received a Mac Mini today. We plan to use it as part of our lab setup here at work. The box is pretty small and compact. It's quite cheap too.

It will primarily be running some flavor of Linux, but I plan to install Windows Vista ("Business" version) and OSX Leopard on it as well. This way I can quickly test all three OSes if needed. So how do we set up triple boot on this box? It turns out to be quite easy.

1. Installing OSX Leopard

First, install OSX. Use the whole disk. After installation is complete, do a "software update" if needed.

2. Installing Windows Vista

Next, we need to split our OSX partition in two. One for OSX, which will be resized, and another for Windows. The program "Boot Camp" does all that for us. Start it from:

"Finder" → "Applications" → "Utilities" → "Boot Camp Assistant"

Boot Camp presents us with a nice slider to resize the OSX and Windows partition. I allocate 25GB to Windows Vista:

After the resize is complete, you'll be asked to insert the Vista DVD and choose "start installation". OSX reboots and boots from the Vista DVD. The last partition is for Vista, so we format it (using NTFS).

After a couple of reboots later, Vista is installed

At startup, Vista boots as default. To change this press and hold the "Alt" key startup boot. Boot into OSX.

3. Re-partition and install rEFIt

In OSX, start "Disk utility" from "Utilities". Under "Partitions", choose the OSX partition and click the "+" button. This splits our OSX partition in two. The new partition will be our Linux partition. Don't worry about the name or format (HPFS), we'll re-create it using ext3 later.

Next, we need to download a boot-manager that manages both EFI (which Mac uses) and (old) MBR (required by Windows). Head over and download rEFIt. After you've installed rEFIt, open a "Terminal" and type (yes, still in OSX):

$ cd /efi/refit
$ ./enable.sh
+ sudo bless --folder /efi/refit --file /efi/refit/refit.efi --labelfile /efi/refit/refit.vollabel

Great! Now we have a nice graphical boot manager.

4. Installing Ubuntu 8.10

Download Ubuntu 8.04 (i386) from here and burn it to a CD. (Actually, since 8.04 isn't released yet, I'm using the alpha5-release fetched from here). Boot the installation CD from the rEFIt menu.

When installing Ubuntu, there are two important steps:

  1. When choosing partition be sure to manually partition the disk. Then delete the third (sda3) partition. Re-create it using ext3 and set the mount point to "/". Do NOT create a swap partition. We'll create swap later.
  2. Grub: Be sure to install grub on sda3 and NOT sda (hd0). You can change this by choosing "Advanced" under the last installation step.

At the next reboot, we're presented with a nice boot screen:

We're not quite done yet. Since Mac uses GPT, which don't allow logical partitions, and MBR, which Windows require, - we're stuck with four (primary) partitions. That's the reason why we can't have dedicated swap partition. So we create a swap file (in Ubuntu):

$ sudo dd if=/dev/zero of=/swapfile bs=1024 count=2097152
2097152+0 records in
2097152+0 records out
2147483648 bytes (2.1 GB) copied, 80.0314 s, 26.8 MB/s
$ ls -lh /swapfile
-rw-r--r-- 1 root root 2.0G 2008-03-05 18:34 /swapfile
$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile
Setting up swapspace version 1, size = 2147479 kB
no label, UUID=819c205d-b3de-4ed0-ae4c-17e8b7e81443
$ sudo swapon /swapfile
$ free -m
total used free shared buffers cached
Mem: 1996 569 1426 0 12 196
-/+ buffers/cache: 360 1635
Swap: 2047 0 2047
$ cat /etc/fstab
...
/swapfile swap swap defaults 0 0

That's it. Our partition layout now has the first (sda1) partition occupied by EFI, next (sda2) is OSX, third (sda3) Linux and the last (sda4) Vista. A graphical layout (using gparted) listed below:

Trackback

Trackback URL for this entry: http://blog.larsstrand.org/trackback.php?id=Triple-Boot-OSX-Ubuntu-Vista

Here's what others have to say about 'Triple boot OSX Leopard, Ubuntu 8.04 and Widows Vista':

http://aaronstaves.com/2008/11/06/macbuntu/
Tracked on Friday 07 November 2008 @ 04:12 CET

The Mac Trifecta « Brian Goins
Tracked on Friday 30 October 2009 @ 06:52 CET

hills kattenvoer from hills kattenvoer
hills kattenvoer [read more]
Tracked on Friday 29 January 2010 @ 14:10 CET

Triple boot OSX Leopard, Ubuntu 8.04 and Widows Vista | 23 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Triple boot OSX Leopard, Ubuntu 8.04 and Widows Vista
Authored by: Anonymous on Monday 10 March 2008 @ 05:55 CET
I like the tutorial good job. I was wondering if you would be able to add directions on having an extra partition in FAT32 for storage so that all 3 OS's can read and write to it. Thanks
  • Re: - Authored by: credit loans on Tuesday 31 August 2010 @ 20:23 CEST
  • Re: - Authored by: loan on Tuesday 31 August 2010 @ 21:44 CEST
Triple boot OSX Leopard, Ubuntu 8.04 and Widows Vista
Authored by: Anonymous on Monday 17 March 2008 @ 20:43 CET
When you partitioned the drive in Disk Utitlity, what version of the Leopard OS were you using: 10.5.0? 10.5.1? 10.5.2? I've been trying to do it your way (and a lot of other ways) in 10.5.2 and it always kills my win partition when I use Disk Utility to partition. It also warns me in DU that the one partition is BootCamped and that any change to that partition might "ruin" the BootCamping. It won't let me partition the Bootcamped partition. Any help/info would be appreciated.

Thanks,

J
Triple boot OSX Leopard, Ubuntu 8.04 and Widows Vista
Authored by: Anonymous on Thursday 08 May 2008 @ 21:48 CEST
I tried this but I seem to be stuck on creating the swap file do I reboot after installing ubuntu and boot into os x. If i do that i get an error that there is now mkswap command. I can not boot into any other os besides os x it says install bootable device. What am I doing wrong
Triple boot OSX Leopard, Ubuntu 8.04 and Widows Vista
Authored by: Anonymous on Sunday 06 July 2008 @ 01:54 CEST
Followed this procedure, more or less, and it worked like a charm! The only issue I had was after adding the Ubuntu partition and installing, Windows would no longer boot. I had to boot into Windows Recovery Mode from the Windows XP install CD, and use bootcfg.exe to add a boot entry for partition 4 (Windows had been installed to partition 3). Then once I was booted into XP again, I removed the bunk boot entry.

Otherwise, good to go! Thanks!
Triple boot OSX Leopard, Ubuntu 8.04 and Widows Vista
Authored by: Anonymous on Saturday 12 July 2008 @ 20:00 CEST
help guys!

i have a macbook pro,windows xp (sp2), ubuntu hardy. first, i installed leopard on the whole disk (200G). update it (10.5.2). now going in bootcamp and repartition for windows (15G). Insert my original Windows XP and install. Now the problem - i cannot reformat the partition to NTFS. If i select C: (bootcamp) it will start the installation (FAT32) and then when rebooting and selecting Windows to finish the installation: Disk Error. On Apple this error means that we need to format the partition before installing the files on it. If i delete the partition (S - S) i cannot recreate it because there's a limit in Windows (4) so i need to erase the 200M (first partiton) and then yes i can boot and finish the install of XP but when installing linux Windows is not there anymore. oh well - it sucks. also many tutorials show how to use terminal in OSX to sudo diskutil resizeVolume etc... Linux Linux and i get Linux not a valid file system - that's suck even more. Leopard doesn't seem to have Linux (ext2 / 3)... it should be so simple...
Triple boot OSX Leopard, Ubuntu 8.04 and Widows Vista
Authored by: Anonymous on Tuesday 28 October 2008 @ 10:45 CET
When you created a swap file, were you doing that from within Ubuntu or Leopard? Does it make a difference?
  • Swap File - Authored by: Anonymous on Monday 22 December 2008 @ 04:04 CET
  • Swap File - Authored by: lars on Monday 22 December 2008 @ 14:36 CET
Different Ubuntu
Authored by: Anonymous on Wednesday 24 December 2008 @ 09:43 CET
Lars,
I was wondering if you know whether this would work with Ubuntu 8.10.
  • Different Ubuntu - Authored by: Anonymous on Friday 06 February 2009 @ 20:06 CET
Triple boot OSX Leopard, Ubuntu 8.04 and Widows Vista
Authored by: Anonymous on Monday 25 May 2009 @ 02:31 CEST
i tried this with Windows XP.
One issue comes up, after creating new partition for Ubuntu, Windows won't boot, with UNMOUNTABLE_BOOT_VOLUME.

After trying chkdsk, fixboot with XP recovery console, but no luck, it comes to my mind that it was the "boot.ini" which specified the partition number of XP. This was "3" before Linux, now should be changed to "4".
Bingo.
Think you may want to update your pages, which has been very useful to me, but missing this piece. Thanks.

- nick
Triple boot OSX Leopard, Ubuntu 8.04 and Widows Vista
Authored by: Anonymous on Thursday 18 June 2009 @ 06:01 CEST
I have a macbook air. I'm trying to install Linux Fedora along with the Mac OS. I'm running refit and sync both partition schema. The problem is that I cannot get Fedora to boot. Below is how my partition schema is layout. And ideas is most appreciated and God Bless.

*** Report for internal hard disk ***

Current GPT partition table:
# Start LBA End LBA Type
1 40 409639 EFI System (FAT)
2 409640 117630463 Mac OS X HFS+
3 117630464 118040063 EFI System (FAT)
4 118040064 234440191 Basic Data

Current MBR partition table:
# A Start LBA End LBA Type
1 1 409639 ee EFI Protective
2 409640 117630463 af Mac OS X HFS+
3 * 117630464 118040063 83 Linux
4 118040064 234440191 83 Linux

MBR contents:
Boot Code: Unknown, but bootable

Partition at LBA 40:
Boot Code: None (Non-system disk message)
File System: FAT32
Listed in GPT as partition 1, type EFI System (FAT)

Partition at LBA 409640:
Boot Code: None
File System: HFS Extended (HFS+)
Listed in GPT as partition 2, type Mac OS X HFS+
Listed in MBR as partition 2, type af Mac OS X HFS+

Partition at LBA 117630464:
Boot Code: GRUB
File System: ext3
Listed in GPT as partition 3, type EFI System (FAT)
Listed in MBR as partition 3, type 83 Linux, active

Partition at LBA 118040064:
Boot Code: None
File System: ext3
Listed in GPT as partition 4, type Basic Data
Listed in MBR as partition 4, type 83 Linux