Day: October 12, 2007

Triple-Booting a Mac Pro

Updated 2007-10-14. Scroll down to where it says "Update 2007-10-14". I'd put a link here, but for some reason b2evolution will not let me use the "id" or "name" attributes; expect a presumably silly and useless "rant" on that subject very, very soon. (Update 2008-01-17: Switching to WordPress fixed the problem.)


So I got that Mac Pro I was talking about earlier. No, I still can't afford the thing, so if you notice me living a life of indentured servitude for the rest of my days, well...I'm Irish. We're used to it.

The bastard about being on the bleeding edge is that there aren't a whole lot of guides to walk you through your setup. For example, I found quite a number of guides on how to multiboot a MacBook Pro with 3 OS's on different partitions of the same drive, but approximately bupkis on how to do it on a Mac Pro with each OS on its own drive.

So, in case anyone winds up Googling for the same information I couldn't quite find, here's how I finally did it. Hopefully this'll make it easier for you than it was for me.

Installation and booting

I can't say for certain, but I think order of drives and order of installation are both important.

After some trial and error, I wound up laying my drives out like this:

Drive 1 is Kubuntu.
Drive 2 is OSX.
Drive 3 is Windows XP x64.

Leastways, that's how they're set up in hardware. For reasons I'm not altogether clear on, they show up in software as Kubuntu on sda, Windows on sdb, and OSX on sdc. Still more curiously, both the Kubuntu drive and the OSX drive are assigned SCSI ID 0,0,0. (Could be some holdover from the old master/slave days? Maybe the drives are on different controllers? Something to do with MBR vs. GPT? Is it because the Kubuntu drive is physically first but the Mac drive boots first? Don't know.)

Order of installation seems to be important too. I say this because my first time through, I installed Kubuntu, it ran fine, and then I installed Windows and Kubuntu wouldn't boot anymore. I'd click on the Linux icon and it would boot the wrong OS. (Actually, it still does; more on that later.) So, as with most things in life, everything was going great until I installed Windows.

But after a day and a half of banging my head against the wall, I finally got all 3 OS's moving by rearranging the drives (see above) and installing Windows first and then Kubuntu. (OSX, of course, was preinstalled.)

Things to keep in mind: since we're talking 64-bit Windows, the Boot Camp program is useless. You can ignore it. It might be useful for resizing your OSX partition since Windows insists, for no reason whatsoever, on writing system files to the first drive. I say "for no reason whatsoever" because you can move those files -- boot.ini , ntdetect.com , and ntldr -- to the drive Windows is installed on and it'll run just fine. There's more info at x(perts)64; that guide is specifically for dual-booting XP and Vista, but I found it useful anyway.

(Also, "the first drive" noted above is actually the second drive in my case, which caused a good deal of confusion; as I mentioned earlier, both the Kubuntu drive and the Mac drive show up as 0,0,0.)

It's also worth noting that the much-ballyhooed rEFIt doesn't work for me; I have to hold down Option at startup to get a working boot menu.

That menu gives me the following:
rEFIt, Windows, Windows, Windows
because EFI very helpfully assumes anything that's not Mac is Windows.

The first "Windows" is actually Kubuntu. The second gives me "Error loading operating system". I assume that the first "Windows" is the MBR of the drive and the second is the first partition, which is flagged bootable but doesn't have Grub on it.

The third "Windows" is actually Windows.

Now, rEFIt looks similar -- it offers "Boot Mac OS X from Mac", then "Boot Linux from HD", "Boot Legacy OS from HD", "Boot Windows from Partition 1", not always in that order -- but the last three all open the same OS, either Linux or Windows depending on which I booted more recently.

So I'm stuck with holding Option at boot and selecting the left Windows or the right Windows, but at least it works. I'm hoping future versions of rEFIt fix this problem.

Windows

Here's where you can find the necessary 64-bit drivers for Windows:

(Sources: Triple Boot thread on the Apple forums; Airport Driver thread on driverguide.com forums)

Kubuntu

Boot issues aside, this is the single most painless Linux installation I have ever experienced. I know there's no dearth of people singing the praises of Ubuntu and how close it is to being ready for desktop use, but I'm afraid I'm going to have to add my own redundant voice to the chorus. It was almost painless.

I still had to install the nVidia drivers by hand -- either get us some free drivers that work or stop being so damn concerned about ideological purity, guys; I need support for my video card, and this would make life pretty rough for the average user. But by my standards as a Linux vet...I didn't even have to touch xorg.conf. Kubuntu, how I love you.

Setting up wireless was another concern, especially when I read there was no native support for the adapter and I'd have to use ndiswrapper. Let me explain something about ndiswrapper: it was a bastard to install under Gentoo, and is responsible for every single kernel panic I've experienced in the past year and a half.

