Search Icon, Magnifying Glass

Marmanold.com

Graduation CapHeartQuestion MarkMagnifying Glass

Linux Fileshare for Classic Macintoshes

Fri, Mar 24, 2017

A while back I got the idea in my head that I needed a fileshare for my classic Macintoshes. The move to HTTPS in recent years has left ancient browsers out in the cold for hitting classic software repositories like Macintosh Garden which meant I needed to either suffer the pain of heavy browsing in Classilla on my iMac G4 or download files on a modern machine that the Macs could get access to. Initially I thought a simple FTP server would suffice. Though FTP got the job done more or less, FTP clients such as Fetch would freeze on >100MB downloads on my older machines like the Quadra 630. FTP just wouldn’t cut it. I needed a proper AppleTalk fileshare.

My first attempt at an AppleTalk fileshare involved Ivanx’s A2SERVER project. I attempted to install and configure this project on both a VM running Ubuntu 16.4 LTS and my RaspberryPi running Raspbian Jessie. In both cases I could see the fileshare on my modern iMac running El Capitan, but not from MacOS 9 on the iMac G4 or MacOS 7.6 on the Quadra. Digging deeper I realized the A2SERVER was probably a bit more than I needed. What I really needed was the AppleTalk core of A2SERVER, Netatalk, to work correctly on my Pi.

More recent versions of Netatalk – the 3.x branch – dropped support for classic Mac AppleTalk filesharing over ethernet. To get a Linux machine to share files with a classic Macintosh you need to get the 2.x branch of Netatalk up and working. This is no easy feat. If your distro does include Netatalk 2.x it most likely does not include classic AFP support. Netatalk will need to be compiled with AFP support enabled.

If you search the Internet you will find many guides explaining how to compile Netatalk 2.x and configure it so that you can share volumes with classic Macintoshes. The only problem is that most of these tutorials are several years old and just don’t work on modern distros. Cups versions past 1.5 cause build issues and there is a bug in the compile script – at least in 2.1.6 – that requires manual compilation of ACL. After much trial and error I was able to get Netatalk 2.1.6 to compile and run correctly on Raspbian Jessie running on a RaspberryPi B. I did this by following Apple Fool’s great tutorial with a few modifications to explicitly exclude printing support, Bonjour support, and to compile ACL.

How to Compile & Configure Netatalk 2.1.6 on Raspbian Jessie

The below instructions will take you step-by-step through setting up an AppleTalk fileshare on a Raspberry Pi connected via ethernet to your LAN. Steps 1 through 6 are my own additions to modernize Apple Fool’s tutorial. From steps 7 to 16, I am riffing on Apple Fool’s tutorial, adding additional clarity where I can.

  1. Download netatalk-2.1.6.tar.gz source

    wget http://downloads.sourceforge.net/project/netatalk/netatalk/2.1.6/netatalk-2.1.6.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fnetatalk%2Ffiles%2Fnetatalk%2F2.1.6%2F&ts=1479855384&use_mirror=master

  2. Install libraries recommended by Apple Fool with the addition of several other packages not included in the Rasbian Jessie mini distro

    sudo apt-get install libavahi-client-dev libcups2-dev libdb-dev libssl-dev libacl1-dev libopenafs-dev gawk libltdl-dev libltdl7 autoconf libgcrypt20-dev libgcrypt20 cracklib-runtime libpam-cracklib lsof procps rc quota texinfo coreutils cdbs autotools-dev devscripts debhelper dh-buildinfo libwrap0-dev libpam0g-dev libkrb5-dev libltdl3-dev libgcrypt11-dev libcrack2-dev libldap2-dev d-shlibs hardening-includes -y

  3. Unpack netatalk-2.1.6.tar.gz

    tar -zxvf netatalk-2.1.6.tar.gz

  4. Enter netatalk directory

  5. Configure Netatalk for compilation

    ./configure --enable-debian --sysconfdir=/etc --with-uams-path=/usr/lib/netatalk --with-ssl-dir=/usr/lib/ --disable-cups

  6. Compile Netatalk

    sudo make

    sudo make install

  7. Create the RetroServe directory in your user’s home directory.

    cd ~

    mkdir RetroServe

  8. Open the netatalk configuration file

    sudo vi /etc/default/netatalk

  9. Find the line ATALKD_RUN=no and change the no to yes. Save your changes. (Esc, :, wq, Enter)vi commands

  10. Add the RetroServe directory to the list of directories to be shared.

    sudo vi /etc/netatalk/AppleVolumes.default

  11. Scroll to the end of the AppleVolumes.default file and find the ~ near the end. Replace the ~ with the following line. Save your changes. (NB: Apple Fool reports the possibility of needing to add volsizelimit properties to the end of the share path for System 7.5.3 and earlier.)

    ~/RetroServe "RetroServe"

  12. Open the AFPD configuration file.

    sudo vi /etc/netatalk/afpd.conf

  13. Configure AFPD to accept all the supported authentication protocols and to allow the Classic Mac OS user to save their password. Add this line to the bottom of the afpd.conf file. Save your changes.

    - -transall -uamlist uams_clrtxt.so,uams_dhx.so,uams_dhx2.so

  14. Open the ATALKD configuration file to configure your networking preferences.

    sudo vi /etc/netatalk/atalkd.conf

  15. Go to the bottom of the file and add the following line. Save your changes. (NB: This assumes you are using an ethernet connection. If not, please reference Apple Fool’s tutorial.)

    eth0 -phase 2 -net 0-65534 -addr 65280.163

  16. Start Netatalk with your new configuration settings. (NB: You will need to run this each time your Raspberry Pi is restarted. Investigate your own method to automate this.)

    sudo /etc/init.d/netatalk start

Configure Your Classic Macintosh to Connect to an AppleTalk Network Share

  1. Open the Chooser and click on “Server IP Address…”

    Picture 1

  2. Enter the IP address of your Raspberry Pi and click “OK”.

    Picture 2

  3. Select “Apple Standard UAMs” and click “OK”.

    Picture 3

  4. Enter the username and password for the Raspberry Pi user you compiled Netatalk with. Click “Connect”.

    Picture 4

  5. Select “RetroServe” — or whatever you named your share —, click the checkbox, and select “Save My Name and Password”. Click “OK”.

    Picture 6

  6. Your share is now mounted to the desktop.

    Picture 7

You Might also Want FTP

  1. Install FTPD

    sudo apt install ftpd

  2. There is no step 2.