Backing up VMware Fusion images

Thursday, May 16th, 2013

Traditionally, VMware Fusion has not supported using Time Machine to backup your virtual machines.  Although this changed with version 4, I’d rather not enable AutoProtect.  Instead, I use Carbon Copy Cloner to backup my ‘Virtual Machines’ folder to the root of my Time Machine drive.

Just one catch – if VMware Fusion is open during the copy, eventually CCC will fill up the destination drive, as it’s repeatedly copying data that’s in use.  The solution?  A preflight script that checks for the VMware Fusion process, and aborts the backup if the program is currently running.

The scripts are available in my GitHub repository.

Disable “Use this disk?” Time Machine prompt

Saturday, March 23rd, 2013

With a diagnostic OS, you’ll likely find yourself mounting many hard drives – either while NetBooted, or booted from an external hard drive.  If Time Machine is not enabled, it will offer to backup to any reasonably-sized hard drive connected to your machine.

To disable this, run this command in the Terminal:

defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool YES

This will prevent the Time Machine prompts from appearing.

Testing the built-in iSight camera

Friday, March 22nd, 2013

Sometimes, when building a diagnostic OS, you need to optimize for space – you might be trying to fit the OS onto a small USB flash drive, or you want to decrease NetBoot times.

Once you’ve thrown away the obvious culprits – thanks to something like GrandPerspective – you might decide to trash the contents of /System/Library/Compositions/.  I did.  Unfortunately, this will break Photo Booth.

We relied on Photo Booth to test the iSight camera, so I came up with an alternative. Save this script as an application and put it in the Dock.  Heck, I gave it the Photo Booth icon. It opens a new “movie recording” window in QuickTime Player, but it’s not actually recording.  Good for a quick test, and faster than Photo Booth.

Macworld / MacIT 2013

Monday, February 11th, 2013

This year, PSU generously offered to send me to a conference for the purposes of professional development. There are several Mac-centric conferences in existence at the moment: MacTech, Apple’s WorldWide Developers Conference (WWDC), The JAMF Nation User Conference (JNUC) and our own Penn State MacAdmins Conference. Although I’ll already be attending the Penn State Admins Conference this spring, I felt the MacIT Conference in San Francisco, California still had much to offer.

MacIT started when WWDC removed the IT portion of their conference to focus on iOS and Mac development. Although I attended two years ago on my own, I found that the conference had matured since I had last made the trip. The MacIT Conference runs parallel to the Macworld/iWorld Conference – while MacIT centers around deployment and management, Macworld/iWorld covers broader, typically more creative, topics.

I took the opportunity to visit San Francisco a few days early and use some vacation time – it was nice to have a break from the ice and snow, here in State College. I became familiar with the city, and got to meet up with friends. It was nice to have a few days to get settled before focusing on the conference.

My manager, Justin Elliott, encouraged me to attend one of the pre-conference workshops offered by MacIT. I decided upon an all-day session about Apple’s deployment solutions hosted by two members of the MacIT advisory board, Arek Dreyer and Kevin White. They covered 10.8 Mountain Lion Server, including Profile Manager. As someone who had little familiarity with OS X Server since 10.6 Snow Leopard, it was great to get up to speed with Apple’s best practices – and understand their limitations. Although we’re phasing out OS X Server, I believe profiles could be useful as we further adopt Tivoli Endpoint Manager for the Mac labs.

The first official day of the conference (and my second day in attendance), I learned a lot about FileVault 2 from Rich Trouton’s talk. Although he had given a similar talk at the Penn State MacAdmins Conference last May, he covered different deployment methods at MacIT – his talk at the JAMF Nation User Conference was customized for using JAMF’s Casper Suite, for example. In addition, a common theme was to incentivize your users to “do the right thing” – especially because, in most cases, it’s not possible to lock down an iOS device. Users can easily remove profiles from an iPad or iPhone, so your tactic needs to focus less on restricting the features of the device and more to help your users use the devices effectively.

