Installing PC-BSD on a MacBook Pro
Dual Booting is a nice guy, once you get to know him.
Chances are, if you’ve got an Intel based mac, you’ve given some serious thought to dual booting, or you’ve done it already. Setting up Boot Camp and installing Windows XP or even Vista is hardly even a project. And with Apple handing you a driver disk, it’s not even tough to figure out things like graphics and wireless cards.
So maybe you’ve thought about installing and dual booting something OpenSource, like PC-BSD. It should work, right? It’s easy enough to do on a non-Apple system, and frees you from the Windows experience.
And why shouldn’t it work? Apple, after all, laid down the rails for OS X on what’s essentially FreeBSD. Okay okay, It’s Darwin. But Darwin is more or less just FreeBSD with out of date code. And hey, PC-BSD really is FreeBSD! It’s a match made in heaven, I’m telling you.
What you might not expect is that installing PC-BSD is almost as easy as installing Windows. It took some doing, and several reinstalls, and an accidental power loss, but I’m successfully dual booting MacOS 10.6 (Snow Leopard) and PC-BSD 7.1 (Galileo). You too can live the dream!
DISCLAIMER: I’ve only done this on a 2006 MacBook Pro (2,2). I can’t speak for all Macs, and I’ll test it on others as they come my way, but the procedure should still be universal, at least for the installation.

This is what I had to work with.
- Core 2 Duo @ 2.33GHz
- 2GB DDR2 667MHz RAM
- 120GB 5400rpm disk
- ATi x1600 Mobility 256MB
Bring it all together
The first thing to do is to make sure you’re starting from a clean slate. Open Boot Camp Assistant. If you haven’t got it for some reason, it should be on Apple’s website, but if they’ve removed it, it should be on any System disk for 10.5 or 10.6. It’s worth noting that 10.6 uses a different, newer version of Boot Camp than 10.5, so I’m not sure if there are any adverse effects on this installation.
If you’re like me, and you’ve been using Windows, you’re going to need to collapse back in your Windows partition in order to expand it back out again. (Restore disk to a single volume.) Don’t bother with driver disks or any of that stuff. Size it however you like, but probably give yourself at least 10GB to play with.

