Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

guide to setting up netatalk on Ubuntu, with Apple II netboot

709 views
Skip to first unread message

Ivan X

unread,
Sep 13, 2010, 2:24:06 AM9/13/10
to
Here's the cheat sheet for setting up a netatalk 2.1.3 server, with Apple II
netboot, on Ubuntu 10.04. I hope it's helpful. It draws heavily on what
Steven Hirsch contributed before. This setup has been tested with an Apple
Workstation Card attached to an AsanteTalk bridge, connecting to VirtualBox
or VMWare Fusion on Mac OS X 10.5.8 (wired only, wireless will not work).
In principle, this should work for IIgs netbooting as well, but it has not
been tried.

In these instructions, I use pico to edit text files, but you can use the
text or graphical editor of your choosing.

- Using Synaptic Package Manager or apt-get, install libdb4.8-dev,
libssl-dev, libcrack2, libcrack2-dev, cracklib-runtime, libpam-cracklib
- download netatalk 2.1.3 (source) then in a terminal, cd to the folder you
downloaded it to (e.g. "cd ~/Downloads") and type:
tar zxf netatalk-2.1.3.tar.gz
cd netatalk-2.1.3
- if you want to apply Steve's date fix, type:
pico etc/afpd/file.c
- put // (two slashes) at the start of line 827, which says "change_mdate =
1;"

- you're ready to build! type:
./configure --enable-debian --enable-a2boot --with-cracklib [wait until
complete]
sudo make [wait until complete]
sudo make install [wait until complete]

Ok, it's installed. Now to edit config files:
sudo pico /etc/init.d/netatalk
- line 1: change from #!/bin/sh to #!/bin/bash
- lines 36 and 37: change /etc/default/netatalk to
/usr/local/etc/netatalk/netatalk.conf
- wherever it says "timelord" [six places], change it to "a2boot" (observing
case as appropriate)

sudo pico /usr/local/etc/netatalk/netatalk.conf
change ATALKD_RUN and A2BOOT_RUN from no to yes

sudo pico /usr/local/etc/netatalk/afpd.conf
add this to the bottom:
- -transall -uamlist uams_guest.so,uams_clrtxt.so,uams_randnum.so

sudo pico /usr/local/etc/netatalk/atalkd.conf
add this to the bottom:
eth0 -router -phase 2 -net 1 -addr 1.6 -zone "myZone"
[may need adjustment for your setup; this works for me with an AsanteTalk
LocalTalk-to-Ethernet bridge]

sudo pico /usr/local/etc/netatalk/AppleVolumes.default
put a # in front of the tilde near the bottom. On the next line, put
/home/A2BOOT A2BOOT casefold:toupper options:prodos
[you can add other shared folders below this line if you wish, in the same
format]

- create the share folder. type:
sudo mkdir /home/A2BOOT

If you don't want to netboot and only wish to use the Workstation Disk to
log onto the server from your Apple II, you can now boot the disk and you
should be able to log on as guest. To add registered users, type:
sudo afppasswd -c [only for the first user you ever add]
sudo afppasswd -a -n username ['username' should be an Ubuntu user]

You're now ready to start the server. You can start netatalk with:
sudo /etc/init.d/netatalk start [it takes about 1 minute to start up]
[you can also stop it with "stop" instead]

(Even if you are planning on netbooting, it's not a bad idea to actually try
out the Workstation Disk now just to see if you can log on as a guest at
this point.)

Next, set up the Boot Blocks which are transferred and executed during an
Apple II netboot. In the csa2 "secret archive" find "Extras for netatalk
environment" and download it, and cd to the folder it downloaded to (e.g.
"cd ~/Downloads"). Then type:
tar zxf netatalk_extras.tar.gz
cd netatalk_extras
tar zxf troika-2.tar.gz
sudo mv a2boot /usr/local/etc/netatalk

