Mon 27 Nov 2006
The OS X file sharing in the Finder is so beautifully designed that I just had to make our new Ubuntu file server integrate cleanly with Finder. This turned out to be a fairly painful process, without any clear documentation, so here’s a tutorial:
Background:
OS X file sharing is done with AFP (AppleTalk Filing Protocol) and Bonjour (zeroconf) style service discovery. AFP allows one Mac to connect to another’s shares, while Bonjour handles the auto-discovery of available shares.
Packages required:
netatalk - This package contains an implementation of AFP.
avahi - This package performs the Bonjour style service publishing to make it easy for other Macs to discover the share.
These packages are not in the standard distribution, so you have to enable the “universe” repository by editing /etc/apt/sources.list. This is documented here.
sudo apt-get update (update the system’s knowledge of available packages)
The standard installation of netatalk cannot handle encrypted logins, which means OS X will pop up an annoying warning about cleartext passwords. For this reason, the following instructions are provided to build and install the netatalk package from source.
sudo apt-get install devscripts (installs debuild)
apt-get source netatalk
sudo apt-get build-dep netatalk
sudo apt-get install cracklib2-dev
cd netatalk-2.0.3
DEB_BUILD_OPTIONS=ssl debuild (no quotes)
sudo dpkg -i ../netatalk_*.deb
Configuration:
netatalk:
To share your home directories, add the following line to /etc/netatalk/AppleVolumes.default:
~ “$u - Home Directory”
To run netatalk on system startup:
cd /etc/rc2.d
ln -s ../init.d/netatalk S96netatalk
avahi:
Create a /etc/avahi/services/afpd.service file as described on this page.
%h _afpovertcp._tcp 548
]]-->
To run avahi on system startup:
cd /etc/rc2.d
ln -s ../init.d/avahi S97avahi
Testing
Either reboot to start the services, or run them like this:
sudo /etc/init.d/netatalk start
sudo /etc/init.d/avahi start
Now pull up your trusty Mac and try to access your home directory on the Linux box via the Network section of Finder. It should look and behave exactly like an OS X share.
December 3rd, 2006 at 1:29 pm
Ironically, Windows file sharing is a pretty good common denominator between OSX and Linux. Samba setup is pretty well documented and will show up in Finder, albeit probably not as nicely as an OSX-style share.
December 11th, 2006 at 8:57 pm
I dutifully gave your excellent instructions a shot, but it seems my Fedora install is too ancient to build all this without a lot of legwork.
June 3rd, 2007 at 4:39 am
Apple File Sharing under Ubuntu 7.04…
Confirming that Elliot’s instructions to get AFS still work in Ubuntu 7.04. Only thing I would change is some of those command lines - they can be done one one line using && or ;
……
November 20th, 2007 at 3:09 am
and for your second trick…
http://www.sanityinc.com/articles/mac-screen-sharing-with-linux
June 5th, 2008 at 8:35 am
Hi. This is really interesting post. Thank You! I have just subscribed to Your rss!
Best regards