Daniel Groves

Show Nav

AFP Goodness between OS X Lion and Ubuntu 11.10

Published: 19 January 2012

The process behind making Ubuntu share files with Mac OS Lion using the AFP protocol.

I’ve been working on assembling a private media and backup server for use with my Mac. In order to do this I needed to have AFP working between OS X and Ubuntu, as this is the protocol required by Time Machine for network backup servers.

In order to set everything up I was following a guide by Matthias Kretschmann. This guide seemed like the complete package, accept Apple have changed a few things in the AFP package in OS X for Lion. The result of these changes is that everything breaks for Lion, but after a little doffing around the net I appear to have a working fix.

This first error I encountered was “The version of the server you are trying to connect to is not supported”. I quick bit of digging around revealed that the login protocol has been changed, but there is a quick fix for this. The login protocol used before was DHX, and the new is DHX2. So, in order to fix this we simply need to edit the afpd.conf file, to do this run the following command in your Ubuntu Terminal.

sudo nano /etc/netatalk/afpd.conf

In order to fix the issue you now need to find your uncommented line for configuring the system, mine was at the bottom of the file and read as follows.

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

The issue is easily fixed by changing this line so that it is as follows (note the change in bold):

- -transall -uamlist uams_randnum.so,<strong>uams_dhx2.so</strong> -nosavepassword -advertise_ssh

So, whatever your configuration line reads I imaging as long as you change the bit that reads uams_dhx.so to uams_dhx2.so it should work.

Now just restart the service (see terminal command below) and get ready for the second error.

sudo /etc/init.d/netatalk restart

The second error was encountered after I connected to the server, so go ahead a connect (use your ubuntu login as a username and password), and wait. After a second or two this error should appear:

Server Error

This is also a quick fix, although the answer resides in a different file. It turns out the the value that the guide tells us to use for cnidscheme is actually invalid, and so the server sends us this message every time we interact with it. In order to get around this we need to change this to a valid value.

Firstly, open the AppleVolumes.default file as follows:

sudo nano /etc/netatalk/AppleVolumes.default

Now look find one of your network volume configuration lines, foe example i have this one which means that I can log in and access my user directory.

~/ "$u" allow:danielgroves cnidscheme:cdb

The part reading cnidscheme:cdb is what is causing the error, so we change this to cnidscheme:dbd to fix the error, meaning the line would now read like this:

~/ "$u" allow:danielgroves cnidscheme:dbd

Once you have made this change to each directory configuration that requires it, simple save you changes and restart the services.

sudo /etc/init.d/netatalk restart
sudo /etc/init.d/avahi-daemon restart

With a bit of luck, this post will help you to get round the issues that I have had. If you hit any issues at all drop me a line and I’ll try to help as far as I can.


comments powered by Disqus