Cheap Time Capsule alternative using Ubuntu 12.10

Why spent $260 for Time Capsule, when You can make Your Ubuntu to act exactly the same? Here is how to do this.

First we’re gonna install couple of things that we need for further setup:

sudo apt-get install avahi-daemon libavahi-client-dev libdb5.3-dev \
db-util db5.3-util libgcrypt11 libgcrypt11-dev

Then download the latest version of Netatalk – Open Source AFP fileserver. We’ll use netatalk 3.* because its much easier to setup as Time Capsule. Because the latest version in repositories is 2.2.* we’ll have to compile it by ourselves.

tar xvjf netatalk-3.*.tar.bz2
cd netatalk-3.*
./configure --with-init-style=debian --with-zeroconf
make
sudo make install

When everything is installed it’s time to do some configuration. First we’ll create a dir when we we’ll store all time machine backups.

sudo mkdir /media/Time-Machine/

Then we’ll add new user called timemachine, who will own this directory

sudo adduser timemachine
# here comes some data that You'll have to fill up
sudo chown -R timemachine. /media/Time-Machine

Now we’re ready to edit /usr/local/etc/afp.conf

;
; Netatalk 3.x configuration file
;

[Global]
; Global server settings

uam list = uams_guest.so, uams_dhx.so, uams_dhx2.so,

; [Homes]
; basedir regex = /xxxx

; [My AFP Volume]
; path = /path/to/volume

[Time Machine MediaPC]

path = /media/Time-Machine
time machine = yes

Then it’s time to configure avahi-daemon which will propagate our Time Capsule over the local network.
Let’s create /etc/avahi/services/afpd.service

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
    <name replace-wildcards="yes">TimeCapsule %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>

So let’s start everything

sudo service netatalk start
sudo service avahi-daemon start

# to ensure that netatalk will start on boot
sudo update-rc.d netatalk defaults

Now You can enjoy your fresh Time Capsule alternative for the cost of HDD :)

This guide should also work for Raspberry Pi, XBMCbuntu, Debian 6.

Advertisements

2 thoughts on “Cheap Time Capsule alternative using Ubuntu 12.10

  1. grant says:

    Love this, I had it in Xubuntu 13.04 before I switched over to Kali-Linux… I just re-did it for this machine (and of course it works,) but I ran into this error when trying to set it to start on boot:

    xxxxx@threeve:~/Desktop/netatalk-3.0.3$ sudo update-rc.d netatalk defaultupdate-rc.d: using dependency based boot sequencing
    usage: update-rc.d [-n] [-f] remove
    update-rc.d [-n] defaults [NN | SS KK]
    update-rc.d [-n] start|stop NN runlvl [runlvl] […] .
    update-rc.d [-n] disable|enable [S|2|3|4|5]
    -n: not really
    -f: force

    The disable|enable API is not stable and might change in the future.
    xxxxx@threeve:~/Desktop/netatalk-3.0.3$ sudo update-rc.d netatalk start
    update-rc.d: using dependency based boot sequencing
    Use of uninitialized value in string eq at /usr/sbin/debian-update-rc.d line 490.
    update-rc.d: warning: start runlevel arguments (none) do not match netatalk Default-Start values (2 3 4 5)
    update-rc.d: warning: stop runlevel arguments (none) do not match netatalk Default-Stop values (1)
    xxxxx@threeve:~/Desktop/netatalk-3.0.3$

    Just wondering what run level we need to set it for?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s