graham gilbert

Mac administration and assorted nerdity

Run Munki at Boot

| Comments

Munki is great. It keeps your macs up to date - well it does most of the time. Sometimes you get a user that just refuses to click on “Update” now matter how many times it pops up. Now you have a tool to defeat them - install this package over ARD and munki will install everything that’s available, including Apple software updates (it will reboot the mac if needed and carry on where it left off).

I wish I could take credit for all this amazingness, but I just wrapped it up into a package. The source is over at GitHub, and there’s a pre built package as well.

Headless VirtualBox

| Comments

I recently had a requirement to run an Ununtu machine, but the client had only mac servers, and no budget for additional hardware. The solution turned out to be VirtualBox - we could run it headless and have it start when the mac booted.

First, get your VM set up how you like it and shut it down. I like to move my VMs out of the boot drive, so move the entire ~/VirtualBox VMs directory onto your storage device.

VirtualBox needs to know where the vm lives now, so remove the original vm you made, then double click the moved vbox file.

One last step - the launchd item to control the vm.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
  <string>com.yourcompany.mysupervm.plist</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/bin/VBoxHeadless</string>
    <string>-startvm</string>
    <string>The name of your VM</string>
  </array>
<key>KeepAlive</key>
<true/>
  <key>UserName</key>
  <string>admin</string>
  <key>WorkingDirectory</key>
  <string>/Volumes/Storage</string>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>

Change some “The name of your VM” to what your vm is actually called, change UserName to the admin username on the server, and finally change the WorkingDirectory path to match the location of your VirtualBox VMs directory.

Save the plist into /Library/LaunchDaemons/ as com.yourcompany.mysupervm.plist (or whatever you want) and chown it to root:wheel

To start the vm, crack open terminal and issue

sudo launchctl load /Library/LaunchDaemons/com.yourcompany.mysupervm.plist

And to stop:

sudo launchctl unload /Library/LaunchDaemons/com.yourcompany.mysupervm.plist

The vm will start at boot, and will continue to run, so to stop it, you need to unload the plist.

Profile Manager Enrollment Package

| Comments

Over the past week or so, we had a need to enroll macs automagically with a Lion Profile Manager server. My first plan was to do what Charles Edge did in his recent blog post and use DeployStudio. Then I remembered another post by Charles on /usr/bin/profiles and wondered if I could make a workflow that can be used throughout our deployment and system maintenance process - yup, the humble pkg, that can be popped into Munki for existing macs, installed with DeployStudio for imaging and pushed out with ARD if need be.

Get the code from GitHub

Assuming you’ve got The Luggage set up, first off you’ll need your enrollment and trust profiles:

  1. Create a new enrollment profile
  2. Give your enrollement profile a name
  3. Download the trust profile
  4. Download the enrollment profile

If your attachments auto open, click cancel when you’re asked if you want to install the profiles so they stay in ~/Downloads. Rename them to enroll.mobileconfig and trust.mobileconfig and pop them into the directory you cloned from GitHub. A quick make pkg and you’ve got your package .

Hello Octopress

| Comments

Inspired by some of the cool kids, I’ve spent the last couple of evenings migrating my blog over to Octopress. The main motivators were my desire to put my posts under version control (we’ve been going a bit nuts for Git at Pebble towers recently), and that I wanted to use the excellent Byword app to compose my posts (I just need to work out how I’m going to be able to use the iOS app to publish on the go - probably some Dropbox trickery).

Plus, using Ruby scripts and Rsync to publish the blog really appealed to my (not so) inner geek.

Anyway, normal mac-type sysadmin-y posts will resume shortly.

The Agony and Ecstasy of 100meg Broadband

| Comments

Before I descend into a massive rant, let me preface this post with this: I hate BT. I always have, and I probably always will. They are generally the most incompetent, uncooperative company on the planet.

Let me take you back to October 2011. I was perusing the BT website looking for BT Infinity - their brand name for up to 40meg VDSL. I popped in my postcode and was told that I was in a trial area for FTTP at a stonking 100meg. Obviously I thought about the pain I was letting myself in for, having to deal with BT, but I was sure that I could cope with it if I was getting such insanely fast Internet at the end of it.

If only I knew how painful it was going to be.