Monday, March 25, 2013

Connecting to Raspberry Pi with Mac OS X

I've been using a Windows machine as my main desktop for any number of years but last Friday the current incarnation of 'homemachine' accompanied one of its occasional blue screens of death with a blue pall of smoke.

So I'm trying out my Mac Mini as a regular desktop using only 'free' stuff. I've become a bit lazy over the years using a gui for everything but I'm getting back into command line operation quite quickly for many things.

One thing I have to write about is just how easy it is to provide yourself with visibility of your Raspberry Pi file system in Finder.

The following works on the current Raspbian Wheezy.

install netatalk (which will install avahi as a dependency)

sudo apt-get update
sudo apt-get install netatalk

create and open a config file for afp

sudo nano /etc/avahi/services/afpd.service

paste / type the following into the file.


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

Save the file and restart the avahi service

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

That's it. Now in your Mac, open Finder and open the network. Your Raspberry Pi will be visible. Open it. An initial connection attempt will fail. Choose 'Connect As' and enter a username / password ( pi / raspberry ). You will see your home directory listed as "Home Directory".

Further options, if you need them. can be configured on your Pi in /etc/netatalk/AppleVolumes.default

Information on the options for Netatalk here.

I came across the base information on how to do this at Getting Started with Raspberry Pi  & MacOSX