Background

I have an old MacBook Pro 5,5, from 2009, which used to be my main work laptop, but which got replaced by a newer MacBook Pro a couple of years ago. Once I was sure that the new laptop was working fine I had planned to reinstall the old laptop with a newer OS than the OS X 10.6 (Snow Leopard) that it came with -- but somehow never got around to doing so.

Recently I decided that the best solution would be to reinstall the laptop and turn it into an OS X Server (now called "macOS Server": on Wikipedia), with a couple of external drives for storage. In particular I wanted to use it as a network Time Machine backup server. (There are alternatives to using OS X Server to achieve network backups, but they are a bit clunky, effectively involving manually making a sparsebundle volume-in-a-file for Time Machine and telling Time Machine to back up into that, after telling Time Machine to use "unsupported" drives, which may not be very reliable; the money for macOS Server and built in integration seemed worth the increased certainty that it would continue to be supported, and hopefully better integration with laptops that come and go from the network. This article on Time Machine to a drive on another Mac lists some of the pitfalls of the DIY approach.)

A MacBook might not seem the obvious server, but (a) I already had it spare, and (b) the battery is an advantage as a "built in UPS". Plus the 2009 MacBook Pro actually has a built in Gigabit Ethernet adapter, which is handy for a server. On the down side, the older MacBook has only USB 2 (and Firewire) external drive connections, so it will not be the fastest server -- but my main existing external drive is also USB 2 connected (via the Apple Thunderbolt Display, which has only Thunderbolt and USB 2), so the speed differences should not be too significant.

macOS Server is now an "Application" on in the Apple App Store, rather than separate hardware (see also macOS Server support information; and macOS Server Feedback page). The Ars Technica review of OS X Server for OS X Yosemite gives a good flavour of what is provided now (their post on OS X Server for OS X El Capitan is much smaller); see also the MacWorld review of OS X Server for OS X Yosemite.

Most of the features are not directly relevant to my use case (home/small business, with separate servers for other features) at present, but even the NZ$30 price tag (unlike the US$20 or UKP 13 price tag overseas) seems acceptable for the convenience of automatic network Time Machine backups, and easy configuration of file share -- and some of the other features may be useful later.

As of September 2016, macOS Server (5.2) now requires "OS X 10.11.6 or later" -- which is OS X El Capitan, or the newly released macOS Sierra (released September 2016). I am hopeful that it will at least continue to support OS X 10.11 (El Capitan) through until Apple ceases support for that as a client operating system (presumably somewhere around 2018).

Since the OS X El Capitan supported hardware included my old MacBook Pro 5,5 (Mid-2009), and the macOS Sierra supported hardware did not, the decision for which version to install was pretty simple -- OS X 10.11, El Capitan. It also helped that I had recently set up OS X 10.11 El Capitan to my tastes on a MacBook Air for travel, so I knew what would need tweaking and about the software/hardware compatibility.

Preparing to upgrade from OS X 10.6 to OS X 10.11

Upgrading from OS X 10.6 (Snow Leopard) to OS X 10.11 (El Capitan) is relatively simple, but has a few catches -- particularly if you actually want to do a fresh install, to completely repurpose the hardware, as I did.

OS X 10.11 (El Capitan) is distributed via the Mac App Store. When you install the (free) "Install OS X El Capitan" application, it installs and automatically launches the application to begin an in-place upgrade. If you want to do a fresh install, as I did, you should quit out of the installer at that point, so that you can make separate bootable install media.

The process to make bootable install media, is fairly simple, with one significant catch for upgrading from OS X 10.6 direct to OS X 10.11 -- the tool to create the bootable install media will not run on OS X 10.6 (it apparently needs OS X 10.7 or higher). So I ended up running this step on my MacBook Air which was running OS X 10.11 already.

To make the bootable install media:

  • Obtain an 8GB or larger USB drive, that you can completely overwrite

  • Use Disk Utility to repartion the USB drive, with a GUID Partition Map (so that it can be bootable), and one partition, called "ElCapInstaller" in the instructions below (the installer changes it later).

  • In a Terminal, run this command to create a bootable install disk:

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

    which can be on a single line, leaving out the trailing backslashes (just split up for the blog post)

As mentioned above, on OS X 10.6 (Snow Leopard) this will fail with an error:

Failed to start erase of disk due to error (-9999, 0).
A error occurred erasing the disk

But it worked fine on an OS X 10.11 (El Capitan) system, and in theory it should work fine on anything from OS X 10.7 onwards. (I just copied the whole /Applications/Install OS X El Capitan application folder from one system to another, and then ran it -- rather than download it a second time.)

The other thing I found out, during the install, was that about 15 minutes into the install the installer will get into a very long loop looking for a couple of fonts:

