Home > Mac administration, Mac OS X, NetBoot > Building a NetBoot utility disk

Building a NetBoot utility disk

As part of providing support for the Macs in my shop, I build and use utility disks which contain useful utilities like DiskWarrior and Carbon Copy Cloner. My shop’s network supports NetBoot across subnets, so I also build NetBoot sets from the utility disks. The reasons I do this are the following:

  1. Having a utility disk available via NetBoot means I always have access to a utility disk when needed.
  2. The other members of my team also have access to the same utility disk when they need it.
  3. Nobody needs to carry around external drives with the utility software.
  4. Updates to the utility disk can be made in a centralized fashion.

For details on how I’m building NetBoot sets from utility disks, please see below the jump.

Pre-requisites:

  • System Image Utility
  • An already-built utility drive available on a hard drive with at least 30 GBs of free space.
  • A separate boot volume which is running the same OS version as the utility drive
  • Available local disk space to store the new NetBoot utility drive on during the creation process


Adding extra drive space for the NetBoot set:

To help make sure that there is available space on the NetBoot disk for copying files and for OS X’s memory swap, I prefer to add a large empty disk image to the utility drive which is acting as the template. This large empty disk image is included in the NetBoot disk as part of the creation process, then removed later and deleted.

The reason to do this is that otherwise the NetBoot disk will be created with only one or two gigabytes of available free space. Please see below for the procedure I’m using:

1. Open Disk Utility

2. Select the option to create a new blank disk image

Screen Shot 2016 05 18 at 9 23 23 AM

3. Set the size as desired (I normally set it to 30 GBs.)

Screen Shot 2016 05 18 at 9 24 36 AM

4. Save to a convenient location on the utility drive

Screen Shot 2016 05 18 at 9 26 29 AM

Creating the NetBoot set:

1. On the boot volume, launch System Image Utility

Screen Shot 2016 05 18 at 9 27 04 AM

2. Select the utility drive and click the Next button.

Screen Shot 2016 05 18 at 9 28 19 AM

Screen Shot 2016 05 18 at 9 28 54 AM

3. Set the network disk image type as NetBoot Image then click the Next button.

Screen Shot 2016 05 18 at 9 29 04 AM

4. Click the Agree button in the Software License Agreement window.

Screen Shot 2016 05 18 at 9 29 16 AM

5. In the Add Configuration Profiles, Packages and Post-Install Scripts window, make no changes and click the Next button.

Screen Shot 2016 05 18 at 9 29 29 AM

6. In the System Configuration window, make no changes then click the Next button.

Screen Shot 2016 05 18 at 9 29 37 AM

7. In the Directory Servers window, make no changes and click the Next button.

Screen Shot 2016 05 18 at 9 29 46 AM

8. In the Image Settings window, enter the Network Disk: and Description: settings as desired and also enable the following settings:

Select how you want to assign an image number. You can assign a random number, which generates a value from 1 – 4096 or you can manually assign a number. If you choose to have the image served from multiple NetInstall servers, the number generated will be from 4097 – 65535.

Screen Shot 2016 05 18 at 9 29 53 AM

I use the following settings when creating NetBoot utility disks:

  • Assign a random image index
  • Image will be served from multiple servers

Once all settings have been set, click the Next button.

Screen Shot 2016 05 18 at 9 30 27 AM

9. In the Supported Computer Models window, make no changes and click the Next button.

Screen Shot 2016 05 18 at 9 38 43 AM

10. In the Filter Clients by MAC address window, make no changes and click the Next button.

Screen Shot 2016 05 18 at 9 38 46 AM

11. When prompted, enter a desired name for the NetBoot set and save where convenient.

Screen Shot 2016 05 18 at 9 38 59 AM

12. When prompted, authorize creation of the NetBoot set by entering an administrator’s username and password.

Screen Shot 2016 05 18 at 9 39 24 AM

13. The NetBoot set will be created and saved.

Screen Shot 2016 05 18 at 9 40 09 AM

Screen Shot 2016 05 18 at 9 40 20 AM

Screen Shot 2016 05 18 at 9 40 39 AM

14. When the process has completed, click the Done button.

Screen Shot 2016 05 18 at 11 20 51 AM

Removing blank disk image from the NetBoot set:

To make sure the NetBoot set has sufficient free space, the blank disk image now needs to be removed. Please see below for the procedure I’m using:

1. Disconnect the utility drive.

Note: The reason for this step is that the NetBoot drive will have the same drive name and disconnecting the utility drive will help avoid confusion.

