Debian Wheezy as Mavericks Time Machine Server

There are two Mac OSX boxes in my household.   I used a different mount point for each OSX Mavericks computer on separate RAID 1 volumes, though I could have used LVM mount points to allow the backup to “grow” nicely.

Installing Packages

The newer releases of OS X requires Netatalk 2.2.x+.    Mac OS X 10.9 “Mavericks” works great with the version of netatalk shipped with Debian 7.0 (Wheezy), the topic of this guide.

Run the following commands:

aptitude update
aptitude install netatalk avahi-daemon avahi-utils

Setting up Netatalk
Let’s do some configs…

Change your /etc/netatalk/AppleVolumes.default file to export the Time Machine volume. At the end of the file you’ll find a line that reads:

~/                     "Home Directory"

Comment out this line by adding a “#”, since we’ll later create a time machine user that will not have a home directory, and this may cause you to encounter an error.

#~/                     "Home Directory"

Then add another line below it:

/opt/timemachine "Time Machine" options:usedots,upriv,tm
  • /opt/timemachine is your backup folder.
  • “Time Machine” is the label to identify the Time Machine volume.

The rest of the line contains various parameters to allow the Mac to “play nice” with this server as a Time Machine target. It’s important to add the options:tm at the end of the line so that Netatalk enables various special options for Time Machine. You can also add fancy options to restrict access to users logging in with specified accounts.

The next config file is /etc/netatalk/afpd.conf. Comment the last line like this:

# - -tcp -noddp -uamlist uams_dhx.so,uams_dhx2.so -nosavepassword

…and add this:

- -tcp -noddp -uamlist uams_guest.so,uams_dhx.so,uams_dhx2.so

I am not sure if this command is actually needed for it to work, but it worked.

touch /opt/timemachine/.com.apple.timemachine.supported

Restart netatalk for the new configuration to take effect:

sudo service netatalk restart

For an additional layer of security I decided to create a dedicated user account that will only have access to the write to the backup folder. Time Machine will ask for this information on initial setup.

sudo useradd -s /bin/false timemachine
sudo passwd timemachine
sudo chown -R timemachine:timemachine /opt/timemachine

This takes care of the server side.

Client Setup
Now configure your OS X installation so it sees unsigned time machine volumes. Open the terminal app and execute the following command:

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

Published by J.W. Spencer

JW Spencer is the lead technical architect and developer at the Digital Dream Team. He has over 25 years of technical experience in private industry and government in support of development, management, project management, and executive technical leadership. JW has the unique ability to understand complex technical problems and synthesize viable solutions. A veteran of the USMC, JW took his undergraduate studies at Southwest Texas State University, with graduate work at Texas A&M and the University of Texas at Austin. "Always go to other people's funerals, otherwise they won't come to yours." - Yogi Berra

Join the Conversation

24 Comments

  1. You can omit ‘cnidscheme:dbd’ in the AppleVolumes.default file, as DBD is the default:

    /opt/timemachine “Time Machine” options:usedots,upriv,tm

    I had to alter afpd.conf like this (no ‘uams_guest.so’, no ‘-nosavepassword’ — the latter doesn’t allow the clients to save the password locally):

    – -tcp -noddp -uamlist uams_dhx.so,uams_dhx2.so

    I also did NOT need to set the TMShowUnsupportedNetworkVolumes setting on the client.

      1. With 10.9.1, I got afpd crash with internal error 11. After googling tried…
        “- -tcp -noddp -uamlist uams_guest.so,uams_dhx.so,uams_dhx2_passwd.so”

  2. Wonderful clear “how-to”, except I was getting Error 2 in Time Machine and some complaint in syslog about not being able to use the home directory until I commented out the line

    # ~/ “Home Directory”

    in /etc/netatalk/AppleVolumes.default.

    Now all seems to be working great! Thanks!

    1. Thanks for your comment Stephen. I guess I never received the error because I always comment out access to Home Directory. That makes sense, however, since the time machine user doesn’t have a home directory. I’ll add that little action above.

  3. Hi, I am rather new to debian. I have managed to configure the samba link up from my macbook running mavericks to a computer running debian. however, when I go to time machine preferences and try and select the debian drive i get an saying that I do not have the correct privileges to write to this drive. Can you imagine what might be wrong?

    1. Howdy Philip. I’m sorry, but Apple’s Time Machine will not work with Samba. Follow the instructions above to install netatalk on your debian machine (make sure that you’re running the latest stable Debian which is wheezy). If you meant to say that you’re running netatalk ( and not Samba) then make sure that you comment out the reference to home directory in the AppleVolumes.default file, set the user/group on the time machine directory to the correct user (the last step “chown” above). and restart netatalk and avahi on your debian box.

      Apple’s Time Machine has some very specific attributes that it writes to the target directory which Samba will not allow, and that’s likely why you’re getting an error.

      1. Thanks Jeffrey. All sorted. I now have an old netbook running debian tucked away doing my backups wirelessly without the £300+ price tag of the apple device. thanks so much.

  4. One more question, is it possible to allow netatalk to share more than one folder or drive. The situation is this. I have the line “/media/timemachine “Time Machine” options:usedots,upriv,tm” where timemachine is a dedicated usb hdd for doing my backups, and that is working fine. however, I would also like to share another usb drive on my home network so my flatmate and I can access music, movies etc. is it simply a case of entering another line below this one? I have tried that and it didn’t seem to work. this drive is at “/media/timemachine”

    1. Sure. I’ve done that. Leave off the “tm” option (you don’t need another timemachine mount), and make sure that you chown (ownership:group) the newly shared directory to a user that both you and your flatmate have access. Make sure that you restart netatalk and avahi so that they are visible on the network. You can add the new share by using “Finder > Go > Connect to Server” Then you would connect to it via “afp:/opt/mylibrary” (example) to the share. Login to your debian share with the user who has rights to use the folder.

  5. Hi nice tutorial,

    Sometimes when i must plug out the Macbook from the network during a Backup. Later when i replug it after a while i.e. a hour, i get the following error: “The backup disk image “/Volumes/Data/iMac.sparsebundle” is already in use”

    i can fix this issue by restarting the netatalk service after logging into the server! does anyone know another/better way to avoid/fix this kind of error?

  6. Excellent.
    This is the simplest tuto I’ve seen. It worked immediately on my Debian unstable and Mavericks
    Thanks very much

Leave a comment

Your email address will not be published. Required fields are marked *