Ubuntu 12.04 + OSX Time Machine

I think I have covered this in an old post, but I just fixed some things that have been bugging me. The first referenced article at the bottom was a huge help in getting me started, but he has a lot of malformed xml tags. He also creates 3 files, which I've found you do not need, just create one.

Ok, first install netatalk and avahi.
sudo apt-get install netatalk avahi-daemon

Now let's create and edit our new avahi service
sudo nano /etc/avahi/services/afp.service

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
    <name replace-wildcards="yes">%h</name>
If you are running Samba on this server as well, you might want to change the <name> field. I have changed mine to <name>timelord</name>. This will allow your timemachine/apple shares to coexist on the same server (it will look like a different server in Finder though)
MM:MM:MM:MM:MM:MM should be the MAC address of your Ubuntu server. You can quickly find it by running the following command.
ifconfig -a | grep HWaddr
UUUU needs to be a unique UUID. Go to guidgen.com to generate a UUID. Now save the file, and let's move on.

Create some directories and a new user:
sudo mkdir -p /mnt/timemachine

sudo useradd -c "Time Machine User" -d /mnt/timemachine/ -s /bin/false -g 10 timemachine

sudo passwd timemachine

Set your timemachine share so it is supported:
sudo touch /mnt/timemachine/.com.apple.timemachine.supported

Set some ACLs:
sudo chown -R timemachine:users /mnt/timemachine

Next we move to setting up two files for netatalk:
sudo nano /etc/netatalk/afpd.conf

at the very bottom of the file, add:
- -tcp -nozeroconf
This tells netatalk to use tcp and not use zeroconf, if you don't use this then you will get two enties in Finder.

Configure your /etc/netatalk/AppleVolumes.default file:
# By default all users have access to their home directories.
#~/                      "Home Directory"
/mnt/timemachine "TimeMachine" allow:timemachine options:tm
# End of File

Now restart your services, and you should be done:
sudo service netatalk restart

sudo service avahi-daemon restart

Time Machine Server Requirements