There was a great session presented by Jody Rogers of Adobe, along with several other Adobe team members. They covered what the “Creative Cloud” means: they’re phasing out the large Creative Suite packages, and will offer application upgrades as they’re ready. A yearly subscription will ensure that users have access to the latest versions of Adobe’s creative applications. While people were apprehensive about this at first, Jody understood our concerns about deployment – after some discussion, I believe this will be a step forward. It was great to talk to the Adobe team, as well – they’re truly trying to move to Apple’s standard package format, which will help us greatly when deploying Adobe’s products.

I got to meet the TwoCanoes guys, as well – Tim Perfitt has emerged as an important figure within the Mac administration community, particularly with the revival of AFP548. He and his assistant, TJ Caracci, were great to talk to.

The next day, I attended a couple of great sessions about logging, given by Andrea Longo of Splunk. She even included some exercises with her slides, allowing anyone to learn from her talk, even without having attended the conference.

That evening, I met up with the folks from AFP548, which was fun. Derick Okihara spoke a little about iOS deployment (a huge theme this year), and we all talked about how to get involved with the Mac admin community – which mailing lists to join, how to behave in IRC, etc.

I decided to visit the expo floor for the first time the next day. I got to speak to someone from CrashPlan, which was really nice. I said hello to the friendly people of Other World Computing, then attended a session about repair presented by iFixit. I later met up with the iFixit guys at a Hackerspace called Noisebridge that evening. It was great! A hackerspace is a community area maintained by a group of people who want a workspace. They had a lot of tools and parts, and we had some great discussions. We got a tour, and I got to see their three 3D printers and robot!

The last day of the conference, I attended Mike Boylan and Nick McSpadden’s session on Mac management – they focused on Munki, DeployStudio, and InstaDMG. As I’d had no experience with Munki, it was nice to see the software in action. Andrea Longo offered to give a few of us a tour of TechShop, a commercial hackerspace. Although both Noisebridge and TechShop were founded by their respective communities, TechShop is considered a commercial venture. TechShop had some very impressive tools, but required you to pass a safety class to use each machine. They’re opening a TechShop in Pittsburgh soon – it sounds like it’d make a nice day trip in the spring.

As the conference had ended, I made a longer stop to the expo floor that day. I got to tell DriveSavers that I think they’re awesome, and went to tell AgileBits the same when I ran into Nadyne Richmond – she was requesting support for alternative sync services for 1Password. She encouraged me to speak next year about being new to this profession – we’ll see. I also met up with Nuance, and discussed our difficulties purchasing their products last summer – it was good to meet face-to-face with someone, considering the issues we had over the phone.

That night, I met up with Mike Boylan, Andrew Duszczyszyn, Tom Bridge, Joe Chilcote, and Ben Greisler. It was a perfect end to a great week!

I can’t put into words how appreciative I am that Penn State was willing to send me on this trip – I learned so much and was proud to represent the university. I’m not known for being adventurous with food, but I even expanded my palette over the course of this trip. Ever eat at an Irish pub that only served Indian food? I have.

I didn’t take nearly enough photos, but I posted some to my Twitter feed. Feel free to take a look!

I recommend this conference to anyone looking for an experience that compliments our own MacAdmins Conference – San Francisco is a very different city from State College, and the crowd that meets at Macworld is somewhat different than the crowd we see here in May.

Although it’ll be hard to top this year, I’m already looking forward to MacIT 2014!

Enabling and configuring NFS on OS X 10.7 and above

Sunday, January 6th, 2013

This weekend, I had a need to get NFS working on my Mac running 10.8.2 – though these instructions should work for any OS 10.7 and above.  My reasoning?  I have a WDTV Live, and found that streaming video through NFS adds less overhead than using (the excellent and free) PS3 Media Server.  Western Digital’s instructions are GUI-heavy and somewhat incomplete, though, so I decided to write my own.

To configure NFS, you’ll need to create a file in /etc/exports:

$ sudo pico /etc/exports

If the file doesn’t already exist, it should be empty.  This file contains your list of shares.  Here’s an example of a share from my machine:

/Users/mike/Downloads -ro -network 192.168.1.0 -mask 255.255.255.0

