Build a Netatalk Time Capsule for OSX Lion 10.7 using Debian 6.0 Squeeze

December 25, 2011 by · 20 Comments 

Time Capsule
After going to the Apple Store with a friend and seeing the $300+ Apple Time Capsule I decided to see if I could do the same thing with Netatalk. Turns out I could but if you’re using Debian stable like me you need to get at netatalk 2.2.x before it’ll work with OSX Lion 10.7.x. After seeing a variety of other examples out there on the net and getting a little confused as to why they were doing certain things I decided to just post how I did it. Also, rather than install things from source I like to use debian packages to keep servers clean. But there was a small problem due to a netatalk make bug that debian’s package didn’t account for. So I will post those packages I backported to stable for this.

Packages


Debian 6.0 (Squeeze) AMD64

Debian 6.0 (Squeeze) i386

Netatalk Time Capsule Server Setup


After you’ve installed the packages create a service group by creating /etc/avahi/services/afpd.service and adding the contents below: (this might not be necessary with netatalk 2.2)

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">%h</name>
  <service>
    <type>_afpovertcp._tcp</type>
    <port>548</port>
  </service>
  <service>
    <type>_device-info._tcp</type>
    <port>0</port>
    <txt-record>model=Xserve</txt-record>
  </service>
</service-group>

Make a directory to store your time machine data:

root@srv:$ mkdir /var/timemachine

Now mark the volume saying it is a supported time machine share:

root@srv:$ touch /var/timemachine/.com.apple.timemachine.supported

Define a volume in /etc/netatalk/AppleVolumes.default with the allowed user, usedots to support hidden files, uprivs for afp3 privileges that osx lion needs, and tm to enable time machine support. (highlighted below)

# By default all users have access to their home directories.
~/                      "Home Directory"
/var/timemachine         TimeMachine allow:joe cnidscheme:dbd options:usedots,upriv,tm

Now that things are configured we need to restart avahi.

root@srv:$ /etc/init.d/avahi-daemon restart

And restart netatalk

root@srv:$ /etc/init.d/netatalk restart

Apple OSX 10.7.x Lion Setup


Now set your OSX installation so it sees unsigned time machine volumes.

joe@osx:$ defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

You should now see your volume in Time Machine Preferences under “Select Disk…”.

About mike

  • Fred

    Hi,

    I’d be interested in what you had to do to make the Netatalk package.

  • http://www.google.com Will

    I love the article, please check out `kremalicious`’s article from ’08. You two had very similar ideas!.

    http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/

  • mike

    Its the normal upstream package sources from debian but they need to have libacl1-dev added to build-depends otherwise you won’t get ACL support. So if you want to make your own you could rebuild theirs with that installed and you’d end up with the same thing I posted here.

  • Chris

    A gui interface on each computer would make this awesome.

  • Jon

    What did you use for hardware? Existing server or did you get a small atom based machine?

  • mike

    I had an existing debian server that I used.

  • Roman Shtylman

    It is important that the user you want to backup as has read and write permissions on the server folder (/var/timemachine in the example). Otherwise you will see a message along the lines of “User does not have read/write permissions. Contact system administrator” in OSx when you try to configure time machine.

  • Pingback: Two apples in a pod and those other guys » Blog Archive » Debian AFP server for OS X Lion

  • Pingback: Build your own Time Capsule with Debian, Netatalk - Macgasm

  • Pingback: Build your own Time Capsule with Debian, Netatalk | ALL DIGITAL WORLD

  • Pingback: LATEST TECHNOLOGY » Build your own Time Capsule with Debian, Netatalk » LATEST TECHNOLOGY

  • Niels Zomer

    Can you also build a cheap pc to do this? would like to try this out.

  • Pingback: Build your own Time Capsule with Debian, Netatalk « Khaled rambles

  • mike

    Sure, mine is running on an old Pentium D.

  • http://www.mikepalmer.net/ Mike Palmer

    Sure, mine is running on an old Pentium D.

  • Pingback: Create a ‘Time Capsule’ using Squeeze | 0ddn1x: tricks with *nix

  • Thomas Woinke

    Hi,
    I’m trying to build debian/ubuntu packages from netatalk sources myself. But I run into issues with an include being in libc-dev as well. Is that the make bug you are writing about? Or what did you do to build your packages?

  • http://www.mikepalmer.net/ Mike Palmer

    No, mine are unaltered sources from debian:

    http://packages.debian.org/source/sid/netatalk

    What I posted were binaries built against squeeze with one exception. Make sure you have libacl1-dev installed since that package isn’t listed in build-depends.

  • Ellis Johns

    Great instructions. I ended following your instructions almost exactly, and it was one of the most painless installs/configs I’ve done. Thanks for the help. Only change was a missing library (libcrack2) that was easily installed with aptitude.
    E

  • http://www.mikepalmer.net/ Mike Palmer

    You’re right, I forgot to say anything about installing those package dependencies. Usually I dpkg -i a package like this then immediately apt-get -f upgrade whatever dependencies it squawks about. (same thing aptitude, synaptic, etc all do) I do that because I like to avoid marking packages as manually installed in case I remove netatalk down the road and want to apt-get autoremove the remaining cruft.

    A full list of the the netatalk dependencies are here if interested:
    http://packages.debian.org/sid/netatalk