Start your engines
I know, it sounds weird, but trust me. You want to make sure that you’re starting from a blank, new partition. If you had one disk partition to start with, just do the part where you split out a new partition. It’s going to be NTFS, and that’s okay, for now. Quit the application after it finishes partitioning, but don’t restart. We have to work a little more magic first.
If you’ve already tried to install FreeBSD or PC-BSD, but need to reformat the partition, be aware that Boot Camp Assistant won’t let you repartition anything involving UFS into a single partition. Don’t worry about it. Just open up Disk Utility, and reformat your UFS partition as NTFS, or FAT32, or really anything on the list. After that, you should be able to use Boot Camp Assistant to get the right job done.
rEFIt to the rescue
Next, you’re going to need some software to boot with, since Boot Camp hates anything that identifies itself as anything other than NTFS. Mostly this has to do with Windows XP being really, really old.
Vista, Linux, OSX, FreeBSD and PCBSD are all willing to use GPT instead of an MBR. But XP will only work with an MBR, so Boot Camp pretends to have one, and has GPT besides that. This is the trickiest part of the whole setup, and led me to more reinstalls than anything else. If you flub the install, just start over. Don’t bother with Boot Camp Assistant once you have a working blank partition (Installing FreeBSD or PC-BSD will re-blank it as UFS2).
Eventually, Boot Camp will also see your install, but not as quickly as rEFIt, which is useful to us in general.
http://refit.sourceforge.net/
You’ll need this for everything that happens next. The install instructions are good, and it’s a pretty basic install, but there’s something you want to look out for.
Don’t activate rEFIt. Not yet.
Once you activate rEFIt, it will start poking at the MBR and GPT, trying to sync them, and also changing the way they’re read, based on its interpretations. This can derail your whole installation, and it did derail mine several times. What we’re actually going to do is ruin the MBR and GPT, making them unsyncable, and to do that, we want to not activate rEFIt until we’re good and ready.
So now, it’s time to put your PC-BSD installer disk into the drive, and reboot.
Flying the flag
Installing PC-BSD is easy and straightforward. There are a few things to watch for, though. Make sure you’re installing onto the correct slice, don’t overwrite OSX, and definitely don’t overwrite the EFI. The EFI is always the 200MB slice, and will always be slice 1. If you’ve done everything correctly, OSX will be slice 2, and slice 3 should be something you can tell is set up for Windows.
Don’t install the bootloader. You won’t need it, and it’ll screw everything up. (Another lesson learned the hard way)
I recommend not picking any of the extra packages for PC-BSD, in case the install fails or you mess up. You’ll regret the extra 20 minutes it took for those packages to install, I promise you. And when the OS does work, you can celebrate by installing whatever you feel like.
It’s really up to you, I’m just advising caution here.
Once PC-BSD finishes installing, it’s time to ‘ruin’ your MBR table.
Restart the computer, boot again from the install disk, and hit ‘6’ for emergency console when you get to the boot menu. This will let you use fdisk to modify your MBR.
You’ll need to edit the sysid in order to make sure the disk is recognized for what it is, and the filesystem it contains. The sysid should be 165. Change it or make sure it is, then hit W to save your changes. When you exit fdisk, it will ask you if you want to install a boot loader or change the MBR. You don’t want either of those, so hit none.
Remember our little rEFIt buddy? Now it’s time to go back to OSX and get his help.
You need the blue key
rEFIt won’t activate until you go into the terminal and type
/efi/refit/enable.sh
Which will then ask for your root password and ‘bless’ the install, enabling rEFIt to open when you hold down the option key at startup.
Restart.
Decisions, decisions
You should now get rEFIt as a selectable choice when you restart and hold down option. Pressing enter will hopefully give you the choice of OSX or “FreeBSD” (It will also show the installer disk as FreeBSD if it’s still inserted). It’s worth going down to the bottom four options and selecting ‘gptsync.efi’. This will open up a little EFI shell that tells you about your GPT table and your MBR and tries to sync them.
In fact, the sourceforge page tells you to do it.
Don’t do it.
I did, every time, and was then mystified when everything stopped working, but it turns out that gptsync.efi will change your nice little 165 sysid and FreeBSD flag into ‘Microsoft Basic Data’, which doesn’t boot and is one of the many reasons I had to try the install so many times. I eventually got it working when I accidentally ran my install without rEFIt enabled.
To give you some idea what “working” looks like in gptsync.efi, I’ve got my output here:

It's supposed to look like this. Really.
Oddly enough, working sure looks a lot like ‘full of deadly errors’. Thankfully, this is just what the doctor ordered, and it works better than it has any right to.
My start and end are even messed up. It makes no difference at all. It’s possible that you can do some comparative fdisk surgery using the pre-install data and changing the post data to match. I didn’t do that, and it obviously hasn’t hurt me, but if you feel the need, I doubt it will adversely affect the installation.
The result we wanted is what we have, though. gptsync leaves me alone, and I can boot from both rEFIt and bootcamp’s normal loader, although the normal loader calls it ‘Windows’, and there’s nothing you can do about that.

rEFIt and 'Windows'

It's good to have choices

Got me a boot screen and everything