before eventually giving up (after about 30 minutes) and auto-restarting (which then continues the install without interaction). The error message is the installer log is along the lines of "TSplicedFont failed creating descriptor for ...", repeated over and over again.

Several reports suggest downloading and installing all of the Google Noto Fonts onto the bootable install disk, as a work around. From what I saw in theory it would be sufficient to download and install the above two (but I did not verify this by reattempting the install, because by the time I got that far the installer had got to a point where it finished non-interactively).

To install those fonts:

  • Download NotoSansBuhid and NotoSansHanunoo

  • Mount the USB drive with the installer on it

  • Go to System/Library on the USB drive

  • Make a "Fonts" directory: mkdir Fonts

  • Go into the Fonts directory, and unpack the two zip files with the fonts, ensuring the .ttf files of the fonts go into that Fonts directory directly (unzipping while in that directory should be sufficient).

(Possibly other fonts are also required; if I do another install and find more missing I will update this list.)

Doing an OS X 10.11 fresh install

Once the bootable USB installer drive is created (as above), running a fresh install is fairly simple:

  • Ensure the USB drive you prepared above is plugged in

  • Power on, or reboot, the MacBook

  • Hold down the Option key while powering on/rebooting (ideally from before the boot chime through until the Startup Manager screen appears).

  • From the options choose "Install OS X EL Capitan" to boot (ie, the USB drive you prepared earlier)

Once it is booted, you get a menu of four options.

If you want to do fresh install, then you need to go into the Disk Utility, and erase the hard drive. That will give you a choice of a quick erase ("Fastest") and a more secure erase ("Most Secure"), which controls how long the process takes (effectively choosing between 0, 1, 3, and 7 times overwriting the disk). Obviously if you are choosing to erase the disk you would want to be certain that nothing is required from the disk (or that you have several really good backups); in my case because I had hardly used the laptop for a couple of years, and migrated everything that mattered to a new laptop a couple of years previously, it was a fairly easy to just make a final backup for safe keeping and then be sure it was ready to be erased.

After your disk is ready for the install, then quit out of Disk Utility, and choose the Installer from the menu. It will ask you where you want to install, and you choose the Macintosh HD, and navigate through to running the install.

The installer itself ran fairly smoothly, until the progress bar got stuck on "about a second remaining" for a long time, which seems to be a commonly encountered problem with a fresh install. After waiting several minutes, I looked at the Installer Log (Window -> Installer Log), and found the "TSplicedFont failed" errors mentioned above; in theory pre-isntalling some missing fonts on the Installer USB drive would avoid that.

In my case, as I was finishing researching the font problem and ready to update the installer drive with the extra fonts, the Installer rebooted the system -- and the installer launched again in an non-interactive mode which finished the install. Presumably that is why some people reported that if they left it alone for a few hours it automatically finished.

After the installer finished that second pass, the MacBook automatically rebooted -- and presented the usual "new Mac" series of questions to start the configuration.

General OS X 10.11 setup

After the install I went through some of my general OS X 10.11 configuration steps including:

  • Setting the system hostname and computer name

    sudo scutil --set HostName ${HOSTNAME}.${DOMAIN}
    sudo scutil --set ComputerName ${HOSTNAME}.${DOMAIN}
    sudo scutil --set LocalHostName ${HOSTNAME}
    
  • Changing the power management settings (so it did not sleep automatically)

  • Configuring the Keyboard, Trackpad, Dock, Terminal, etc, to make the system seem familiar

To make remote management easier, I also turned on:

  • Remote Login (ie, the ssh server): System Preferences -> Sharing -> Remote Login.

  • Remote Management (ie console sharing, etc): System Preferences -> Sharing -> Remote Management; and use the "Options..." to tweak what remote users can do (I turned most of them on, for this "in a spare room" server usage).

To connect to the server console:

  • In Finder, choose: Go -> Network (Shift-Command-K)

  • Find the server hostname in the list

  • Double click on the hostname to look at that server

  • Click on "Share Screen..." in the top right, and enter the login credentials for the remote system

The remote console should appear, and if the screen saver was running then you will also be prompted for the screen saver password. After that interaction is similar to being at the console -- and if you look at the "server" console it will also show the same thing (ie, it genuinely is a share of the actual login).

The macOS Server application itself allows for remote admininistration of the macOS Server functionality, which may also be useful -- essentially by installing the Server Application on more than one machine, and chosing Manage -> Connect to Server on the client machine.

Unfortunately that will not be immediately useful to me as my main "desktop" machine is still running OS X 10.9 - Mavericks -- at least until I get to a point where I update the remaining (paid) applications to versions that support OS X 10.11, and then upgrade the OS. That will need to be sometime soon since OS X Mavericks will apparently no longer receive patches (the last one seems to be July 2016, compared with September 2016 for later OS X versions).

