Using+DeployStudio+in+a+service+shop

=REQUIREMENTS=

1. A working Mac OS X Server 10.6 installation (this is possible with 10.5 Server, but some of the commands I'll be using are meant for 10.6 Server). The services necessary to be configured and running are AFP, NetBoot, NFS, and Software Update.

2. You'll need to have installed DeployStudio on your server. We used [|Wazmac's excellent guides] to get up and running. For this tutorial, though, only look at [|step #5 - Prepare Image Server]. Don't worry about images, we'll be creating those later.

3. You'll need four hard drives. They don't need to be large - all of them can be as small as 80 GB, except one will need to be at least 160 GB.

- Two of them will be for your deploy images. We're using an 80 GB drive and a 160 GB drive, both SATA (with enclosures that we use elsewhere when not building images).

- Two of them will be for your diagnostic NetBoot images. If you have external diagnostic HDs already, you can use those instead. They'll need to be running 10.4 (PowerPC) and 10.6, with all updates installed. 10.5 is not recommended, as older PowerPC Macs usually lack the necessary RAM.

4. Two Macs that can boot all of the operating systems we'll be supporting (10.4 PowerPC, 10.4 Intel, 10.5, and 10.6). We're using a MacBook (13-inch) and a Power Mac G4 tower (QuickSilver 800 MHz).

5. Install discs for iLife '06, iLife '08, and iLife '09. You'll also need discs for Mac OS X 10.4 (PowerPC), Mac OS X 10.5, and Mac OS X 10.6.

6. A Mac that shipped with Mac OS X 10.4 (Intel) and iLife '06, plus the original restore discs for that Mac. This is tricky - you can browse [|Apple's specs pages] to find a suitable Mac. You'll need to be able to erase that Mac's hard drive, or swap it out for another HD that you can erase.

7. A gigabit ethernet switch is highly, highly recommended. You can image over 10/100 ethernet, but it typically takes 30 minutes longer per restore.

Ready? Let's begin.

=Section 1 - Get your copy of 10.4 (Intel)=

As mentioned earlier, you'll need a Mac that shipped with 10.4 (Intel). Why is this? Apple didn't ship any standalone discs for 10.4 (Intel), so to make your image, you'll need to be a little clever.

1. Boot the Mac from the restore discs. Wipe the HD, and install all custom packages, languages, applications, etc.

2. Once the install is finished, create a user called 'service-temp'. Leave the password field blank. Once you're brought to the desktop, open and enter in this command:

code defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL http://Server.local:8088/index.sucatalog code

Be sure to change the URL to match your own server! Quit the Terminal, and run Software Update. Install all updates, rebooting as you're instructed. When you're out of updates, move on to the next step.

=Section 2 - Preparing your deploy images=

NOTE: For all installations, you'll want to install everything that's optional - you'll never know who needs what. This means all iDVD themes, all languages, X11, etc.

1. Grab your two hard drives for your deploy images (requirement #3), and connect each to the machines you've set aside for this task (requirement #4).

2. Partition them. For the PowerPC drive, create a single Apple Partiton Map partition, and name it:

10.4 - PowerPC - iLife '06

For the Intel drive, create 5 equal GUID partitions, and name them:

10.4 - Intel - iLife '06 10.4 - Intel - iLife '08 10.5 - Universal - iLife '08 10.5 - Universal - iLife '09 10.6 - Intel - iLife '09

All Macs that shipped with 10.4, 10.5, and 10.6 included these iLife versions - I researched this via Apple's specs pages, Wikipedia, and Mactracker. Before restoring a customer's machine, please make sure you're choosing the correct OS - DeployStudio will faithfully restore any OS to the hard drive, but that doesn't mean it'll run properly.

3. Using [|Carbon Copy Cloner] or Disk Utility, clone your 10.4 (Intel) installation from earlier to the empty 10.4 - Intel - iLife '06 and 10.4 - Intel - iLife '08 partitions.

4. Boot to the 10.4 - Intel - iLife '08 partition, and install iLife '08 from your disc on top of iLife '06. Install, then run Software Update. Again, here's the Terminal command for your Software Update server (change the URL to match your server):

code defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL http://Server.local:8088/index.sucatalog code

5. Insert your 10.4 disc in the PowerPC machine, and install onto the single 10.4 - PowerPC - iLife '06 partition. Remember, your user needs to be service-temp, and no password. Install iLife '06, too, then run Software Update (use the same command as step #4).

6. On the Intel machine, install 10.5 and 10.6 onto the appropriate partitions, as well as the various versions of iLife. Don't forget to install of the updates, too. Use these Terminal commands for setting a local Software Update server:

10.5
code defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL http://Server.local:8088/index-leopard.merged-1.sucatalog code

10.6
code defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL http://Server.local:8088/index-leopard-snowleopard.merged-1.sucatalog code

7. At this point, you should have two hard drives - one with a single partition, and one with 5 partitions. All of them should have clean Mac OS X installs, with no additional applications installed (except the appropriate copy of iLife), and a single service-temp user who has no password.

=Section 3 - Creating your images=

1. On each Mac's internal HD, install DeployStudio.

2. Launch the Runtime app (in ), login, and select the workflow "Create a master from a volume".

3. Pick your first partition, accept all of the default settings, and let it work. This will take some time! As each image is created, move on to the next partition.

4. Once you've created all of your images, shut down the machines and store these hard drives in a safe place. Your server will take some time to process the images for restoration, so don't be alarmed if they don't show up in your Masters folder (or in DeployStudio Admin) immediately.

5. Every few months, fire up each partition and install all available updates. Recreate your images, replacing the old ones. I typically wait for major Mac OS X releases, such as 10.6.1, 10.6.2, etc.

=Section 4 - Set up DepoyStudio for restoring=

1. On your administrator's machine (or the server), open DeployStudio Admin.

2. Switch to the Scripts section, and add these scripts:

Reset_10.4_to_Setup_Assistant.sh
code
 * 1) !/bin/sh

rm -R /Volumes/Macintosh\ HD/Library/Preferences/ rm -R /Volumes/Macintosh\ HD/Users/service-temp/ rm -R /Volumes/Macintosh\ HD/private/var/db/netinfo/local.nidb rm /Volumes/Macintosh\ HD/var/db/.AppleSetupDone code

Reset_10.5_to_Setup_Assistant.sh
code
 * 1) !/bin/sh

rm -R /Volumes/Macintosh\ HD/Library/Preferences/ rm -R /Volumes/Macintosh\ HD/Users/service-temp/ rm /Volumes/Macintosh\ HD/var/db/dslocal/nodes/Default/users/service-temp.plist rm /Volumes/Macintosh\ HD/var/db/.AppleSetupDone code

Reset_10.6_to_Setup_Assistant.sh
code
 * 1) !/bin/sh

rm -R /Volumes/Macintosh\ HD/Library/Preferences/ rm -R /Volumes/Macintosh\ HD/Users/service-temp/ rm /Volumes/Macintosh\ HD/var/db/dslocal/nodes/Default/users/service-temp.plist rm /Volumes/Macintosh\ HD/var/db/.AppleSetupDone code

Set_boot_drive_reboot.sh
code
 * 1) !/bin/sh

echo "" | sudo -S bless --mount /Volumes/Macintosh\ HD/ --setBoot osascript -e 'tell application "System Events" to restart' exit 0 code

3. Switch to the Workflows section, and create a new workflow. Call it 10.4 - Intel - iLife '06.

4. Add a Partition task. Make it look like this:



5. Now, add a Restore task, and make it look like this:



Be sure to select your 10.4 - Intel - iLife '06 image.

6. Now, add two Generic tasks. These are scripts! Make them look like these:



7. Save, then duplicate your new custom task so that you've got your original, plus 5 others. Rename them to read as follows:


 * Restore 10.4 - Intel - iLife '06
 * Restore 10.4 - Intel - iLife '08
 * Restore 10.4 - PowerPC - iLife '06
 * Restore 10.5 - Universal - iLife '08
 * Restore 10.5 - Universal - iLife '09
 * Restore 10.6 - Intel - iLife '09

Change each task to use the correct image, as well as reset script, description, and error message. Verify each workflow is accessible to your deploy user's group.

Note: You can automate every task, but I'd recommend against doing so - this can be very dangerous when imaging Macs with multiple hard drives.

=Section 5 - Creating your restoration system=

My understanding is that most service centers use external hard drives for diagnosing machines. We do, too - and have installed several useful third-party utilities for more in-depth troubleshooting.

For the purposes of this tutorial, we'll be utilizing two separate hard drives - one with 10.4 (PowerPC) installed, and the other with 10.6 installed. We'll then create NetBoot images of both hard drives.

1. First, connect each hard drive to the appropriate Mac. Install 10.4 (PowerPC) on one, and 10.6 on the other. Name the user 'diagnostic' and don't use a password. Install all Mac OS X updates, as well as any third party utilities you'd like to include.

Optionally, you could create a second user (we call ours 'admin') with a password, for ARD / Screen Sharing. Be sure to auto-login with your diagnostic user, though.

2. Install DeployStudio. Put the Runtime app in the dock.

3. Launch the Runtime app, login with your deploy user, and remember the password in the keychain. If you see your list of workflows, you're good - quit the app.

4. Boot from the internal HD, and install Server Admin Tools - available for download here:

[|Server Admin Tools 10.4.11] [|Server Admin Tools 10.6.3]

(if 10.6.4 is out by the time you're reading this, please find a newer copy instead)

5. Open System Image Utility (in ) on both machines, and create new NetBoot images from your diagnostic hard drives. I prefer the names 10.4 PowerPC Diagnostic and 10.6 Intel Diagnostic.

6. Copy your images to your server. Your images are likely kept in, unless you picked another drive.

7. Enable them via Server Admin. Check the 'Diskless' checkbox next to each image, and set the Intel image as your default.

=Section 6 - Testing=

1. Now, shut down each machine and disconnect your diagnostic hard drives. If you have a couple of spare hard drives, swap out each machine's boot drives for a hard drive you wouldn't mind erasing.

2. Boot up, holding down the N key - they should each boot to the correct diagnostic image. Should look exactly like your diagnostic hard drives, right?

3. Click the Runtime app in the dock. Click OK to give it admin permissions, and click the login button. See your workflows? Pick one, then click the 'play' button in the upper-left corner of the window. Step through your workflow, until the restoration process begins.

4. Once it's done, it should quickly run your two scripts, and reboot the machine. If you see the intro movie followed by the setup assistant screen, you've successfully imaged your first Mac! Huzzah!

=Section 7 - Maintenance and addendum=

Going forward, you'll want to rebuild your NetBoot images when a new Mac OS X version is released, when you want to update third-party utilities, or when you want to update to a new version of DeployStudio (as the version on your server needs to match your Runtime version).

You'll also want to update your deploy images as Apple releases new Mac OS X updates - as it takes about a day to do, I tend to wait for incremental updates (such as 10.6.1, 10.6.2, etc.) and do them all at once. For this, using the combo updaters seem to be best - you can download those separately from Apple's support downloads.

Hope this tutorial helps someone - and I want to extend many thanks to the developers of DeployStudio for making all of this possible. I've wanted to document this for a long time now, as it's saved us many hours of work.

Enjoy! If you have any questions or suggestions, please see [|the DeployStudio forums topic].

user:flammable