Can't install netatalk on OSMC on Raspberry Pi 2

Obviously this is over a year old and I hate to bump but eventually worked it out on my own and would like to share if future people have the same problem:

Heres what I did and works a charm as of December 2016 on Raspberry Pi 3 with OSMC installed fresh today:

$ sudo su

If you haven’t enabled root yet run: (otherwise skip the step)

$ sudo passwd root

Install dependancies:

$ apt-get install build-essential libevent-dev libssl-dev libgcrypt11-dev libkrb5-dev libpam0g-dev libwrap0-dev libdb-dev libtdb-dev libmysqlclient-dev libavahi-client-dev libacl1-dev libldap2-dev libcrack2-dev avahi-daemon systemtap-sdt-dev libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev libio-socket-inet6-perl tracker libtracker-sparql-1.0-dev libtracker-miner-1.0-dev

Download Netatalk bzip2 from http://netatalk.sourceforge.net

Upload Netatalk bzip2 to OSMC

cd to wherever you’ve put the netatalk download

$ tar xvf netatalk-3.1.10.tar.bz2
$ cd netatalk-3.1.10

then configure & install as follows

$ ./configure \
        --with-init-style=debian-systemd \
        --without-libevent \
        --without-tdb \
        --with-cracklib \
        --enable-krbV-uam \
        --with-pam-confdir=/etc/pam.d \
        --with-dbus-daemon=/usr/bin/dbus-daemon \
        --with-dbus-sysconf-dir=/etc/dbus-1/system.d \
        --with-tracker-pkgconfig-version=1.0

$ make
$ make install

Change /usr/local/etc/AFP.conf to:

[Global]
; Global server settings
hostname = SERVER NAME
uam list = uams_dhx.so,uams_dhx2.so
mimic model = AirPort
zeroconf = yes
guest account = nobody

[Homes]
basedir regex = /home
appledouble = v2

[NAME OF DRIVE]
path = /media/YOUR DRIVE HERE
valid users = osmc root
rwlist = osmc root
directory perm = 0775
file perm = 0775
spotlight = yes
cnid scheme = dbd
ea = none
unix priv = yes
appledouble = v2
; time machine = yes

NOTE: Don’t use “quotes” on path above, just put the spaces in if there are spaces to the directory
NOTE: If you want time machine remove the ; before ‘time machine’

Create Avahi Service: /etc/avahi/services/afpd.service:

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

then enable & reboot

$ systemctl enable netatalk
$ reboot

Hope it helps anyone else having the problem!

1 Like

I was able to successfully install using the instructions you provided, but upon connecting to the server from my Mac, I am getting the following in my logs:

Oct 21 18:15:37.952180 afpd[20327] {fault.c:123} (severe:Default): ===============================================================
Oct 21 18:15:37.952377 afpd[20327] {fault.c:124} (severe:Default): INTERNAL ERROR: Signal 11 in pid 20327 (3.1.11)
Oct 21 18:15:37.952444 afpd[20327] {fault.c:125} (severe:Default): ===============================================================
Oct 21 18:15:37.953639 afpd[20327] {fault.c:96} (severe:Default): PANIC: internal error
Oct 21 18:15:37.953753 afpd[20327] {fault.c:97} (severe:Default): BACKTRACE: 0 stack frames:

Any ideas what could be causing this?

Hmmm, interesting.

What version of Mac OS are you running? Have you tried on other computers running macOS just to rule out any problems with the client? I just tried the method two days ago and it works as of High Sierra with a fresh install of OSMC and Netatalk 3.1.10 (which I had already downloaded since the last time I tried this).

Have you tried running:

$ systemctl status netatalk

on OSMC to see if there are any clues as to whether it was a faulty install?

I’m not really a developer so I don’t know anything about how Netatalk actually works or it’s faults & compatibility but on some older version of MacOS it seems that some people have had success changing the UAM.

Being on Lion, I cannot use the uams_dhx UAM instead of uam_dhx2. On a hunch, I tried removing uam_dhx2 altogether and replaced it with uam_guest. This enabled me to connect to the server without crashing afpd but I couldn’t connect to my volumes since now I was “nobody”. Adding “allow:nobody” to the relevant volume configs in AppleVolumes.default was the final piece of the puzzle

See here?: Bug #810732 “Netatalk shows kernel panic in syslog when trying t...” : Bugs : netatalk package : Ubuntu

So in Netatalk 3 this would replacing uam_dhx2.so and adding uams_guest.so ? In Netatalk 3, ‘allow’ has also been replaced by ‘valid users’. Keep in mind though that this solution may open up your file server to security issues though which is why falling back onto SMB support might be a better solution and AFP should only really be used nowadays if you have to use it.

I doesn’t sound like you’ve got a faulty install but more likely some configuration issue but a fresh install of OSMC with an up to date version of Mac OS might by the easiest way to tackle it if you can’t find any other solutions online anywhere else?

thank you for your reply… I can’t get it to work with all your suggestions. Not sure why the service crashes after authenticating. Not much info in the logs too, just the same as the error I posted.