Software is not listed on Apple's Vintage and Obsolete Products page, and Apple's OS X Mavericks Support page does not say, but it appears Apple are limiting their support to three OS releases -- which are now 10.10/Yosemite, 10.11/El Capitan, and 10.11/Sierra. Some application vendors (eg, Adobe) are definitely limiting the supported OS X versions, and some businesses have told their users that OS X 10.9/Mavericks will be blocked from their network starting 2016-12-01, due to being unsupported; apparently OS X 10.9/Mavericks and 10.10/Yosemite are no longer available for new "purchase", only for re-download if you already "purchased" them.

Preparing for Time Machine backups

On a system with macOS Server, there are two sets of Time Machine backups:

  1. The backups of the client machines on the network which are handled through the macOS Server application "Time Machine" feature.

  2. The backups of the server machine itself, which are handled through the local Time Machine preferences, in the usual way for any other Mac (plus any clones, etc, you might want to make).

A very useful video on how the OS X Server Time Machine feature works, describes this difference (and a followup video gives some options to back up the OS X Server host machine itself). This Peachpit article on using the Time Machine server option recommends dedicating a drive to the macOS Server Time Machine network service.

In my case I wanted to use a single physical external drive for both sets of Time Machine backups (ie, the local and client ones), because the MacBook can have only two physical USB drives directly attached (due to having only two USB ports), and I wanted to use the second port for a separate "shared data" drive.

To prevent the two sets of Time Machine backups from stepping on each other, I decided to put them in separate disk partitions, thus giving them fixed amounts of space to use. So I created:

  • A tm_local partition, which is large enough for Time Machine for the macOS Server host system (approximately 1.5-2 times the internal drive size of the host system); and

  • A tm_network partition taking the remainder of the drive, for the client backups.

Having created the tm_local partition, I then told OS X to use that as the local backup drive (for the server machine itself) as usual, through the local System Preferences -> Time Machine. I let the first local backup (250GB -- taking several hours) complete before carrying on with setting up macOS Server for remote backups. (Make sure to put tm_local and tm_network in the Spotlight Privacy tab, so that they are not indexed, as that will save some time during the backup.)

Left out above are the backups of the "shared data" drive (the second attached drive), for which there is not space (because the "shared drive" and the time machine drive are basically the same size). Instead, at least for now, I have decided simply to back up the shared drive content separately (using git-annex, rsync, etc) -- and consider it just a convenient online copy of what is already on various external drives for which I already manage separate backups periodically.

Eventually I might get a larger drive to be the Time Machine drive, and then use that to back up everything including the "shared data" drive.

Install macOS Server