2. Double-click on the NetBoot set’s NetBoot.dmg file to mount the disk image.

3. Once mounted, navigate to where the blank disk image is stored and delete the disk image.

Screen Shot 2016 05 18 at 11 22 45 AM

Screen Shot 2016 05 18 at 11 22 54 AM

4. Unmount the disk image.

Compressing the NetBoot set:

To save space on the NetBoot server, my next step is to take the NetBoot set’s NetBoot.dmg file and convert it from a read/write disk image to a read-only compressed disk image. This conversion will shrink the size of the NetBoot.dmg file, but will not reduce the available free space of the NetBoot disk when it’s being used to boot over the network.

1. Move the NetBoot set’s NetBoot.dmg file outside of the NetBoot set folder.

Screen Shot 2016 05 18 at 11 23 55 AM

2. Convert the disk image to Compressed format and save the compressed image into the NetBoot set folder.

Screen Shot 2016 05 18 at 11 24 21 AM

Screen Shot 2016 05 18 at 11 25 14 AM

Once the NetBoot set’s NetBoot.dmg file has been converted to a read-only compressed disk image, it is ready to be posted to the NetBoot server.

Screen Shot 2016 05 18 at 12 36 13 PM

Enabling the NetBoot set for use:

1. Copy the NetBoot set to your NetBoot server

2. Add it to where you host NetBoot sets (this will likely be /Library/NetBoot/NetBootSP0, but you may have NetBoot sets stored on an alternate drive.)

3. Open Server.app and select NetInstall

Screen Shot 2016 05 18 at 12 45 19 PM


4. Select the NetBoot set, then click the gear icon.

Screen Shot 2016 05 18 at 12 45 26 PM

5. In the gear icon’s menu, select Edit Image Settings…

Screen Shot 2016 05 18 at 12 45 38 PM


6. In the settings window, select the following:

  • Make available over NFS
  • Make this image available for diskless booting

When the settings have been set, click the OK button.

Screen Shot 2016 05 18 at 12 46 17 PM

Testing the NetBoot set:

Boot a couple of Macs from the new NetBoot set to verify that it is working properly.

  1. May 18, 2016 at 9:48 pm

    Thoughts:

    – Instead of using a disk image perhaps mkfile could be used to create the padding?

    mkfile 30g “/Volumes/El Capitan Utility Disk/Users/Shared/padding”

    – It’s possible to convert a NBI dmg from read/write (UDRW) to a sparse image (UDSP), increase the “size” of the sparse image, and boot from that. The only catches are that the sparse image needs to be “.dmg” to be usable for NetBoot and needs to be named to “.sparse image” if you want to edit it. Then there doesn’t need to be quite the overhead handling the padding file.

    Starting with the SIU-output dmg:

    #Change RW image to sparse (UDRW -> UDSP)
    hdiutil convert -format UDSP /path/to/NetBoot.dmg -o /path/to/NetBoot-udsp.dmg

    #Resize image to add an additional 10GB
    #Which is ((10*1024^3)/512)=20971520 in 512 byte sectors
    #Probably should be using hdiutil -plist, will use it if this breaks
    currentSectors=`hdiutil resize -limits /path/to/NetBoot-udsp.dmg.sparseimage | tail -n 1 | awk ‘{ print $2 }’`
    newSectors=$(expr $currentSectors + 20971520)
    hdiutil resize -sectors $newSectors /path/to/NetBoot-udsp.dmg.sparseimage

    #Rename UDSP image
    rm /path/to/NetBoot.dmg
    mv /path/to/NetBoot-udsp.dmg.sparseimage /path/to/NetBoot.dmg

  2. Michael Pestritto
    September 16, 2016 at 3:50 am

    This may seem elementary but do you make a utility drive?

  3. Apizz
    December 9, 2016 at 6:51 pm

    Maybe I’m thinking about this incorrectly, but I thought in order to make a Netboot-able image that will work across different Mac hardware was to create a never-booted image with a tool like AutoDMG? When I built my non-Netboot Utility Disk and following your steps (along with the additional padding) turned it into a Netboot it caused a kernel panic when I booted from a different Mac than I used originally to build my Utility Disk.

    In subsequent attempts to rebuild the Netboot to make some changes (setting preferences, adding additional software, configuring the Dock, etc.) I haven’t gotten my Netboot to work since.

    Do you have (or know where I can find) steps for making a never-booted Utility Disk image?

    Should I try restoring a base AutoDMG image to an external drive and install my software and other packages into that so I can make my Netboot Utility Disk?

    Thanks in advance!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: