This is in response to TAUW article: Get the “out of the box” experience with an older Mac.

The above article is good, but the steps are limited to regenerating the Setup Assistant. The steps in the comments for deleting the user account are for Tiger (10.4.x) and do not work on Leopard (10.5.x), since Apple deprecated the NetInfo db.

Most people will never have to do this, but if you are selling/giving away your old machine (or like me, frequently set up new machines for new users), these are handy steps to create a nice, fresh out of the box new user experience, while still having updated and installed all the third party software requested.

Note: These steps assume that you have already installed the operating system and third party software, and run any software updates. These steps will not only reset the Setup Assistant, but will also delete the user accounts for any users you specify. This will, obviously, erase any data in those user accounts. Do not proceed unless you understand and want this.

First, restart in Single User mode and enable changes to the system.

1. Restart the computer holding down the Command and S keys during startup.
2. At the prompt type the following, then press enter/return:

mount -uw /
Next, reset the Setup Assistant.

3. Type the following, then press enter:

rm /private/var/db/.AppleSetupDone
Now, remove the user accounts from Directory Services.

4. Type the following, then press enter:

launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist

5. Type the following, then press enter:

ls /Users

6. Note the short name (username) of the user account(s). In these following steps we will be deleting all the users, one at a time, from Directory Services.
7. Type the following, then press enter (substitute the short name above for the username below):

dscl . -delete /Users/<username>

8. Repeat the above step for each user account.

Finally, delete the home folders for each user account

9. Type the following, then press enter:

rm -rf /Users/<username>

10. Repeat the above step for each user account.
11. Type the following, then press enter:

shutdown -h now
 

4 Responses to How to get the Out-Of-Box experience on OS X 10.5.x Leopard

  1. William says:

    Thank you! I appreciate the clear, step-by-step instructions, and the explanation of what each step does. I’ve seen several articles about resetting a Mac to the out-of-box experience, but many of them conflicted with each other, especially over the Netinfo/DirectoryServices step. Your steps worked great.

  2. JohnO says:

    Excellent post. Thanks for taking the time to document it so clearly.

  3. JohnO says:

    Two things:

    1) This also works fine in 10.6 Snow Leopard

    2) Looking at the single user boot prompt in 10.5 and 10.6 you might want to revise your step two to include both the full path to the executables, and do the disk check:

    /sbin/fsck -fy
    /sbin/mount -uw /

    Again, thanks for posting this information!

    John

  4. Mr_Kitty says:

    @JohnO – Thanks for replying.

    I thought I’d edited this to reflect that it was Snow Leopard compatible as well, I guess not. But yes, I’ve used this method several times on Snow Leopard of the last month. Works exactly the same.

    As far as the full paths, these *shouldn’t* be necessary. Unless the root account’s BASH profile has been tampered with/corrupted, it should be able to find all the commands in /sbin without a problem. IF the BASH profile has been affected, you’d probably want to know that before you hand off the machine to another user (if you did it intentionally, you should know that you’d need to prepend the /sbin/).

    In regards to the disk check (fsck)… this article is directed at prepping a machine for first run state, not repair of the disk. Myself, I always run disk utility and diskwarrior on the system after I’ve finished installing all the updates and third-party software, but these are all really outside of the scope I intended.