This post will only interest you if you’re using a Mac. AFP (Apple Filing Protocol) is the protocol Macs use to share files over a network. This post will guide you through setting this up using Netatalk. It will also cover setting it up to be easily accessible without the IP address.

To install Netatalk, simply use apt-get:

  • sudo apt-get install netatalk

You should now be able to access your Raspberry Pi from the Finder side bar and under Network (shift + command + k).

Finder sidebar - Shared

EDIT: The remainder of this post is now outdated and should not be required once you have installed netatalk.

This installs 2.1.2 of Netatalk which is not the latest (2.2.3 at time of writing) which may cause issues with using this for Time Machine and with Lion, although I have not experienced any issues on my two Lion machines. My attempts at installing 2.2.3 failed though I’m sure it’s possible.

When apt-get has finished, you can connect from the Mac:

  1. In Finder, open the Go menu and select “Connect to Server…” (⌘K).
  2. Enter “afp://” followed by your Raspberry Pi’s IP address.
  3. Enter your Raspberry Pi’s username and password (default username is “pi” with password “raspberry”).
Connect to server dialog
Now wouldn’t it be nice if the Mac showed your Pi under the shared section of the Finder sidebar? For this the Raspberry Pi needs to be advertising itself on the network, Apple’s Zero Configuration protocol for this is called Bonjour. This is supported under Netatalk 2.2.3 but not in the version we’ve installed. Avahi can do this for us, but requires a bit more work (below steps have be adapted from this article by Sam Davis):
  1. First run “sudo apt-get install avahi-daemon”.
  2. Next, make sure it runs at startup, enter “sudo update-rc.d avahi-daemon defaults”.
  3. Create a configuration file containing information about the server. Run “sudo nano /etc/avahi/services/afpd.service”. Enter (or copy/paste) the following:
    <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
    <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
       <name replace-wildcards="yes">%h</name>

    Press ctrl and x to exit, then press y to to save changes and return after confirming the location.
  4. Restart Avahi: “sudo /etc/init.d/avahi-daemon restart
  1. hanlee reblogged this from gettingstartedwithraspberrypi and added:
    It works well.
  2. vincentpants reblogged this from gettingstartedwithraspberrypi
  3. metawops reblogged this from gettingstartedwithraspberrypi and added:
    Awesome! Exactly what I was looking for. Small update: today, when...get version 2.2.2-1...
  4. gettingstartedwithraspberrypi posted this