Update (2015-12-04): This document used to be very lengthy as there were many manual steps required to get OpenBSD and Mac OS X working together through Boot Camp Assistant (BCA), which created a hybrid MBR and enabled a legacy BIOS emulation mode which older versions of Windows (and OpenBSD) required. Newer Macbooks stopped supporting older versions of Windows through BCA and now only support Windows 10 since it uses GPT and UEFI. However, now that newer versions of OpenBSD support GPT and UEFI, Boot Camp Assistant is no longer needed at all to boot OpenBSD.
###Mac OS X FileVault encryption and OpenBSD encrypted softraid on a Macbook Air/Pro
OpenBSD works pretty well on at least the Mid-2011 Macbook Air (A1370, SandyBridge) and Mid-2013 Macbook Air (Haswell). The new KMS code in 5.4 brings up the MBA's eDP display in 1366x768 with backlight control. ACPI works as expected for battery/AC status, CPU throttling, and full suspend/resume support. The Broadcom wireless card does not work, so I am using this tiny USB adapter (
urtwn) which is rather unobtrusive when plugged in.
The Broadcom multi-touch trackpad is supported as of 5.5 with the
ubcmtp driver, allowing for two-finger scrolling and 2- and 3-button emulation by clicking with multiple fingers.
5.8-current brought new or improved support for GPT, UEFI, USB 3, and Thunderbolt (at least Apple's gigabit ethernet adapter, supported by
bge). GPT and UEFI support allow OpenBSD to co-exist with Mac OS X without the need for Boot Camp Assistant or Hybrid MBRs (though rEFInd is suggested for a graphical boot menu to choose between the OSes). Here's how to get both OSes working, each with its own disk encryption.
####Mac OS X Configuration
Encrypt your drive by enabling FileVault. This will convert it into a Core Storage volume.
Open Disk Utility, click on your hard disk (the drive, not the Mac OS X partition) and click Partition. Click "+" and add an HFS+ partition (choosing MSDOS for the type will create a Hybrid MBR which will cause problems later) of your chosen size that will be used for OpenBSD. Disk Utility will do a live resize and hopefully create your new partition. Pro tip: open a terminal before doing the resize, and
tail -f /var/log/system.logto see the output of
hfs_truncatefsdoing its thing. This can take a half hour or more.
Download the latest OpenBSD amd64
ddit to a USB disk. Pro tip: if you're using a USB wireless device that requires firmware (like
urtwn), download it manually from firmware.openbsd.org and put it on removable media (or possibly even your existing EFI MSDOS partition). Otherwise you won't have a network device available with which to download firmware for your network device.
Reboot your Mac and hold down the Alt key immediately after the startup chime. Select the orange 'EFI Boot' disk.
When OpenBSD boots, choose
fdisk -e sd0and there should be a new HFS+ partition already sliced out from Disk Utility. Change its type to
disklabel -E sd0, create a new slice taking the defaults for the new OpenBSD partition, and use
RAIDas the type. Write/quit.
bioctl -cC -l /dev/sd0a softraid0to create a new softraid encrypted disk from the just-added RAID partition, and enter a passphrase. A new
sddevice should show up.
installto get back to the installer, use
sd2or whatever was just created as the root disk, proceed as normal. When prompted, choose to use the "(W)hole disk MBR" for
sd2, as the current bootloader only supports MBR partitions on softraid devices.
Before rebooting, mount the UEFI ESP partition of your hard drive and move the bootloaders OpenBSD just installed from
/EFI/boot(the default EFI location) to an
/EFI/openbsddirectory, since we will be dual-booting and rEFInd needs to see them in an
mkdir /efi; mount -t msdos /dev/sd0i /efi; mkdir /efi/EFI/openbsd; mv /efi/EFI/boot/boot* /efi/EFI/openbsd/
reboot. Your Mac should boot back into OS X.
- In OS X, install rEFInd per the instructions there. Reboot and you should now see a graphical boot menu with the OpenBSD blowfish. Selecting OpenBSD should boot to the usual bootloader, prompting you for your softraid passphrase.
- Figure out how to disable startup chime from OpenBSD (StartupSound doesn't seem to work on Mountain Lion anymore, what is it doing anyway? Writing something to NVRAM?)