Triple Boot Vista, Linux and OSX

Recently I bought a new Vaio VGN-SZ and as per usual I immediately zeroed the drive and began creating my patented partition layout. It was here that I paused for a second and thought about my recent need for an Intel Mac. A quick Google later looking at the prices for a Mac Air, and work on triple booting my Vaio was underway. The result of this work is documented below.

NOTE: I started by removing all partitions from the drive, including the VAIO recovery partition. This is not required and if preferred you can skip the first step in part 1.

Software needed (other than Vista and a Linux distribution)

 

1. Setting up Windows Vista

  • I always start with a zeroed drive, so the first step is to install Windows Vista. The procedure for installing Vista is very simple and will not be covered here. When installing avoid using the entire drive to leave space for the other partitions required for Linux and OSX.
  • By default Vista will use the entire drive for itself. To reduce the size of the Windows partition:
    • Boot into Sys Rescue, type startx and run gparted.
    • Right click the Vista NTFS partition, select Resize/Move and change the size of the partition leaving enough space for Linux and OSX.
    • Click Apply to commit the changes made.
  • While we’re modifying the NTFS partition its a good time to create a HFS+ one for OSX:
    • Right click the unallocated partition, select New.
    • Enter a size for OSX and change the Filesystem to unformatted. Click Apply to make our partition changes. NOTE: We really want this partition to be hfs+ but the version of gparted I was using could not create this, requiring me to use unformatted and perform the next step.
    • Quit gparted and enter fdisk /dev/sda in the Terminal. Type p to see a list of partitions and note the number of the unformatted linux one (/dev/sda2 in my case). Enter t to change the partition type, enter the partition number and enter af as the hex code. Enter w to commit the changes and exit fdisk.

 

2. Setting up OSX Leopard

  • Restart the computer and insert the Kalyway Leopard 10.5.1 installation DVD. When the Darwin boot loader is displayed press F8 and enter -v. Wait for the installer to load, this can take some time.
  • Select your language and click past the welcome and license screens.
  • On the ‘Select a Destination’ screen click Utilities -> Disk Utility. In Disk Utility select the disk that is greyed out. This is the partition we created earlier for OSX. Click Erase, select ‘Mac OS Extended (Journaled)’ as the Volume Format and click Erase. Confirm the action and then close the Disk Utility.
  • Select the new disk added to the ‘Select a Destination’ screen and click Continue.
  • Click Customize on the Install Summary. Tick Vanilla_Kernel ACPIPlatform, open Bootloaders EFI, remove BOOT_efi_guid and tick BOOT_efi_mbr. Click Done.
  • Click Install and wait for the installation to complete.

 

3. Setting up Linux

  • Restart the computer and insert the Linux DVD.
  • Install as normal with one exception; the option to install the boot loader to the Linux partition and not the default MBR must be selected.

 

4. Preparing the boot options

  • Boot into Sys Rescue
  • Activate the Vista partition - Enter fdisk /dev/sda in the bash shell Type p to see a list of partitions and note the number of the one marked as Boot (/dev/sda2 in my case) and the number of the Linux boot partition (/dev/sda4 in my case). Enter a to change the partition boot option then enter the partition number. Repeat the last operation this time toggling partition 1. This activates the Vista partition as boot. Enter w to commit the changes and exit.
  • Mount the Vista partition - Enter ntfs-3g /dev/sda1 /mnt/windows in the shell.
  • Copy the Linux boot sector - Enter dd if=/dev/sda4 of=/mnt/windows/linux.boot bs=512 count=1 to copy the Linux boot sector. NOTE: replace the sda number with that noted from fdisk.
  • Unmount the Vista partition - Enter umount /mnt/windows
  • Because changes have been made to the NTFS partition Vista will need to recover from the shock. To do this restart the computer, insert the Vista DVD and when asked select Repair and restart. Allow the process to complete and remove the DVD when the computer restarts. Boot into Windows Vista and allow CHKDSK to run if it starts.

 

5. Putting it all together

  • Open a Command Prompt in Vista as administrator and enter the following commands to add Linux to the Vista bootloader.
    NOTE (replace ID with the number returned by the first command)
    • bcdedit /create /d "Linux" /application bootsector
    • bcdedit /set {ID} device boot
    • bcdedit /set {ID} path \linux.boot
    • bcdedit /displayorder {ID} /addlast
  • Download the chain0 bootloader and copy it to c:\osx.boot
  • Repeat the bcdedit commands for OSX replacing the description and path to the bootloader

- FIN -


About this entry