Finally, you need to set up the netboot shared volume just so. This part is
tricky because for each user you need a customized file called ATINIT in
/home/A2BOOT/USERS/[username]/SETUP/ which is normally generated by the
AppleShare 3 server software. You also need a copy of BASIC.SYSTEM in
/home/A2BOOT/SYSTEM that appears to ProDOS with its correct file type
(meaning correct metadata must be in the correct .AppleDouble folder). All
this stuff is available for two users called "local2e" and "local2e" in the
netatalk_extras folder you just downloaded, so you can start with those.
Type:
tar zxf A2BOOT.tar.gz
sudo mv A2BOOT /home
sudo chown -R root:root /home/A2BOOT
sudo chmod -R ugo+rw /home/A2BOOT
- on the Ubuntu desktop, in System->Administration->Users and Groups, create
a new user called "local2e" (or "local2gs" if you're netbooting from a
IIgs), with whatever password you like.
- back in terminal, type:
sudo afppasswd -c [if you didn't already so above]
sudo afppasswd -a -n local2e
- enter the password you want to log from the Apple II with, twice.

Now, if all is well, you should be able to type PR#2 (or whatever slot your
WS card is in), and hold open-apple as you press return (not necessary on
IIgs). You should then be able to log onto the server with username
"local2e" (or "local2gs") and the password you typed, and launch
BASIC.SYSTEM. Cool! The default prefix is /A2BOOT/SYSTEM.

I have sometimes had issues getting my //e to initially find the server for
netboot; starting from the Workstation Disk and logging on seemed to help,
and then further netboots go ok. Also, if you have a System 7/8/9 Mac, try
using that to see if the server shows up in the Chooser (make sure the
AppleTalk control panel is set to the correct port).

If you want to permit guest login, do this in the Ubuntu terminal:

cd /home/A2BOOT/USERS
mkdir '<ANY USER>' [type this exactly as shown, including single quotes]
cd '<ANY USER>' [same here]
mkdir SETUP
cd SETUP
base64 -d > ATINIT
[when you press return, it will not display a new prompt]
paste the following:
AP//AAAJ/xsvQTJCT09UL1NZU1RFTS9CQVNJQy5TWVNURU0AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAA//8AAAn/Dy9BMkJPT1QvU1lTVEVNLwAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKPEFueSBVc2VyPgAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
[now type return, then ctrl-D, and you will be back at the prompt]
sudo chmod -R ugo+rw /home/A2BOOT

Guest login should now be enabled.

If you want to create your own ATINIT file for your Ubuntu user(s), use
AppleShare 3 and make a user with the same name, and set the user up for
Apple II Startup, then log into the A2BOOT volume and copy over the new user
folder to the USERS folder on A2BOOT. If you want to try to hand-roll your
own ATINIT, you can look at the existing ones, and refer to the technical
notes in /home/A2BOOT/USERS for details on the file format. I'll eventually
write a utility to do this. Maybe.

If you get as far as logging in but then the Apple //e complains about not
finding the startup program, BASIC.SYSTEM may not have the correct file
type. To fix this, log onto the server with the Workstation Disk, and go to
BASIC. Then type:
PREFIX /A2BOOT/SYSTEM
CAT [verify that BASIC.SYSTEM isn't type SYS]
BLOAD BASIC.SYSTEM,T$00,A$2000
RENAME BASIC.SYSTEM,BASIC.SYS00
CREATE BASIC.SYSTEM,TSYS
BSAVE BASIC.SYSTEM,TSYS,A$2000,L$2800
CAT [verify that BASIC.SYSTEM is now type SYS]
DELETE BASIC.SYS00


--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---

Gust L Friedemann

unread,
Sep 13, 2010, 2:01:43 PM9/13/10
to
Thank you!

Sir, you are a gentleman and a scholar. :)

Steven Hirsch

unread,
Sep 13, 2010, 5:56:19 PM9/13/10
to
On 09/13/2010 02:01 PM, Gust L Friedemann wrote:
> Thank you!
>
> Sir, you are a gentleman and a scholar. :)