To install macOS Server:

  • Make sure your ComputerName, HostName and LocalHostName are set correctly (above) (unfortunately there is no automatic verification until after you have installed macOS Server :-( )

  • Purchase macOS Server on the Apple App Store (NZ$29.99); after purchase it will take a couple of minutes to download.

  • Open /Applications/Server.app

  • Click on "Continue" to set up macOS Server on the local Mac (rather than use that application to manage a remote macOS Server)

  • Agree to the terms (optionally deselecting "use Apple Services to check Internet reachability")

  • Enter credentials of an administration account, to confirm the installation

  • macOS Server will be set up, with a series of progress screens indicating what has been set up.

After the setup completes, check the DNS and computer host names match (it is part of the Server.app so is not available until the server Application is installed), by starting a new Terminal window (so that it gets an updated $PATH):

sudo changeip -checkhostname

and ideally that will tell you:

dirserv:success = "success"

If not, you may need to ensure that the DNS entries have been set up for your intended server, and/or that you specified the name correctly.

Note that this (unfortunately :-( ) cannot be run before setting up macOS Server on the local machine, even with a full path:

sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/changeip -checkhostname

beause changeip is simply a thin Python wrapper around:

sudo /Applications/Server.app/Contents/ServerRoot/serveradmin command dirserv:command=checkHostName

which in turn will report a (verbose!) dirserv error message indicating that dirserv is not available, including the text:

dirserv:errorDescription = "unable to find requersted module"

(complete with the misspelling of "requested" -- with an extra "r" -- which is surprisingly hard to find on the Internet). The only solution appears to be to check carefully by hand, and run the command afterwards -- which is unfortunate as the macOS Server setup definitely creates a bunch of certificates using the already set names, during its setup process.

Configuring macOS Server

By default most features in macOS Server default to off, which is good.

The basic Server configuration can be done by selecting your server at the top of the Server panel, and then choosing amongst the Overview, Settings, Storage and Access tabs.

The main thing that you probably want to change is the Access -> Default Network Access, to restrict it to only your local network. To do that choose "only some networks", and then "+" to add your local network range (and remove "Private Networks"). You may also want to change "Default User Access" from "all users" -- but in my case the server will have only users that should have access.

To use the individual server features, you need to select them from the list on the left hand side, and then turn them on with the large on/off "switch" at the top right after you have configured it.

Time Machine Server

To configure the Time Machine Server:

  • Click on the "+" under "Backup Destinations"

  • Next to "Store Backups in:" click on "Choose...", and then choose the tm_network external drive partition set aside (above) for the backups (ie, "Store Backups In: /Volumes/tm_network")

  • Optionally choose to limit the size of the backups per host, to avoid them dominating the entire drive. I chose to set a limit of about 2/3rds of the tm_network partition size, because I have two hosts to back up, but the larger one will see the most changes and has the most important data to be able to have more retrieval options so I am okay with it dominating most of the drive. (Incidentally it turns out you can also limit the size of local Time Machine backups if needed.)

  • Click on the "Create" button to save the Backup Destinations settings

  • It may tell you it needs to "Disable Ignore Ownership on this Volume" (which is a default setting on external drives); if so choose "Disable" to turn off that setting.

  • The backup location will change to /Volumes/tm_network/Shared Items/Backups (complete with embedded space :-( ) and the settings will be saved.

  • Optionally change the permissions for users that can access the system

  • Turn on the service at the on/off switch (top right)

  • After it starts, you should get told "Macs on your local network can back up to..."

You will also notice that the File Sharing service has been turned on to share that backup location (as I understand it the older Time Machine network backups rely on AFP file sharing; newer ones may possibly be using SMB file sharing; both get turned on) .

Time Machine Clients

Each client machine then needs to be configured for network backups. The first backup will be a full backup (entire hard drive) which will take quite a while. If at all possible connect the system via ethernet cable direct to the same switch as the macOS Server machine, to reduce the transfer time (and avoid saturating your Wifi for a long period; the first backup will take many hours). Ideally use Gigabit Ethernet if you can. (ETA, 2016-09-27: the largest client machine -- 512GB -- took about 24 hours to do the first backup, over 100Mbps ethernet; it was 80% done in the first 12 hours overnight, but changed data due to active computer use during the day meant the goal posts kept moving further forward so it only efficiently finished by closing all the applications at the end of the work day and leaving it to do the "last 10%" without more changes being added. Theoritical maximum rate on 100Mbps ethernet is around 35GB/hour, and active use of a machine that changes parts of large files -- so the whole file gets backed up again -- can cause half that much to be added to the backup target each hour...)

On the client machine:

  • Go to System Preferences -> Time Machine

  • Turn on the Time Machine function if it is not already on

  • Scroll down to "Add or Remove Backup Disk", and click on that

  • From the list choose "Backups on YOURSERVER"

  • Optionally tick "Encrypt Backups"

  • Click on "Use Disk"

  • Enter your credentials for the macOS Server so that you can connect to make backups

  • If you are encrypting the backups, then choose the encryption password for the backups, and enter it twice (I choose to use the same password as for the local system backups, since it is protecting the same data).

  • The "Backups on YOURSERVER" will show as "waiting to complete the first backup"; if you have disconnected the local backup drives and go to the Time Machine icon and choose "Backup Now" that should force the full backup to start to the server.

As noted above, the initial backup will take hours. Leave it running while you do something else and/or go away/to sleep. I started with my smallest (client) system to verify the process, leaving my larger systems to run by themselves separately.

During the backup you should be able to see both:

  • The normal Time Machine progress information on the client (under the Time Machine icon, and also in the System Preferences -> Time Machine pane); and

  • Details of the backups on the macOS Server, in the Time Machine -> Backups pane (eg, "Backup in progress" and the space used).

On the client machine, during the backup, you will also see both a mount of the share from the network host on /Volumes/Backups, and also a mount of the "sparsebundle" inside that which has the actual per-machine backup (mounted on /Volumes/Time Machine Backups, complete with the embedded spaces). The /Volumes/Backups has some hidden files to prompt Time Machine to consider the disk and configure it to use the disk, as well as one .sparsebundle file per machine (named MACHINE.sparsebundle). The /Volumes/Time Machine Backups has a Backups.backupdb directory, with a directory for the machine inside that, like a "normal" (local) Time Machine Backup.

Modern OS X/macOS can maintain multiple Time Machine backups, so it is entirely possible to set this up along side local Time Machine backup disks (on OS X 10.9/Mavericks you have to reassure it that you want to "Use Both"; from memory on OS X 10.11/El Capitan it just assumes that, but I did already have multiple Time Machine disks configured on my OS X El Capitan machine). Backups will go alternately to the configured disks, as they are available.

I plan to do that (local and network backups) for the immediate future (ie, until there is a decent history of backups built up on the Time Machine server). Eventually I will probably move to using an occassionally connected local disk as an additional Time Machine backup, but using the Time Machine Server for the main backups with a detailed history of files to retrieve.