Enable Changes to be made to a live NetBoot Image.
Wouldn't it be great to to be able to have a NetBoot image that you can make changes to, and have those changes "picked up" by the clients on the next reboot. Currently the NetBoot tools provided by Apple only allow you to make a NetBoot image that is static, that is to say, once the image is created you have to create a new image to make any changes. (There are ways around that, but that's a different topic). It would be great to have the ability to create an image, put that image into production (have clients booted from it) and still be able to mount the image as root on the NetBoot Server and make changes, and once the image is unmounted from the desktop, the clients will "see" the changes on their next reboot.
Wow, that would be the best of both worlds, having a single image that all of your clients can boot, and still be able to add features, or fix problems even after it is baked into a NetBoot set.
There are some prerequisites:
1. You must be familiar with creating a NetBoot set
2. You must have root on the NetBoot Server
3. You must have the Apple Developer Tools installed on the Server (you will need the plist editor). (Not Mandatory, you can use a command line editor instead )
Well, it it not only possible, it's easier than you may think. You will have to get your hands dirty in the command line world, but I will outline how to do it.
1. Create a NetBoot set as you would normally do, using the tools provided by Apple
2. Log into the NetBoot Server as Root to work on the images
3. Open the Terminal and cd to the NetBoot set you just created (hint. Look in /Library/NetBoot/NetBootSP0/)
4. You should see a few files, The two we will be working with are:: NBImageInfo.plist and NetBoot.dmg
5. The first thing we would like to do is make a copy of the NetBoot Image, and convert it for our use by running the following:
cp NetBoot.dmg NetBoot.orig
hdiutil convert -format UDRW -o Netboot.rw.dmg Netboot.dmg
hdiutil convert -format UDSP -o NetBoot.sparse NetBoot.rw.dmg
hdiutil resize -size 100g NetBoot.sparse.sparseimage
Explained::
The first line simply makes a copy of our original as a backup.
The second line converts the image to read/write
The third line converts the read/write image to a sparse image (more flexible)
The fourth line adds some free space to the sparse image so we can make some changes and also this will allow the NetBoot clients to have room to do temporary installations and save temporary work to the NetBooted System Drive.
Once we have completed the above commands, we have all of the pieces we need to complete our task, but we need to tell the computer this. We do this by editing the NBImageInfo.plist file. This can be done in the Finder by simply double clicking on the file and it will open in the plist editor. (Or all of this can be done in the command line using vi) Once it is open edit the RootPath section, changing the Netboot.dmg to the newly created NetBoot.sparse.sparseimage, Close the file and enable the image as you would normally in the Server Admin Utility.
There you have it.
That image can now be opened in the Finder on the NetBoot Server and edited in real time.
This is a lot of power to have, so be very careful. You will either be able to save the day, or end it. Remember to always make a copy of the running image before making any changes so you always have something to put back if the changes fail.