Mac OS X,  Mac OS X Server,  Mass Deployment,  Network Infrastructure

Edit NetBoot Sets Without Creating New Images

Mac admins spend a lot of time building images. In System Image Utility this can mean baking an image that just looks for a path of a NetRestore source and restores an operating system. Constantly making these is a pretty duplicative task. The goal of this article is to take a generic NetRestore NetBoot image and augment it in such a way that you don’t need to create new NetBoot images unless there’s a new build train. Instead, all you need to do is edit a file that changes the path (uri) of your image so that it can be restored. Using this, you can just stop the NetInstall service in OS X Server, edit a file, start the service back up and boot clients into the NetBoot environment.

Screen Shot 2015-07-09 at 5.21.31 PM

When you make a NetBoot Set, you’ll select a source. This can be a local volume or a network volume. Once your NetBoot nbi is created, you’ll see a NetInstall.dmg. If you open that dmg, you’ll see a directory called Packages. If you open that, you’ll see an InstallPreferences.plist.

Let’s cat that real quick:

cat /Volumes/NetInstall/Packages/InstallPreferences.plist

The output would be as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>restoreList</key>
<array>
<dict>
<key>installRecoveryPartition</key>
<true/>
<key>restoreSourcesAllowManual</key>
<true/>
<key>restoreSourcesArray</key>
<array>
<dict>
<key>descriptionKey</key>
<string>Unicast Image</string>
<key>sourceKey</key>
<string>asr://test.krypted.com</string>
</dict>
</array>
<key>restoreSourcesBrowseMulticast</key>
<false/>
<key>restoreSourcesBrowseOthers</key>
<true/>
<key>retainOriginalVolumeName</key>
<true/>
<key>sourcePath</key>
<string>/System/Installation/Packages/System.dmg</string>
</dict>
</array>
</dict>
</plist>

Here, let’s look at a few specific keys that we can edit:

  • descriptionKey: A simple, human readable description of the image that will be installed
  • sourceKey: The URI to the image that asr will connect to in order to install the image
    sourcePath: This is the path to the dmg file within the nbi. This is usually best left untouched unless you’ve switched something around within the nbi (which I’ve only seen done a couple of times).
  • restoreSourcesBrowseMulticast: Set to true to allow for multicast imaging. Obviously, DeployStudio or asr would be used to make this work and you’d need to provide a multicast address.
  • installRecoveryPartition: Set this to false if you don’t want to install a recovery partition. You probably should be creating one.
  • restoreSourcesAllowManual: Allows for manual entry of an image source.
  • restoreSourcesBrowseOthers: Allows for browsing over Bonjour for an image source.
  • restoreSourcesArray: Not present if you chose a local path.

You can also edit the NBImageInfo.plist file to set some of the other items you might otherwise edit in System Image Utility. Here, you’ll need to covert the plist to xml to edit it:

plutil -convert xml1 /Volumes/NetBootSP/NetInstall\ OS\ X\ Yosemite.nbi/NBImageInfo.plist

In here, you’ll see a plist similar to the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Architectures</key>
<array>
<string>i386</string>
</array>
<key>BackwardCompatible</key>
<false/>
<key>BootFile</key>
<string>booter</string>
<key>Description</key>
<string></string>
<key>DisabledSystemIdentifiers</key>
<array>
<string>iMac10,1</string>
<string>iMac11,1</string>
<string>iMac11,2</string>
<string>iMac11,3</string>
<string>iMac12,1</string>
<string>iMac12,2</string>
<string>iMac13,1</string>
<string>iMac13,2</string>
<string>iMac13,3</string>
<string>iMac14,1</string>
<string>iMac14,2</string>
<string>iMac14,3</string>
<string>iMac14,4</string>
<string>iMac15,1</string>
<string>iMac7,1</string>
<string>iMac8,1</string>
<string>iMac9,1</string>
<string>Mac-50619A408DB004DA</string>
<string>Mac-F305150B0C7DEEEF</string>
<string>MacBook5,1</string>
<string>MacBook5,2</string>
<string>MacBook6,1</string>
<string>MacBook7,1</string>
<string>MacBook8,1</string>
<string>MacBookAir2,1</string>
<string>MacBookAir3,1</string>
<string>MacBookAir3,2</string>
<string>MacBookAir4,1</string>
<string>MacBookAir4,2</string>
<string>MacBookAir5,1</string>
<string>MacBookAir5,2</string>
<string>MacBookAir6,1</string>
<string>MacBookAir6,2</string>
<string>MacBookAir7,1</string>
<string>MacBookAir7,2</string>
<string>MacBookPro10,1</string>
<string>MacBookPro10,2</string>
<string>MacBookPro11,1</string>
<string>MacBookPro11,2</string>
<string>MacBookPro11,3</string>
<string>MacBookPro12,1</string>
<string>MacBookPro3,1</string>
<string>MacBookPro4,1</string>
<string>MacBookPro5,1</string>
<string>MacBookPro5,2</string>
<string>MacBookPro5,3</string>
<string>MacBookPro5,4</string>
<string>MacBookPro5,5</string>
<string>MacBookPro6,1</string>
<string>MacBookPro6,2</string>
<string>MacBookPro7,1</string>
<string>MacBookPro8,1</string>
<string>MacBookPro8,2</string>
<string>MacBookPro8,3</string>
<string>MacBookPro9,1</string>
<string>MacBookPro9,2</string>
<string>Macmini3,1</string>
<string>Macmini4,1</string>
<string>Macmini5,1</string>
<string>Macmini5,2</string>
<string>Macmini5,3</string>
<string>Macmini6,1</string>
<string>Macmini6,2</string>
<string>Macmini7,1</string>
<string>MacPro3,1</string>
<string>MacPro4,1</string>
<string>MacPro5,1</string>
<string>MacPro6,1</string>
<string>Xserve3,1</string>
</array>
<key>EnabledSystemIdentifiers</key>
<array/>
<key>Index</key>
<integer>2459</integer>
<key>IsDefault</key>
<false/>
<key>IsEnabled</key>
<true/>
<key>IsInstall</key>
<true/>
<key>Kind</key>
<integer>1</integer>
<key>Language</key>
<string>Default</string>
<key>Name</key>
<string>test</string>
<key>RootPath</key>
<string>NetInstall.dmg</string>
<key>SupportsDiskless</key>
<false/>
<key>Type</key>
<string>HTTP</string>
<key>imageType</key>
<string>netrestore</string>
<key>osVersion</key>
<string>10.10</string>
</dict>
</plist>

The important keys to look at here are:

  • SupportsDiskless: Switch this on and off if you want NetBoot to run for diskless systems (e.g. if you’re a 3 letter government agency).
  • Index: Typically use unique index IDs.
  • IsDefault: Makes that image the default image.
  • RootPath: The path to that NetInstall.dmg file from earlier.
  • ImageType: netrestore versus netinstall.
  • DisabledSystemIdentifiers: Disables certain models of Macs, which you’d edit by adding and removing items from that array.

So you can edit these files, and once you do so, you won’t need to be baking NetBoot sets all the time. Just when there’s a new build train of OS X and you can’t boot those new machines to NetBoot.

Enjoy.