Where I come from, we call this 'hella sweet, yo'
Sunday drivers
I was at a serious disadvantage with what happened next. Sure, I got the splash screen, and I got to log in and all that jazz, but the 2006 MacBook Pro shipped with an ATI Mobility Radeon X1600. Ouch, right?
It took a little bit of screwing around with drivers, but you can get desktop effects to work, and you can get 3D graphics to work. The secret is using ati-3D-enable. The Radeon HD drivers will get the card working, but OpenGL wont work, and xrender fails miserably. I’m talking artifacting through windows, glitches, lag… Not a fun experience.
I, and other ATI users have it the hardest possible, too. The Intel GMA950 (i945GM) in the MacBook just works. And nVidia has amazing driver support for FreeBSD and therefore PC-BSD, so no matter what mac you’ve got with an nVidia card, it’s guaranteed to work.
Audio just worked for me. I haven’t found other horror stories from people about this, but I assume it just works.
The things that won’t work are right click, wireless, and backlight control with the fun little keys.
Wireless works on the Core Solo MacBook with the Atheros 5424, but not on the Core 2 Duo MacBook or MacBook Pro with the Atheros AR5008. Myself and iXsystems’ crack team of expert system tweakers are pretty sure we can get it working, but as of right now, no wireless.
Right click is just one of those things. The FreeBSD wiki discusses workarounds for some of these things, but I haven’t tested any of them. Note that their install instructions are similar to mine, but I couldn’t get it working using their methods.
http://wiki.freebsd.org/AppleMacbook
It even looks like you can use the apple remote, eject button, the whole enchilada.
Replacing Windows
At this point, Windows may be gone from your mind, but not from your heart. Never fear, PC-BSD ships with Wine. For those of you who don’t know, Wine is awesome. When you get an .exe or an .msi, don’t worry about it. Just double click it, and it’ll install.
Unless, of course, it doesn’t.
I was gleefully installing MSI after MSI, until I hit some snags. I tried to install Steam and Hexagon 2 (A 3D modeler that nobody but me uses). Steam worked sort of alright, but had some issues after it was done updating. Hexagon 2 wouldn’t even launch the installer.
I fixed all my problems following a guide for installing Hexagon 2 on Ubuntu (yuck). (http://forum.daz3d.com/viewtopic.php?t=114976)
Some of the things he recommends doing are very smart. If you don’t feel like reading all that, I’ll abbreviate the useful information.
Switching your Z: drive to /home/username/zdrive or similar isn’t an entirely terrible idea. It keeps all of Wine’s installer fluff in one place, and makes sure it can always write. It’s never fun when an install fails because of permissions and doesn’t tell you.
Winetricks is essentially the greatest add-on in the history of everything. Get it now. If you don’t use it here, I know it’ll be useful for something else. It saved my bacon on every installer so far. There are just… little things that Wine doesn’t ship with that can make or break an install. Winetricks gives you this amazing little GUI buddy that will go get and install whatever you want from that list.
The things that you’ll love having are:
core fonts – Installs all those default windows faults we like so much. We like them because it keeps installers from not starting because they can’t find fonts. Windows sure is cool.
gecko – HTML rendering engine. This made Steam work for me, among other things. It’s amazing how much HTML is in weird places these days.
vcrun6 – I needed this for the installer. There’s some DLL it installs that I needed. That’s how it always is, though. This particular one is the Visual C++ Runtime environment, so it’s probably useful for other applications.
d3dx9 – DirectX 9, as you might expect. This is going to come in handy for anything that’s 3D. Windows is full of things like that, so you might want it. It’s 103MB to download, though, so if you don’t need it, use your discretion.
After that, all your installs should be relatively successful. A good trick is to install programs using the ‘wine’ command in the terminal. You can see the output this way, and figure out what packages to get with winetricks to fix it. It’s a little bit of a dodgy setup, I know, but it’s still preferable to the alternative of actually using XP.
Stick it to the man
This is optional, but it looks pretty cool at night.

How do you like them Apples?
Comments
-
Tweets that mention Dramashack! » FreeNAS 0.8 is Highly Experimental, Proceed with Caution! -- Topsy.com
[...] This post was mentioned on Twitter by Denise and Denise, James T. Nixon III. James T. Nixon III said: Blog: Understanding the new FreeNAS UI – http://bit.ly/cgocM5 #freenas #django #freebsd [...]
-
James T. Nixon III
Lol, I know right!?
-
Matt Olander
Great pix, James! Haha, that’s ironic that ISC, a customer of iX, won the server! PERFECT
-
alan
One Question Habra version The 3 cds of the PC-BSD 8.0 Hubble Edition
-
Shaul
I would have to completely disagree with what you say how good PC-BSD is. And for the record, I do not use Linux, I do not have Linux installed on any systems. With the code they develop on top of FreeBSD for PC-BSD has consistency issue, and just don’t think they pay close enough attention to code correctness, I think it gets sluggish. Although my first choice is always to use OpenBSD on everything, I have set up FreeBSD as a desktop system. All I do is select minimal install, populate ports and source, patch the system, compile KDE4 from ports, and I find everything runs better and quicker that way. Once Firefox has been compiled from ports, I have seen it load instantaneously when you select it from KMenu. With PCBSD being developed for people who don’t know any tech stuff, and their own lack of proper auditing of code in the manner of say OpenBSD, I see definite performance issues, and some speed issues. I think it just gets bogged down. So that is why I would definitely disagree with what you say about how good PC-BSD is.