Breaking it down – first, you’ve got the path to the folder you want to share.  Next, it’s set so that anyone connecting has read-only access.  And finally, the two last sections detail the IP range that’s allowed to access shares on your NFS server.  There are many more options you can add – see this for a full listing:

$ man exports

Add one share per line.  Once you’re happy with your exports file, all you need to do is enable NFS:

$ sudo nfsd enable

This will start the NFS service and keep it running, even after a reboot.  You can also start and stop it on an as-needed basis:

$ sudo nfsd start
$ sudo nfsd stop

If you make changes to your exports file, you might need to restart the NFS daemon for your changes to take effect:

$ sudo nfsd restart

If you’d like to verify that your exports file is properly formatted, this will be useful:

$ nfsd checkexports

And finally, if NFS is running, you can get a listing of all of your shares (‘mounts’ in NFS terminology) via this:

$ showmount -e

Hope this is useful to someone!  If you’d prefer a GUI anyway, NFS Manager looks to be very well done.

Update: Allister (@Sacrilicious) suggests using the

$ exports

command to create the mounts, rather than editing the /etc/exports file directly.

Disabling Spotlight

Friday, January 4th, 2013

In some cases, Spotlight’s indexing becomes a nuisance at best, and a problem at worst.  A diagnostic OS can be used to repair or recover from a failing hard drive, for example, but Spotlight indexing can slow down the process (and lessen your chances of recovering data).

In Mac OS X 10.5 or later, luckily, it’s pretty simple to disable Spotlight.  In the Terminal, run this command:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

If you later change your mind, this command will reverse it:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Note that this disables Spotlight systemwide, not just on a per-HD basis.  Existing Spotlight indexes will be left untouched.

Scrolling switcher

Sunday, July 29th, 2012

Starting with 10.7 Lion, Apple switched the scrolling direction.  This can cause some confusion with people used to older Mac OS versions, or people coming from a Windows background.

I wanted to see if it were possible to allow people to toggle this, so I did some digging.  I found a script for trackpads on Super User, but it used GUI scripting.  I tried to get something working with the CLI (so I could use “do shell script” instead), but couldn’t find anything that worked. 

I also tried to detect the presence of a trackpad beforehand, but didn’t get too far with that.  Though most people don’t have a mouse and a trackpad connected at the same time (and expect to use both), changing the scrolling direction applies to both – at least in 10.8.

Update: both scripts are now on GitHub.

Video from Penn State MacAdmins Conference 2012

Tuesday, June 19th, 2012

I’m a little late on this (I blame the move!), but the video for all of the Penn State MacAdmins Conference presentations, including mine, have gone up on iTunes U and YouTube.  Enjoy!

Slides from Penn State MacAdmins Conference 2012

Sunday, May 6th, 2012

This year, I gave my first presentation at the Penn State MacAdmins Conference: Introduction to Mac Triage and Troubleshooting. Here’s the description:

In this session, we’ll go over the basics of component isolation and hardware/software troubleshooting. We’ll cover common fixes and methods for diagnosing a problem quickly and accurately.

The video should be available soon on iTunes U (I’ll post again when it’s up), but in the meantime, my slides are available here.

Allow admin users with no password to use sudo

Saturday, April 28th, 2012

Although Apple discourages it, users can create Mac OS X accounts without passwords.  Starting with Mac OS X 10.5, Apple prevented these types of accounts from being able to use ‘sudo’ via the command line.

Why might this be a problem?  In my case, I built a diagnostic OS (accessible via NetBoot) that sometimes needed this kind of access.  If I wanted to install MacPorts, for example.  The original reason was that I was required to get CopyCatX working in the diagnostic OS, but I really don’t want to come across as endorsing this product.

Anyway, the fix is pretty easy – you’ll need to edit the file /etc/sudoers.  Although it’s recommended that you use visudo (as it does sanity checks on the file), I tend to use TextWrangler.  Carefully.

Change the line that reads:

%admin ALL=(ALL) ALL

to say this instead:

%admin ALL=(ALL) NOPASSWD: ALL

(I’d recommend against copying and pasting – Bad Things can happen if this file is damaged.)

Save.  You may need to reboot, as well.