Under Kubuntu, on the other hand, it was over in minutes. And I don't want to jinx it, but it hasn't panicked my kernel yet.

There's a HowTo at ubuntuforums.org. Steps 1-3 are outdated now; Feisty comes with a current version of ndiswrapper, so you won't need to update it. As for the bcmwl5.inf file, it's the same one in the Dell package I linked above.

To get wireless to work immediately at boot, you'll also need to set your access point up. In Kubuntu, you do go to K → System Settings → Network Settings, click "Administrator Mode", enter your password, click wlan0, then Configure Interface, and enter the ESSID and WEP key. (DHCP and "Activate when computer starts" should already be set.)

I will note that on one of my reboots wireless didn't start up automatically and I had to run iwconfig myself. I think that's most likely due to signal interference in my apartment, but I can't say for sure at this point.

Sound support was the biggest problem I hit. The ALSA driver for Feisty doesn't support the Mac Pro's audio adapter.

After poking around for awhile, I decided that rather than bother with the individual package, I'd just go ahead and upgrade to Gutsy RC. After all, if you've even read this far, I'm guessing you're somebody who's not afraid of the letters "RC"; I'd advise you just to go with Gutsy from the start. (Course, by the time anybody actually reads this guide, I'm betting Gutsy final will be out.)

So far Gutsy's working just fine for me. (Update 2007-10-14: Except that I can't adjust volume from the keyboard. The bar goes between 0 and 11 but doesn't actually make any change in the volume. This appears to be a known bug in Gutsy at the moment.)

I'll edit this post if anything changes or if I find anything else out -- I have a Bluetooth keyboard and Mighty Mouse that I haven't bothered trying to set up in Kubuntu yet; I intended it more for my media center/emulation rig Mac Mini anyway. But if I get that, or anything else set up, I'll make a note of it here.

Hoping this has been a help to somebody. I don't usually do this, but when I find myself running into problems that aren't well-documented, I figure I may as well document them myself in the hopes that I can make life a little easier for the next guy.

Good luck, next guy.


Reading: Cat's Cradle again, the first in my "My favorite recently-deceased science fiction authors" theme. I think A Wrinkle in Time is probably next.


Update 2007-10-14: Accessing the Mac drive from Kubuntu

It's easy enough to mount an HFS+ volume under Linux (FS type is just "hfsplus" in mount or fstab), but accessing your home directory or mounting with write permissions is a little trickier.

To access your home directory on the Mac volume from Kubuntu, your Mac user account and your Linux user account need to have the same UID. There are a number of ways to do this; the easiest involve simply creating a new user, but I changed the UID on my Mac login to 1000 with no real trouble.

Just go into Applications/Utilites and run NetInfo Manager, click Users, then your username, then scroll down to uid and gid and change them both to 1000 (or whatever your UID is under Linux -- 1000 is, of course, the default number for the first user account).

After that, you'll need to log out and back in, pull up a terminal, do a sudo chown -R <username>:<group> /Users/<username>, and then log out and back in again.

My source on all this is the Gentoo wiki (even though I'm using Kubuntu).

That should give you write access to your home directory on the Mac drive from Linux. To get read access, you'll need to disable journaling.

It occurred to me that I'd like to keep journaling enabled in OSX and only disable it when I want to access the data from Kubuntu. I came up with a relatively simple solution: I wrote a script to enable journaling when OSX boots, and added a line to the shutdown script to disable it.

For the startup script, I created a directory called /Library/StartupItems/EnableJournaling containing a filepair called EnableJournaling and StartupParameters.plist, as follows:

StartupParameters.plist

{
Description = "Enable Journaling";
Provides = ("Journaling");
OrderPreference = "Late";
}

EnableJournaling

#!/bin/sh

. /etc/rc.common

# Enables journaling on Mac volume

ConsoleMessage "Enabling journaling on /Volumes/Mac"
diskutil enableJournal /Volumes/Mac
exit 0

(Don't forget to make this file executable.)

(Source: Greg Neagle's blog)

And I modified /etc/rc.shutdown to the following:

#!/bin/sh
# Copyright 1997-2004 Apple Computer, Inc.

. /etc/rc.common

if [ -f /etc/rc.shutdown.local ]; then
sh /etc/rc.shutdown.local
fi

SystemStarter stop

# ADD THIS LINE:
diskutil disableJournal /Volumes/Mac

kill -TERM 1

exit 0

Seems to work all right; I get journaling when I'm running OSX, and I get write access when I'm running Kubuntu. (Update 2007-11-05: It appears rc.shutdown is gone in Leopard. I'll update when I learn more.)

The bad news is that it doesn't work both ways. At present I have Kubuntu installed on a ReiserFS volume, which is unsupported by OSX. I could have made it an ext3 FS instead and installed the ext2 driver for OSX, but, well, if I wanted compatibility over performance, I probably wouldn't have gotten a Mac Pro.