Creating never booted images – 10.8 – InstaDMG

System_Image_Utility

I’m going to run through the process of creating a never booted image using InstaDMG on Mac OS X 10.8, Once this has been done it will be ready to deploy using Deploystudio.

First, you will need to ensure that you have the Command Line Tools installed, you can download them from the Apple Developer site

You will need to create an account, but you don’t need to sign up for any of the paid programs to gain access to the tools we need

Go here to register

developer.apple.com/programs/register/

Once registered, click on the link below, this will take you to the downloads page, where you can get the Command Line Tools, we are after the Command Line Tools for OS X Mountain Lion

Command Line Tools (OS X Mountain Lion) for Xcode – January 2013

it’s roughly 120MB download, once you have it, install the package and we can get started.

First, open Terminal, then enter the following, this will change to your home directory, create an InstaDMG folder, then move you into the newly created folder

cd ; mkdir InstaDMG ; cd InstaDMG

next you will need to download InstaDMG, you do this by entering the following command into Terminal

svn checkout http://instadmg.googlecode.com/svn/trunk .

this shouldn’t take long, if you already have InstaDMG installed from a while ago, then it will be worth updating it, you can do this by entering the following into Terminal

cd ~/InstaDMG/
svn update

Next, you need to move your copy of the 10.8 InstallESD.dmg file into the InstaDMG installer disc folder

You need to have the Install Mac OS X Mountain Lion app in /Applications, if you don’t then you need to download it from the Mac App Store

When you have it, open Terminal and enter the following

sudo cp /Applications/Install\ OS\ X\ Mountain\ Lion.app/Contents/SharedSupport/InstallESD.dmg ~/InstaDMG/InstallerFiles/InstallerDiscs/

Next you need to make a change to the catalog file (10.8_vanilla.catalog) located at

~/InstaDMG/AddOns/InstaUp2Date/CatalogFiles

At the time of writing this points to an older Java installation file which will cause errors when trying to create the image, so we need to edit this, open Terminal and enter the following

nano ~/InstaDMG/AddOns/InstaUp2Date/CatalogFiles/10.8_vanilla.catalog

delete this line

Java for OS X 2012-006  http://support.apple.com/downloads/DL1572/en_US/JavaForOSX.dmg  sha1:eff777cdc39b4e3336b3477f60e8ad769ded8532

replace with this line

Java for OS X 2013-002 http://support.apple.com/downloads/DL1572/en_US/JavaForOSX2013-002.dmg sha1:47e38cf089a6a7bba9e2b0b387fe09e2b77e10a6

make sure there are tabs rather than spaces between each line, otherwise it will error when trying to build the image

then press CTRL X

then Y

then ENTER

this saves the file and you shouldn’t encounter any problems

next we need to make the image, which is all done in Terminal, so enter the following

cd ~/InstaDMG/AddOns/InstaUp2Date/

sudo ./instaUp2Date.py -p 10.8_vanilla

this took around 30 minutes on a 2012 MacBook Pro, times will vary on different models, but this should give you a rough idea

Command Line – Text editing

There are a variety of text editors available to use via the command line on OS X, but I prefer to use nano, so here is a little tutorial on the basics of using this utility.

To use it, you will need to fire up Terminal

then to edit a file you will need to type nano and then the filename as below

nano filename

If the file exists already then it will open that, but if the file doesn’t exist then it will open a blank file with the specified filename.

If you are attempting to edit a system file then you will probably need to run it as an administrator, so if you are running in a regular user account you will need to do the following

su administrator

then enter the password for the administrator account, then type

sudo nano filename

you will then need to enter the administrator password again.

The commands above are relevant if you are currently in the directory of the file you wish to edit, if you aren’t then it’s probably easiest to enter the full path of file you wish to edit, such as

sudo nano /System/Library/Preferences/filename

Once you are in the editor then you can navigate using the arrow keys

To save a file press CTRL X at the same time

this should only be used for plain text files, nothing with formatting such as Microsoft Word documents as these will either show up with all the HTML tags or gibberish

For a full list of things you can do with nano type

man nano 

this will give you the manual for nano, to exit the manual just type  q

 

Spotlight – Enable/Disable

I’m a big fan of spotlight on a Mac, but there are those out there who aren’t, if you happen to be one of them then this next bit is for you, you can disable spotlight by doing the following

Open Terminal and type the following

sudo nano /etc/hostconfig

locate the following item

SPOTLIGHT=-YES-

Change it so it now reads

SPOTLIGHT=-NO-

Press CTRL-X, then press Y, then press ENTER to save the file

Now to disable indexing type the following into Terminal

sudo mdutil -i off /

to erase the current index type the following into Terminal

sudo mdutil -E /

And thats that, Spotlight is now disabled, but if you realise that you have made a terrible mistake then don’t despair, you can enable spotlight again by basically reversing the work you’ve just done

so, in Terminal type

sudo nano /etc/hostconfig

locate the following item

SPOTLIGHT=-NO-

Change it so it now reads

SPOTLIGHT=-YES-

Now to enable indexing type the following into Terminal

sudo mdutil -i on /

and there you have it, a fully working spotlight

Disable Bonjour advertising

As a security precaution I always disable Bonjour advertising on all macs on my network, please note that this will not stop Bonjour from working, but it will stop your macs from advertising their presence on your network.

Here is how to do it

Open a Terminal window

If you are logged in as an administrator then type the following:

sudo nano /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

you need to look for the following section

<array>
<string>/usr/sbin/mDNSResponder</string>
<string>-launchd</string>
</array>

now add the following string to the array

<string>-NoMulticastAdvertisements</string>

so the array should now look like this

<array>
<string>/usr/sbin/mDNSResponder</string>
<string>-launchd</string>
<string>-NoMulticastAdvertisements</string>
</array>

To save the file press CTRL-X

This will ask you if you wish to save, press Y for yes, and N for no

If you chose to save it then you will get a prompt about the save location, this will more than likely be the same place you opened the file from, in this example we want the file to stay in the same location, so just press ENTER to complete the save process

Reboot your machine and see if it shows up in Finder (on a different machine), if it does then you may have a spelling mistake in the additional line, reopen the file using the instructions above and check it over

As I said this will not disable Bonjour, so you will still be able to connect to Bonjour printers etc.

Enable Users to resume printers

If you are having an issue where your users printers keep on getting paused, then you will want to make use of the following solution

You will need to edit the cupsd.conf file, this is located in /etc/cups/

You will need to be in an admin account, or if in a users account then su into an admin account

Then open a Terminal and type the following

sudo nano /etc/cups/cupsd.conf

Now look for the following section

# All administration operations require an administrator to authenticate…
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>

Now comment this out or delete it, entirely up to you, but I prefer the to comment it out as a fall back option in the event of an error

Now add the following section just under the commented section

# Allow non-admin users to add printers
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
Require valid-user
Order allow, deny
Allow all
</Limit>

Now find the following section and comment it out

# All printer operations require a printer operator to authenticate…
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
AuthType Default
Require user @AUTHKEY(system.print.operator) @admin @lpadmin
Order deny,allow
</Limit>

Now add the following section under the commented section

# Allow non-admin users to pause and resume printers
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
Require valid-user
Order allow, deny
Allow all
</Limit>

Press CTRL-X, then press Y, then press ENTER to save the file
THIS KEY COMBINATION WILL OVERWRITE THE EXISTING CUPSD.CONF FILE!

Now log in to a user account, and test this by pausing a printer and trying to resume it, if all has been done correctly then this should resume the printer with no issues.