Viewing entries tagged
yosemite

Dock Master - A Superior Profile Maker for Managing the Dock

410 Comments

Dock Master - A Superior Profile Maker for Managing the Dock

Recently I have been actively looking into the best solution for setting a custom dock on multiple machines.

Apple’s Profile Manager allows the creation of configuration profiles with dock settings. However, the functionality has some frustrating limitations:

  • There is no control over the order in which applications are displayed in the dock.

  • You can only add applications to Profile Manager if they are installed (note: can be dummy .app files) on the OS X Server host itself.

  • No home directory relative path support, therefore you cannot simply add a user’s Downloads folder to the dock.

The Search for Something Better

I tried Kyle Crawford’s dockutil command line tool and found it worked well for changing the dock of existing local accounts, but required scripting (LaunchAgent) to apply to newly created accounts.

I also had temperamental success in directly editing:
/System/Library/CoreServices/Dock.app/Contents/Resources/en.lproj/default.plist
/System/Library/CoreServices/Dock.app/Contents/Resources/com.apple.dockfixup.plist

After that I tried using Tim Sutton’s mcxToProfile script to convert ~/Library/Preferences/com.apple.dock.plist into a profile. Unfortunately home directory relative folders were broken using this technique.

Get To The Good Stuff

Over the past week I started working on a tool to make generating dock configuration profiles easy and include all the features missing from other tools.

The advantages of my solution (Dock Master) include:

  • Support for home directory relative paths (e.g. ~/Downloads).

  • The ability to include applications that are not installed.

  • Inclusion of network shares and website links with custom labels.

  • The ability to set folder attributes (sort by, display as and view content as).

Dock Master is an intuitive way to customise and generate dock profiles. To help you get started I have included some sample data commonly featured in education docks and an example of a directory, share and website that can be edited/removed as required. Once all the desired alterations have been made the profile is ready to be downloaded and distributed.

Removable Dock Items

A few people have contacted me asking if there’s way to deploy a custom dock with removable items. Unfortunately, configuration profiles do not allow for this. Dock Master now works around this limitation by creating a dock preference file that is added to the User Template (new user accounts) and optionally replaces the dock plist in existing user accounts.

Below you will notice a lock icon next to each dock item, unlocked items are removable by the end user. If one or more dock items are unlocked, Dock Master generates a tar file (compressed archive) instead of a configuration profile.

Once the tar file (archive) is extracted you will have a folder containing a ‘makepackage.command’ script. To build your custom package, simply right click the script and select Open.

The resulting package can be deployed just like any other package (e.g. Apple Remote Desktop, AutoDMG, DeployStudio, Munki, etc).

Name


Applications

Please provide the full path to the application (.app file).

Others (Folders/Shares/URLs/Weblocs)


Additional Options

Profile description:
Profile scope:
Prevent users from permanently modifying dock contents.
Merge with user's existing/default dock.
Add user's network home folder.
Maximum icon size (1-256):
Enable magnification. | Maximum magnification size (1-256):
Dock position:
Minimize windows using:
Apps animate (bounce) on open.
Automatically hide and show the dock.
Show indicators for open applications.
Minimise windows into app icon.
Create package instead of profile. | Package applies to existing users. | Package version:
Target macOS:

Do You Like Dock Master?

If you appreciate my work on Dock Master please consider making a donation. Dock Master has been a hobby project, I never developed it planning to make money (although my partner thinks I should) and I felt it was my way of contributing to the Mac Admin community. Donations help offset server hosting costs and access to resources.

 

FAQ

I have downloaded my fancy dock profile/package, how do I push it out to all my users?
There are several ways to distribute profiles and packages, I recommend simply importing them straight into Munki.

What happens if I want to change a Dock Master profile already installed on my clients?
Dock Master profiles use the dock name as the profile identifier, therefore if you use the same name the new dock profile will overwrite the old. Dock Master packages simply overwrite any prior installed Dock Master package.

Can I reorder dock items?
Yes, simply click and drag the ≡ sign to change the position of a dock item.

I still don’t get it, why would I use this?
It's free!!!

In education environments younger students find it difficult to find an application in Finder or the Launchpad, therefore having applications sitting in the dock allows students to independently access the applications they need.

This tool allows advanced customisation and quick generation of dock profiles that can be applied to different device groups (e.g. Art, Music, Junior School Macs).

And lastly because it's awesome!

Where can I find the source code?

I was surprised with the demand for Dock Master. Since its release I have rewritten Dock Master (originally PHP) into a native OS X Swift command-line tool for offline use. You can find the source code on GitHub here.

410 Comments

Munki Business - A Guide to Munki 2

4 Comments

Munki Business - A Guide to Munki 2

A lot has changed since my original post on Munki 1, with Munki 2 well and truly out I have taken the opportunity to write an updated guide on Munki 2.

What is Munki?

Munki is a community driven project created by Greg Neagle, allowing IT Administrators to efficiently deploy software to large numbers of Macs.

A Munki implementation can be broken down into two core parts;
a) repository hosted on a web server
b) bunch of clients running the Munki software
 

A Munki Repository

Since a Munki repository is simply a collection of organised files served out by a web server it can be hosted on any web server (e.g. IIS, Apache, etc.) regardless of platform. In the situation where the repository is hosted on a remote server, Administrators can remotely edit the repository over a network share.

Every Munki repository is comprised of the following four directories:
pkgs: All package (.pkg) and disk image (.dmg, .iso) files.

pkgsinfo: For each piece of software in the pkgs directory there is an associated file in pkgsinfo. These files contain detailed information about that piece of software and the catalog(s) that software is assigned to. Conventionally these pkgsinfo files have the .plist extension.

catalogs: Catalog files are generated from the contents of pkginfo files, they are used to separate production (tested) from development (untested) versions of software.

manifests: Clients are configured to download a particular manifest file. These manifest files contain a list of software to install and the catalog (version) to use.

Note: Apart from the contents of pkgs every other directory contains standard Extensible Markup Language (XML) files.

With the release of Munki 2, there are three additional directories:
artwork: A place to store any images used within software descriptions.

client_resources: Home to the Managed Software Center application theme files.

icons: Contains images (.png) used as software icons in the Managed Software Center application. The recommended icon resolution is 300x300.

Setting Up a Repository

The steps for setting up a Munki repository vary depending on web server and platform. For OS X the standard procedure involves creating a ‘munki_repo’ directory in ‘/Users/Shared/‘, populating it with the directories listed above. Then creating a symbolic link from ‘/Users/Shared/munki_repo’ to ‘/Library/Server/Web/Data/Sites/Default/’ and enabling the OS X Server web server.

Managing Munki Repositories

Download and install the latest release of Munki Tools here.

Part of Munki Tools are the Munki Admin Tools for command-line management of Munki repositories. Unless you enjoy working purely in the command-line, I recommend downloading Hannes Juutilainen’s MunkiAdmin, a user-friendly application for managing Munki repositories. 

Install AutoPkg

AutoPkg automates the process of downloading and importing third party software updates straight into the Munki repository. Look at setting up AutoPkg by following my guide here.

Manually Importing New Software

If you wish to manually import a piece of software here are the steps:

Before we can use the Munki Admin Tools we need to complete the initial setup. To start the setup open Terminal and type:

munkiimport --configure

The 'Repo fileshare URL' can be left blank if the Munki repository is stored on the local disk, otherwise provide a network share path (e.g. smb://SERVERADDRESS/munki_repo).

I recommend following the guidelines below, to keep your Munki repository tidy:
First rename the software you wish to import:

  • Match the name to the software (e.g. jre-7u67-macosx-x64.dmg > java.dmg).
  • Only use lowercase letters (e.g. Firefox 32.0.3.dmg > firefox.dmg).
  • Do not use dashes, underscores or spaces (e.g. Skype_6.19.0.452.dmg > skype.dmg).
  • Delete version numbers (e.g. vlc-2.1.5.dmg > vlc.dmg).
  • Omit the developer’s name (e.g. googlechrome.dmg > chrome.dmg).

Once renamed open Terminal and type ‘munkiimport ‘ (take note of the trailing space).
Drag the renamed package onto the Terminal window and hit return.
When prompted for an item name enter the name of the package without the extension (e.g. firefox.dmg > firefox).
The display name can contain spaces and capitals (e.g. Flash Player).
The description can be left blank for now, as it can be added in later with MunkiAdmin.
The version number is pulled from the software, verify it is accurate and hit return, otherwise type in the correct version number.
When prompted for a category, use the Mac App Store categories as a guide (e.g. Productivity, Utilities, etc).
Enter the developer’s name (e.g. Apple, Google, etc).
When prompted for Catalogs hit return.
You will be presented with a summary of your input, if you are happy that it is all correct type y and hit return.
Just hit return when asked for a subdirectory path.
Munki may offer to extract an icon, type y and hit return. 
You are given a chance to make any alterations to the newly generated pkginfo file, simply press control + X.
Lastly you are asked if you would like to rebuild catalogs, type y and hit return.

Assigning Software to Manifests

To put it simply manifests contain lists of software to install and the catalogs (software version) to use. Software can either be set as mandatory (managed_installs) or optional (optional_installs). Optional installs provide a self-service experience similar to the Mac App Store.

MunkiAdmin makes the process of assigning software to manifests simple, just add a new item under either the Installs tab (mandatory) or the Optional Installs tab.

As seen in the diagram below, every Mac installs a SOE (Standard Operating Environment) suite of software. Depending on the Mac’s location (e.g. Art, Music, etc.) and the intended user type (e.g. staff or student), additional software (e.g. Photoshop, Sibelius, etc.) is installed. Since Munki clients can only check a single manifest, I have dealt with this limitation by stacking manifests.

It may seem confusing at first, but once the manifest infrastructure is in place, assigning new software to all relevant clients is simple. The green bubbles are manifests that clients check and we normally avoid adding any software directly to these. Yellow are purely for merging manifests, again nothing should be added to these. Blue are core attributes (e.g. laptop, staff, science, etc.) and software is assigned to these.

Configuring Munki Clients

Once Munki Tools is installed, clients need to be configured with the Munki repository's address and which manifest to check. Often these settings are configured using DeployStudio, a payload-free package or another means of script execution. This can be performed manually in Terminal with:

defaults write /Library/Preferences/ManagedInstalls.plist SoftwareRepoURL http://SERVERADDRESS/munki_repo
defaults write /Library/Preferences/ManagedInstalls.plist ClientIdentifier MANIFESTNAME

Testing Software

Before pushing out software to every Munki client it is important to thoroughly test that it works as expected. You should configure at least one test machine the same way as the rest of your client’s with the exception of pointing it to a testing manifest.

A testing manifest should include both the development and production catalogs, as well as a manifest directly accessed by clients.

Once that piece of software has been deemed stable, add it to the production catalog and watch as the rest of your clients install it.

Frequently Asked Questions

If you have read this far, you should be starting to get an understanding of how useful and feature rich Munki is. For readability I have chosen to tackle common queries I receive regarding Munki.

How does Munki know what is already installed?
Any applications installed by simply dragging and dropping them into Applications are detected by Munki. If a user deletes a drag and drop app from Applications Munki will notice its absence and reinstall it.

With package files, Munki indirectly checks for the existence of receipt files, therefore deleting the associated .plist and .bom files of a package in /var/db/receipts will cause Munki to reinstall that package.

Managed Software Center keeps attempting to install the same package over and over. What’s going wrong?
If MSC loops on a package, compare the receipts listed in the pkginfo file to the receipts present in the '/var/db/receipts/' directory. Once you figure out the missing receipt(s) mark them as optional (ignored).

You can also use Terminal’s ‘pkgutil’ command to search for installed receipts. In the example below I am searching for receipts containing the word xerox, the (?i) part ignores case and .* are wildcards.

Can we customise the banners in Managed Software Center?
Absolutely! You can even customise the sidebar and footer links. The official Munki wiki does a great job covering this in detail here.

How frequently does Munki check for updates?
After ten seconds of inactivity at the login window Munki will automatically install any locally cached updates.

By default a launch daemon is set to run ‘/usr/local/munki/supervisor’ ten minutes past every hour. The supervisor generates a random delay of up to sixty minutes to help stagger clients contacting the Munki repository. Once the delay is over supervisor triggers ‘/usr/local/munki/managedsoftwareupdate’, if there are new updates the logged in user is notified by Managed Software Center.

Note: Munki is also capable of installing software without any user intervention. This is achieved  by enabling 'Unattended install' in MunkiAdmin.

Will Managed Software Center work outside of the organisation?
As long as the web server hosting the Munki repository is externally accessible MSC will also work externally. If you plan on hosting a Munki repository on a public web server you should also configure SSL Client Certificates to ensure access to the repository is limited to permitted clients. 

How can I remotely trigger Munki clients to check for updates?
Using Apple Remote Desktop you can trigger groups of Macs to instantly check the Munki repository for updates and install.

Trigger Munki instantly regardless of whether a user is logged in:

/usr/local/munki/managedsoftwareupdate;/usr/local/munki/managedsoftwareupdate --installonly

Trigger Munki to run the moment the current user logs out or if nobody is currently logged in:

touch /Users/Shared/.com.googlecode.munki.checkandinstallatstartup

Tip: You can save those commands as Unix command templates in ARD.

How do I go about troubleshooting a Munki issue?
Since the Munki repository is just a bunch of files served out by a web server, almost all troubleshooting is performed from Munki clients.

On a client open Terminal and run:

sudo managedsoftwareupdate

This will immediately display any issues with the repository. You can also check the client log files stored in ‘/Library/Managed Installs/Logs/‘.

How do we update the version of Munki Tools running on clients?
AutoPkg makes it easy to keep your Munki clients up-to-date with frequently updated software (e.g. Flash Player, Java, etc.). You can quickly set up AutoPkg by following my guide here. There is a munkitools2.munki.recipe override included in my collection of recipe overrides. This will automatically import the latest release of Munki Tools into your Munki repository, as four separate packages:
munkitools_core.pkg: The required core command-line tools used by Munki.
munkitools_admin.pkg: The optional admin command-line tools for managing Munki repositories.
munkitools_app.pkg: The user-friendly Managed Software Center application.
munkitools_launchd.pkg: The launchd items to automate checking for updates.

The only package that should be assigned to a manifest is the munkitools_app, the rest are either marked as ‘required’ or ‘update for’ packages that would be installed regardless.

4 Comments

Separating System and User Data with DeployStudio

2 Comments

Separating System and User Data with DeployStudio

Some end-users seem to find new ways to mess-up their computers, instead of spending a lengthy time trying to undo the damage, IT Staff can simply reimage a Mac with DeployStudio.

Placing the operating system (OS X & Applications) and user data (home directories) on separate partitions makes the process of restoring/upgrading the operating system even faster as there is no longer a need to migrate user data. 

Below I have listed the steps to configure DeployStudio to set up Macs with separate partitions for operating system and user data.

Setup

In DeployStudio create a new workflow titled ‘Partition’. The first item to add is a safeguard Alert task, followed by a Partition task. Allocate 80 GB to ‘System’ and the remaining space to the ‘Data’ partition. Also set ‘Target volume’ to ‘First disk available.’

Now edit your existing Reimage workflow. Before your ‘Restore’ task add a ‘Workflow’ task and set ‘Embed workflow’ to ‘Returned by script…’ and the script to ‘check_partitions.sh’. The check_partitions.sh script can be downloaded from here.

The check_partitions.sh script:

  • Skips partitioning if the System and Data partitions already exist.
  • Partitions the disk if neither System or Data partitions are found.
  • Aborts the DeployStudio workflow if only one of the partitions are found.

Under your ‘Restore’ task set the ‘Target volume’ to ‘System’ and ‘Rename volume’ to ‘System’.

After the ‘Restore’ task add a ‘Generic’ task, set the command to ‘redirect_users.sh’, check ‘Postponed execution’ and ‘Automate.’ The redirect_users.sh script can be downloaded from here.

The redirect_users.sh script:

  1. Removes the standard Users directory from the System partition. 
  2. Creates a symbolic link pointing Users to /Volumes/Data/Users.
  3. Recreates the /Users/Shared directory on the Data partition.

 

That’s it, happy reimaging!

 

Additional Information

Size Restriction
Unlike the standard single Macintosh HD partition layout, users are limited by the size of the Data partition. This can be an issue for small (<128 GB) MacBook Air SSDs. If your Macs are low on storage I recommend taking a look at this DeployStudio guide.

Always Backup
Although reimaging a machine with the above set up should not affect the Data partition you should always ensure your user has an up-to-date backup (e.g. Time Machine) beforehand.

No FileVault Support
Working mainly in school environments there has never been a demand for encrypting user data. Feedback from MacEnterprise.org members has brought to my attention that FileVault only encrypts the OS X partition (System) and not the Data partition. If you plan on using FileVault the only option is to keep everything on a single partition.

Missing Finder Icons
If a home directory path contains a symbolic link there is a bug in Finder where the pretty sidebar/home folder icons are missing. This issue occurs because we are using a symbolic link to redirect the Users directory.

To correct this issue OS X needs to be updated with the actual path to the user’s home directory. This can be done in System Preferences > Users & Groups, unlock the preferences and right click your user account > Advanced Options and update ‘Home directory,’ with the actual path (e.g. /Volumes/Data/Users/mpage).

This can also be achieved in Terminal with the ‘dscl' command by updating a user’s ‘NFSHomeDirectory’ attribute.

To automate this for school environments I have created a LaunchDaemon script, set to run on startup. This script updates all local user accounts with their actual home directory paths. You can download the script from here.

2 Comments

Creating a Bootable OS X/macOS USB Installer

Comment

Creating a Bootable OS X/macOS USB Installer

Since the release of Mac OS X 10.6 (Snow Leopard) I've carried around a bootable USB on my keychain. It has made my life a lot easier reinstalling OS X/macOS without an Internet connection and troubleshooting Macs without a recovery partition. I also much prefer clean installs of the operating system, using this method vs updating from a previous version of OS X/macOS.

This post will go through the process I use to create a bootable OS X/macOS installer.

 

Requirements

  • At least an 8GB USB, you can also use a FireWire or Thunderbolt drive.

  • A Mac running 10.6.8 (Snow Leopard) or newer.

  • A fast Internet connection to download the OS X/macOS installer.

 

Step 1: Download OS X/macOS

If you haven’t already you can download the desired Install macOS application from the Mac App Store. Here are some direct links:

Once it's downloaded the installer automatically opens, simply quit it.

OSXMavericksInstaller.png
InstallOSXQuit.png

Step 2: Prepare the USB

We are about to erase everything on the USB, make sure you have copied off anything you wish to keep. 

 

Open Disk Utility (/Applications/Utilities/Disk Utility), select your USB drive from the list and click the ‘Erase’ tab.

Set format to: Mac OS Extended (Journaled)

Set name to either: Mavericks, Yosemite, El Capitan, Sierra, High Sierra, Mojave, Catalina, Big Sur, Monterey

DiskUtility.png

 

Click ‘Erase...’ and 'Erase' again, then enter your password if required. 

Step 3: Copy over the files

Open Terminal  (/Applications/Utilities/Terminal) and paste the appropriate command.

For Mavericks (10.9):

sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Mavericks --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction

For Yosemite (10.10):

sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Yosemite --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction

For El Capitan (10.11):

sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/El\ Capitan --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction

For Sierra (10.12):

sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Sierra --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction

For High Sierra (10.13):

sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/High\ Sierra --applicationpath /Applications/Install\ macOS\ High\ Sierra.app --nointeraction

 For Mojave (10.14):

sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/Mojave --applicationpath /Applications/Install\ macOS\ Mojave.app --nointeraction --downloadassets

For Catalina (10.15):

sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/Catalina --nointeraction --downloadassets

For Big Sur (11):

sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/Big\ Sur --nointeraction --downloadassets

For Monterey (12):

sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/Monterey --nointeraction --downloadassets

Hit return, type in your password, then hit return again. Don’t worry if it looks like you are not typing anything, it's just Terminal hiding your password input for added security. Depending on your USB, the copy process takes approximately 20 minutes to finish.

 

That's it! You should now have a bootable OS X USB installer. Go test it out by plugging it into a Mac that is turned off, pressing the power button and then holding down the 'option' key.

I’d like to thank tywebb13  for sharing the above Terminal command on the MacRumors forums.

 

If you need any help feel free to leave a comment. 

Comment