- Configuring Netatalk
- Configuring Avahi
- Configuring your Mac
There are a number of ways to get Time Machine to backup to a Linux, and while theoretically it is possible to use a Samba share, the best way to do it is to setup Linux (in this case Ubuntu 9.04) to work as a Mac server to OS X.
This guide will walk you through, step-by-step, to install the open-source implementation of the Apple Filing Protocol (AFP), which is what allows Macs (or in this case other UNIX-like OS) to share services across a network.
This guide uses the Command-line based text editor nano. If you would prefer to use another editor (such as vim) simply replace nano with your chosen editor in the given commands. Alternatively, if you are running the Desktop version of Ubuntu 9.04, it might be easiest to replace nano with gedit, a graphical based text editor.
After you are finished editing each file with nano, you must save your changes with Control+X. You must use the control key, even if you are remotely editing (via ssh or similar service) on a Mac.
It is recommended that before following the setup in the rest of the guide, that you run these commands to ensure that your Ubuntu installation is up-to-date. NOTE: Everything after the ‘#’ is a comment, and does not need to be copied into the Terminal.
Installing AFP on Ubuntu (or any other UNIX-like OS) requires one basic open-source package (plus other prerequisite packages):
- Netatalk - contains the actual implementation of AFP
- Avahi – broadcasts server’s presence across LAN to allow OS X to access them
These commands to install the proper packages (requires internet connection):
Once all of the needed packages are installed, you will need to configure Netatalk to work properly. Run:
Scroll to the bottom of the file and under the “# Set which aemons to run (papd is dependent upon atalkd):” change your configuration to match the following:
These commands will prevent unneeded services from starting at boot, causing your machine to boot much quicker.
Next open afpd.conf,
and append the following line to the end of the file:
Finally, you will need to tell Netatalk what to share as a Volume. Open up the AppleVolumes.default file with
Comment out all lines (put a '#' at the beginning of the line) and add this to the end of the file (if the volume you want to share is /media/backup and the username you want to use with Time Machine is gries818):
Additional lines can be added to give access to different folders on the Ubuntu machine.
Restart netatalk with:
Netatalk can be used without any further configuration, but in order to get the server in the "Shared" section in the Finder window, you need to configure Avahi (which is basically an open implementation of Apple's Bonjour service).
First, edit nsswitch.conf with
and add mdns to the end of the line that starts with "hosts:".
Next, will need to create a new file for Avahi so it knows what services to broadcasts to the Macs on your network.
And copy this xml data into the file:
This will make your server display itself as a MacPro, but you can make it display as any type of a Mac you want by substituting the model=MacPro with the desired model:
Now, simply restart Avahi to make Finder aware of the new services available on your Ubuntu machine.
Configuring your Mac
Finally, to use TimeMachine with your Ubuntu setup you need to override the default TimeMachine settings on your Mac. Open up the Terminal (/Applications/Utilities/Terminal.app) and type:
Your new Shared Volume will now available in the TimeMachine disk selection.
If you have any problems with this tutorial be sure to ask... not every setup will yield the same results. Additionally, this should work with any Linux OS, provide you make adjustments for the different package managers (apt is Ubuntu's package manager).