Yes, it was definitely above and beyond the call of duty. I'm shamefully lazy
with regard to keeping docs up-to-date and I really appreciate the effort.


Hugh Hood

unread,
Sep 14, 2010, 12:49:48 AM9/14/10
to
Ivan,

You da man!!!!

Really, thanks for your great effort in producing Ivan's 'Netatalk-Apple II
Cookbook.' Your step-by-step instructions are just the thing many of us need
in order to implement Netatalk as an Apple II file server.

And, I'm so glad that Steven is still around to provide insight into the
important work he did on this several years ago.

As sweet as your Cookbook is, your mentioning that you intend to try to
build a functional Netatalk-Apple II file server on a NAS ( Western Digital
My Book World Edition) is better still. For those of us with Macs and Apple
IIs but without a dedicated Linux box, that would be a nice file sharing
solution indeed.

BTW, since you've got a Mac running a pre-10.6 OS (i.e.-AppleTalk still
present in the kernel, but not available for use by the Mac's native
AppleFileServer / AFP over TCP/IP only) maybe you could try something at
which I failed:

I cheated and used MacPorts to build and install Netatalk, but since that
patched/configured source refused to allow compiling 'atalkd', I was dead in
the water as far as serving files to an Apple II. I never took it further
than that, unfortunately.

So, can you envision building Netatalk on your pre-10.6 OS X Mac so that it
would permit AFP over Appletalk? Obviously, if somehow that were doable, it
would eliminate the need to run Ubuntu under VMWare Fusion on a pre-10.6 OS
X Mac in order to serve files to an Apple II.

Thanks for mulling that one over, in addition to all the other stuff, of
course. <grin>


Hugh Hood

in article C8B33BC6.20246%iva...@yahoo.com, Ivan X at iva...@yahoo.com
wrote on 9/13/10 1:24 AM:

Steven Hirsch

unread,
Sep 14, 2010, 7:49:23 AM9/14/10
to
On 09/14/2010 12:49 AM, Hugh Hood wrote:

> BTW, since you've got a Mac running a pre-10.6 OS (i.e.-AppleTalk still
> present in the kernel, but not available for use by the Mac's native
> AppleFileServer / AFP over TCP/IP only) maybe you could try something at
> which I failed:
>
> I cheated and used MacPorts to build and install Netatalk, but since that
> patched/configured source refused to allow compiling 'atalkd', I was dead in
> the water as far as serving files to an Apple II. I never took it further
> than that, unfortunately.

Likely due to lack of kernel-level support for ddp (appletalk transport
layer). You may well have better luck on an earlier version of OS X.

Ivan X

unread,
Sep 14, 2010, 8:33:51 AM9/14/10
to Steven Hirsch
On 9/14/10 7:49 AM, in article
F46dnQdKUKPe_BLR...@giganews.com, "Steven Hirsch"
<snhi...@gmail.com> wrote:

What Steven said. I too had that idea. While it should theoretically be
possible, I tried it some time ago, and netatalk couldn't make use of
whatever AppleTalk facilities Mac OS X had. It would probably require
modifications to netatalk which are beyond my ability; without really
knowing, I'm guessing Linux makes its AppleTalk protocol available in a
particular way and that's what netatalk is looking for. It's been a while
since I looked, though, so I might try it again on an older version of OS X.

pitz

unread,
Sep 14, 2010, 3:11:44 PM9/14/10
to
On Sep 13, 9:49 pm, Hugh Hood <hughh...@earthlink.net> wrote:
[snip]

>
> As sweet as your Cookbook is, your mentioning that you intend to try to
> build a functional Netatalk-Apple II file server on a NAS ( Western Digital
> My Book World Edition) is better still. For those of us with Macs and Apple
> IIs but without a dedicated Linux box, that would be a nice file sharing
> solution indeed.
>

