Howto: Use Linux as a networked TimeMachine volume for your Mac

Today we are going to set up a proxmoxVE Ubuntu openVZ container to allow AFP connections from your Mac.

You will need proxmoxVE already installed, and a 64bit Ubuntu 10.10 openVZ template. I had to rename this image to something like ubuntu-10.10-server_x86_amd64.tar.gz in order to import it into proxmoxVE.

Create a new VM:

Type: container
Network Type: Bridged Ethernet (veth)

If you don’t use this type of network you will not have the benefits of the bonjour service.

Now start up the VM and then SSH into your new system.  We need to make sure we are up to date on everything, so go ahead and issue the following to upgrade anything that needs it:

apt-get update
apt-get upgrade

Now we can install netatalk

apt-get install netatalk

Next we will need to configure afpd.  Open the conf file in your favorite editor:

vi /etc/netatalk/afpd.conf

Comment out the line at the bottom, and add this at the bottom:

- -transall -uamlist uams_randnum.so,uams_dhx2.so -nosavepassword -advertise_ssh

Next we need to set up the volumes that we will share. Open this config file in your favorite editor:

vi /etc/netatalk/AppleVolumes.default

Comment out the default line at the bottom and add this, and put real users names instead of username1 and username2.  These users need to exist on the linux box. (use adduser to add them)

~/ "$u" allow:username1,username2 cnidscheme:dbd

Add a line like this for each user to allow them to have an individual TimeMachine mount point also:

/home/username/TimeMachine      TimeMachine allow:username1,username2 cnidscheme:dbd options:usedots,upriv

If you are using OS X Tiger or lower you will need to remove the options upriv from the end

Next we have to install and set up cracklib to allow the authentication to work correctly:

apt-get install cracklib2 cracklib-runtime wamerican
update-cracklib /var/cache/cracklib/cracklib_dict

Finally, you must restart netalk to get all of this working:

/etc/init.d/netatalk restart

At this point you could stop and click on the Go menu in the Finder, and select connect to server and put in your URI to the afp mount you’ve added, but there is one final step to configure bonjour services so your Macs will just “see” your new service instead of having to specify it for each connection.  We start with installing avahi and mdns:

apt-get install avahi-daemon libnss-mdns

Next we need to turn it on.  Again, with your favorite editor, open the conf file:

vi /etc/nsswitch.conf

And make the hosts line look like this:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns

Create the following file to put some specific configurations around the afpd service:

vi /etc/avahi/services/afpd.service

And add the following:

<?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>

The following models are acceptable and all this really does is change the icon on your Mac desktop when you mount the fielsystem.

  1. RackMac (same as Xserve)
  2. PowerBook
  3. PowerMac
  4. Macmini
  5. iMac
  6. MacBook
  7. MacBookPro
  8. MacBookAir
  9. MacPro
  10. AppleTV1,1
  11. AirPort

Now we need to restart avahi:

/etc/init.d/avahi-daemon restart

To add support for TimeMachine to each mac, you will need to issue to following on the terminal:

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

This allows the Mac to use this unsupported network volume as a TimeMachine volume.  I hope this helps someone out there, I found a few tutorials and none of them seemed to work out of the box, so I decided to post this one.

Innovative Engineer/Technologist: Innovatative app developer, systems architect, and project manager in a wide variety of technologies. I am particularly interested in learning about and creating new technology by looking at the 30,000 foot view to see how things can fit together in new and exciting ways. I started my career working at Internet Service Providers and moved into VoIP and Unified Messaging Applications. I currently work in the Switch Networking field. I am constantly looking at new technologies to enhance my own vision of technology as a whole. I consider myself to be of a new generation of Engineers that are able to use and understand technologies while still able to communicate and work with non-technical people.

Tagged with: , , ,
Posted in Technology
about.me
coLLin LeGault

coLLin LeGault

Your Personal Technology Consultant

Innovative Engineer/Technologist: Innovatative app developer, systems architect, and project manager in a wide variety of technologies. I am particularly interested in learning about and creating new technology by looking at the 30,000 foot view to see how things can fit together in new and exciting ways. I started my career working at Internet Service Providers and moved into VoIP and Unified Messaging Applications. I currently work in the Switch Networking field. I am constantly looking at new technologies to enhance my own vision of technology as a whole. I consider myself to be of a new generation of Engineers that are able to use and understand technologies while still able to communicate and work with non-technical people. Click the link below to contact me.