As part of some maintenance here, I did a little research as to how to set up NetBoot for various different Macs. For this piece, interchange ‘NetBoot’ with ‘NetInstall’ if you’re being pedantic - I’m NetBooting the install disc for a particular OS. NetBooting a full install should also be possible using the same techniques.
Mavericks Server (an app free to all developers) has a built-in NetBoot (NetInstall) server GUI, but it only supports a handful of modern versions of OS X. Thankfully, if you follow the instructions in the bootpd manpage you can manually build NetBoot images supporting both PowerPC and Intel Macs going back to OS X v10.2.
It should be noted that 10.0, 10.1, and even Mac OS 9 NetBoot images are also ‘supported’ in theory, however the OSes themselves will not actually mount the OS over the network (presumably due to changes in OS X, AppleTalk, AFP, etc over time moreso than intentional deprecation) so none of them will boot as intended. If you want to hack together a custom Mac OS ROM to boot Classic over NetBoot, be my guest!
Reasons to use NetBoot
- You regularly need an easy, fast, way of installing OS X on multiple machines. NetBoot ALL the things!
- You may not have a functional disc drive anymore (it happens!)
- Installing over ethernet is much faster than from the CD-ROM drives in older Macs
- It works over WiFi on modern Macs
- You do custom kernel or OS development, and need a faster way of booting PPC or x86 Macs
- Gigabit ethernet is quite likely faster than any SSD you could install in an older Mac
NetBoot images are folders in your NetBoot storage location (typically /Library/NetBoot/NetBootSP0) with a .nbi extension and a handful of files inside - typically a single disk image, a settings plist, a bootloader, a kernel and a kernel extension cache. You can provide both PowerPC and x86 versions of the latter three items for OSes that support both PowerPC and x86, like 10.4 or 10.5.
Building a NetBoot Install Image
First thing to do is make or find a disk image of the OS you want to install. Be warned that a Mac usually comes with the minimum OS that will boot it, so if you make e.g. a 10.2.0 install disc image, it will not work on a first-gen PowerMac G5 even though that G5 came with 10.2.7. As updated retail discs are generally hard to come by, you may want to make images of the discs that came with your Mac when you bought it. Common sense applies, YMMV.
You will need some things from the disk image to build the NetBoot image in the first place; these files are architecture-specific if you’re making a Universal image, so provide copies with the right arch in the corresponding ppc or i386 folder. If you don’t use an architecture subfolder, it will assume the files are ppc-only.
Make a disk image of your chosen install disc; various versions can also be downloaded from Apple’s Developer Site going back to 10.2 Server. You will want to convert any ISOs to a UDRW dmg first (hdiutil convert -format UDRW image.iso -o output.dmg).
The bootloader file, typically renamed ‘booter’, aka BootX (the CHRP PPC Open Firmware Mac OS X booter) or boot.efi (for x86 Macs), can be found on the install disc of your choice in the following places:
This file is what shows the initial Apple logo or Happy Mac while it loads the kernel & kextcache over the network (you’ll know the kernel is loaded successfully when you see the spinner or rainbow wheel).
Kernel & Kextcache
The OS X Kernel is /mach_kernel on your install disc. Copy this to your NetBoot image as ‘mach.macosx’. Similarly, the kernel cache will be found at /System/Library/Extensions.mkext, which you copy as ‘mach.macosx.mkext’. You may find you need or want to ‘lipo’ the specific architecture you want from both of these binaries to the corresponding subfolder.
Refer to the bootpd manpage for detailed instructions as to how to build this settings file. For reference, here’s the one I use for my Universal 10.5 image. ‘NFS’ seems to be the best supported Type for older versions of OS X, from what I’ve found. You must use a unique ‘Index’ for each image.
Once you have a properly-built image, have restarted your NetBoot server instance (toggle the switch in Mavericks Server), and have your target Mac connected via Ethernet, you should see a NetBoot icon if you hold alt/option while booting. At this point, you can select it and hold down the usual modifiers when booting (v for verbose, for instance).
Intel Macs support multiple NetBoot sources, with names, and modern devices will NetBoot happily over WiFi.
PowerPC Macs have certain limitations where NetBoot is involved; they seem to only show a single NetBoot disk, and do not show its name. This can cause problems if you have more than one ppc NetBoot volume, so you can either use a supported device model/MAC address whitelist or disable other PPC images. Typically they are only supported over Ethernet, and are far more finicky.
At the time of this writing, OS 9, 10.0 and 10.1 do not boot completely anymore. If this changes in the future, it’s worth noting the following:
10.0’s install disc does not have an Extensions.mkext. You can build one yourself using mkextcache on a machine (or VM) running 10.1.
Mac OS 9 NetBoot images are crafted in a different way (documented in the manpage!), but fortunately Apple still provides a pre-made image on its website. You can use the excellent Pacifist to extract its contents on a modern machine.
Earlier versions of OS X, like the Public Beta or Developer Previews have a very different disc layout, so they couldn’t be NetBooted in the same way anyway. That’s not to say it can’t be done… ;-)