Yes indeed. Just a week ago, I was playing around with a Seagate
DockStar that is now cheaply available (around ~$25). My writeup is
in the works. The DockStar is also an ARM-based device with 128MB of
memory but can use a full Debian install on an attached USB
thumbdrive. I've got Debian "squeeze" running on it, and have just
installed the netatalk package. Next step is to upgrade to the latest
netatalk sources.

The DockStar has great potential for IIe/IIgs users. It takes 9V as
an input source, has 4 powered USB ports, and is about the size of a
deck of cards. You could literally house it inside the case of your
IIe or IIgs and with some creative wiring, you can maybe put all your
Apple files on an extra thumbdrive and serve it via netatalk from
there -- yet another way for transferring files from your Mac/PC to
your Apple IIe/IIgs.

Thanks again for the guide Ivan!

/pitz

Ivan X

unread,
Sep 14, 2010, 6:11:55 PM9/14/10
to
> Yes indeed. Just a week ago, I was playing around with a Seagate
> DockStar

...snip...

> The DockStar has great potential for IIe/IIgs users. It takes 9V as
> an input source, has 4 powered USB ports, and is about the size of a
> deck of cards. You could literally house it inside the case of your
> IIe or IIgs and with some creative wiring, you can maybe put all your
> Apple files on an extra thumbdrive and serve it via netatalk from

> there.

This sounds sweet. First I've heard of it. Let me know if you want to
collaborate or need help setting up netatalk.

datawiz

unread,
Sep 14, 2010, 10:01:24 PM9/14/10
to
Nice work, and thanks for sharing!

This one is going onto the 'Apple II To-Do list'.

Have you put any thought into stripping down the linux installation
and creating an image or VMWare appliance, so everyone could run it
directly and take full advantage of your hard work without us breaking
any sweat at all? ;-)

Cheers and many thanks!

Ivan X

unread,
Sep 15, 2010, 3:11:42 AM9/15/10
to
On 9/14/10 10:01 PM, in article
8b6e57eb-fe03-4cc8...@m16g2000vbs.googlegroups.com, "datawiz"
<rich....@gmail.com> wrote:

> Have you put any thought into stripping down the linux installation
> and creating an image or VMWare appliance, so everyone could run it
> directly and take full advantage of your hard work without us breaking
> any sweat at all? ;-)

Yes, I sure have. That's coming soon, to go along with the Juiced.GS online
supplement I'm writing about this. So within the month or so.

Steven Hirsch

unread,
Sep 15, 2010, 7:47:00 AM9/15/10
to
On 09/15/2010 03:11 AM, Ivan X wrote:
> On 9/14/10 10:01 PM, in article
> 8b6e57eb-fe03-4cc8...@m16g2000vbs.googlegroups.com, "datawiz"
> <rich....@gmail.com> wrote:
>
>> Have you put any thought into stripping down the linux installation
>> and creating an image or VMWare appliance, so everyone could run it
>> directly and take full advantage of your hard work without us breaking
>> any sweat at all? ;-)
>
> Yes, I sure have. That's coming soon, to go along with the Juiced.GS online
> supplement I'm writing about this. So within the month or so.

Give this man a prize!

Message has been deleted

Hugh Hood

unread,
Sep 16, 2010, 1:20:24 AM9/16/10
to
Steve,

Those are good points on Netatalk and DDP. And, I suspect that you are
correct about OpenDarwin having the source code for the OS X AppleTalk
stuff.

Here's where things get interesting/confusing. A pre-10.6 OS X Mac _does_
already have an AppleTalk implementation by default, including NBP and
(apparently) DDP.

For example, I hooked a IIGS up to one of my Mac's and enabled AppleTalk on
both. What follows is the result of the commands "atlookup" and "appletalk
-s":


======START Actual Terminal Session on OS X 10.4.11 =========

