Upgrading Netatalk v3.0

For those of us running Linux file shares at home, AFP support is provided using something called Netatalk. Since my original posting on this a few years ago, this is now at version 3.0 and the configuration has changed somewhat. This article outlines some of the things you will need to do to configure Netatalk assuming you are running Ubuntu server.

Running AFP allows you to natively mount file shares from your Mac to your Linux based fileserver. While you can certainly use other methods (NFS/SMB), AFP is able to provide integrated support with your TimeMachine backup. You can download the latest version from http://netatalk.sourceforge.net/, which will be required for optimal support. The version shipping with Ubuntu currently is rather outdated, so this is a necessity.

234593_2384

After downloading, extract everything into a source directory that you will use for building it. Then use the following steps as a guideline for building and installing your Netatalk distribution:

  1. Install Pre-Requisits. In addition to the standard suite of build tools (make/gcc), you will also need ssl, PAM and crypt development libraries.
    apt-get install avahi-daemon libnss-mdns cracklib2-dev fakeroot libssl-dev libpam0g-dev libgcrypt11-dev
  2. Configure Everything. Inside the directory with the extracted source code, do the following:
    make distclean
    sh ./configure --with-init-style=debian --with-zeroconf --enable-fhs
    

    The debian style init will create a startup script in /etc/init.d. The zeroconf attribute provides integration with avahi for resource discovery, and the –enable-fhs will install the server with the main configuration in /etc.

  3. Build and Install. Compile the source code and install:
    make && sudo make install
    
  4. Configure AFP Server. Setup a configuration file for your server. This will be in /etc/afp.conf and is much easier to do than previous releases. If you have your file share settings in AppleVolumes.default you will need to transcribe them into this new config file. Here is a sample setup to get you started:
    ;
    ; Netatalk 3.x configuration file
    ; http://netatalk.sourceforge.net/3.0/htmldocs/afp.conf.5.html
    ;
    [Global]
    vol preset = default_for_all_vol
    log file = /var/log/netatalk.log
    uam list = uams_dhx.so,uams_dhx2.so
    save password = yes
    afpstatus = yes
    zeroconf = yes
    mimic model = RackMac
    
    [default_for_all_vol]
    file perm = 0664
    directory perm = 0774
    cnid scheme = dbd
    valid users = @users 
     
    [Homes]
    basedir regex = /export/home
     
    [Public]
    path = /export/public
    
    [TimeMachine]
    path = /export/timemachine
    time machine = yes
    
  5. Startup and Connect. With your configuration file in place, startup the server and connect to it from your favorite Mac:
    /etc/init.d/netatalk startup

There are a few things to watch out for, if you have an Avahi configuration from a previous install you may need to remove settings from there. For example, if you crafted an adisk.service file with record entries for your shares you no longer need this with zeroconf. If you didn’t do this then this doesn’t apply.

Finally, if you get the dreaded “The version of the server you are trying to connect to is not supported” when trying to connect to your AFP server from your Mac then you should confirm what your server supports as there is likely something missing.

asip-status.pl localhost

The result should look something like this:

AFP reply from localhost:548
Flags: 1  Cmd: 3  ID: 57005
Reply: DSIGetStatus
Request ID: 57005
Machine type: Netatalk3.0.4
AFP versions: AFP2.2,AFPX03,AFP3.1,AFP3.2,AFP3.3
UAMs: DHX2,DHCAST128
Volume Icon & Mask: Yes

Make sure DHX2 is available, if this is not here then something went wrong with libgcrypt.

One thought on “Upgrading Netatalk v3.0

  1. Pingback: “La versione del server al quale si sta tentanto di connettersi non è supportata.” | Le Petit Prince

Comments are closed.