Hugh Hood's PowerMac G3:~ hughhood$ atlookup
Found 3 entries in zone *
ffaa.ac.80 Hugh Hood's Power Mac G3:Darwin
ff00.52.80 Silentwriter 95:LaserWriter
ff00.14.81 guest:Apple IIgs
Hugh Hood's PowerMac G3:~ hughhood$

Hugh Hood's PowerMac G3:~ hughhood$ appletalk -s

AppleTalk interface.............. en0
Network Number .................. 65450 (0xffaa)
Node ID ......................... 172 (0xac)
Current Zone .................... *
Bridge net ...................... 0 (0x0)
Bridge number ................... 0 (0x0)

DDP statistics:

Packets Transmitted ............. 20
Bytes Transmitted ............... 828
Best Router Cache used (pkts) ... 0
Packets Received ................ 41
Bytes Received .................. 1761
Packets for unregistered socket . 0
Packets for out of range socket . 0
Length errors ................... 0
Checksum errors ................. 0
Packets dropped (no buffers) .... 0
Hugh Hood's PowerMac G3:~ hughhood$

======END Actual Terminal Session on OS X 10.4.11 =========

So, I'm still wondering what it would take for Netatalk to find and use the
default built-in OS X AppleTalk implementation.

Ideally, it would only be a matter of a few Netatalk source code changes.
Or, it could be a major headache that no one would want to take on. I'm not
familiar enough with Netatalk to know exactly how it interacts with the
Linux AppleTalk implementation to speculate.

Any guesses? Anyone?

Hugh Hood

in article gvydnZpKMKB0Lg3R...@giganews.com, Steven Hirsch at
snhi...@gmail.com wrote on 9/15/10 6:54 AM:

> On 09/14/2010 08:33 AM, Ivan X wrote:
>> On 9/14/10 7:49 AM, in article
>> F46dnQdKUKPe_BLR...@giganews.com, "Steven Hirsch"
>> <snhi...@gmail.com> wrote:
>>
>>> On 09/14/2010 12:49 AM, Hugh Hood wrote:
>>>
>>>> BTW, since you've got a Mac running a pre-10.6 OS (i.e.-AppleTalk still
>>>> present in the kernel, but not available for use by the Mac's native
>>>> AppleFileServer / AFP over TCP/IP only) maybe you could try something at
>>>> which I failed:
>>>>
>>>> I cheated and used MacPorts to build and install Netatalk, but since that
>>>> patched/configured source refused to allow compiling 'atalkd', I was dead
>>>> in
>>>> the water as far as serving files to an Apple II. I never took it further
>>>> than that, unfortunately.
>>>
>>> Likely due to lack of kernel-level support for ddp (appletalk transport
>>> layer). You may well have better luck on an earlier version of OS X.
>>
>> What Steven said. I too had that idea. While it should theoretically be
>> possible, I tried it some time ago, and netatalk couldn't make use of
>> whatever AppleTalk facilities Mac OS X had. It would probably require
>> modifications to netatalk which are beyond my ability; without really
>> knowing, I'm guessing Linux makes its AppleTalk protocol available in a
>> particular way and that's what netatalk is looking for.
>

> Well, yes. The 'particular way' is by supporting Apple's DDP (datagram
> delivery protocol) as a feature of the kernel-level network stack. Like most
> everything, this is a compile-time option for Linux (which, as you've seen, is
> not activated in your NAS). Fortunately, since Linux source is available you
> can roll your own.
>
> Mac OS X is built on top of "Darwin", which I believe is a Mach micro-kernel
> with BSD-ish API (someone correct me if I have this wrong). Parts of Darwin
> are open source. I suppose if you are adventurous it might be possible to
> build a new Darwin foundation or loadable driver to provide DDP, but a more
> likely approach would involve doing a netatalk-like application with its own
> DDP in user space. Most modern operating systems have a mechanism for
> applications to plug in as a "tap" at the packet level - not sure what Mac OS
> calls this.
>
> Either way, it's bound to be a lot of work and a powerful, err, "learning
> experience" :-).
>
> Steve

Steven Hirsch

unread,
Sep 16, 2010, 7:42:15 AM9/16/10
to
On 09/16/2010 01:20 AM, Hugh Hood wrote:
> Steve,

> Here's where things get interesting/confusing. A pre-10.6 OS X Mac _does_
> already have an AppleTalk implementation by default, including NBP and
> (apparently) DDP.

(snip)

> So, I'm still wondering what it would take for Netatalk to find and use the
> default built-in OS X AppleTalk implementation.

The best way to find out is to grab the sources and try running 'configure' on
a pre-10.6 mac. If the appropriate header files are present in /usr/include
it should detect it.

> Ideally, it would only be a matter of a few Netatalk source code changes.
> Or, it could be a major headache that no one would want to take on. I'm not
> familiar enough with Netatalk to know exactly how it interacts with the
> Linux AppleTalk implementation to speculate.

Netatalk uses the kernel NBP and DDP services via standard system calls. I
don't see any reason in theory why it couldn't do so on a Mac.

Ivan X

unread,
Sep 16, 2010, 11:33:52 AM9/16/10
to
Here's my memory of AppleTalk in Mac OS X, which might very well be wrong
both due to hazy memory and a limited understanding of AppleTalk; please
correct what I've got wrong.

AFP 3.0 was introduced in Mac OS X, with TCP/IP as the primary transport
mechanism, but AppleTalk still supported. Through 10.3.9, Mac OS X had more
or less bidirectional compatibility with AFP 2.x clients (Mac OS X 7.5.3, if
not older, through 9.2.2).

10.4 eliminated the client -- you can't connect to an AppleTalk-based
server. An AppleTalk-based client can still connect, but once machine
discovery is complete, the two computers communicate via TCP/IP, which the
AppleTalk packets are encapsulated within. (This might be true for earlier
OS X versions too, I can't remember.)

10.5 retained AppleTalk only for printing; no file sharing in either
direction.

10.6 excised the last vestiges of AppleTalk. In fact, you can't even connect
to a 10.6 server from an AFP 2.x client via TCP/IP, which mystified me --
one explanation I found was that when an AFP 2.x client connects, even via
TCP/IP, it's still encapsulated AppleTalk, which Snow Leopard wants nothing
to do with.

I'll try the netatalk compile on a few different versions of OS X. My guess
is that whatever AppleTalk headers or libraries or whatever it is that
netatalk is looking for aren't in the same place or available in the same
way.

Hugh Hood

unread,
Sep 17, 2010, 2:17:59 AM9/17/10
to
Ivan,

Your AppleTalk-in-OS X history timeline seems pretty accurate. I must admit
that I find it's sometimes difficult to keep all those changes straight in
my mind.

I'm really looking forward to the results of your attempts to build Netatalk
on the OS X Versions pre-10.6, particularly 10.4 and 10.5, which still have
at least some of the AppleTalk protocols in place in their respective
kernels.

My suspicion is that the real cause of the ever-increasing limitations on
the file serving capabilities in OS X (at least as it concerns the Apple II
and early Macs that use AFP 2.x over AppleTalk) is the AppleFileServer
application (which, AFAIK, was never released to the OpenDarwin source), and
that the AppleTalk coding itself was never crippled or dumbed down between
OS X versions.

If I'm mistaken, I concede that I don't hold much hope for getting Netatalk
_running under OS X_ to serve files to our Apple II computers.

Of course, even if my suspicion is correct and the OS X AppleTalk
implementation (pre-10.6) is still up to the job, someone (you, perhaps)
still has to get Netatalk to interface with it.

Thanks for taking a stab at it. Really.


Hugh Hood


in article C8B7B120.204FB%iva...@yahoo.com, Ivan X at iva...@yahoo.com
wrote on 9/16/10 10:33 AM:

0 new messages