Difference between revisions of "Netatalk"

From ArchWiki
Jump to: navigation, search
(update templates, see Help:Style)
(rebuild for 2.2.2)
Line 1: Line 1:
 
[[Category:Networking (English)]]
 
[[Category:Networking (English)]]
'''Netatalk''' is a free, open-source implementation of the AppleTalk (AFP) suite of protocols. It allows Unix-like operating systems to serve as file, print and time servers for Macintosh computers.
+
'''Netatalk''' v2.2.2 is a free, open-source implementation of the Apple Macintosh network protocols, including AppleTalk (ATalk), Apple Filing Protocol (AFP), and Printer Access Protocol (PAP). It allows Unix-like operating systems to serve as file, print, and time servers for Macintosh computers.
  
==Installation==
+
==Compiling==
There is a netatalk package available in AUR. But the PKGBUILD should be modified to allow the faster CDB backend to be used.  
+
Use the [https://aur.archlinux.org/packages.php?ID=10032 netatalk package available in AUR], which has initscripts tailored for ArchLinux.
  
Add {{Ic|--with-cnid-cdb-backend}} to the {{Ic|./configure}} line.
+
===Choosing Features===
 +
With the deprecation of DDP (ATalk, PAP, timelord, and a2boot), which will be completely removed in v3.0, netatalk has been divided into netatalk and netatalk-ddp, albeit in one (split) package. A normal build of the AUR package will only build the "modern" features cnid_metad and afpd, with Bonjour/Zeroconf support only.
  
Now run makepkg and install the package.
+
To build the full complement of features with SLP support, run {{Ic|makepkg --pkg netatalk-ddp}} instead. The necessary dependencies will be added and resolved. When v3.0 is released, netatalk-ddp will branch to a separate maintenance package.
 +
 
 +
==Installation==
 +
Install your finished package with pacman as usual, and remember to add "netatalk" to the daemons list in {{Ic|/etc/rc.conf}}.
  
 
==Configuration==
 
==Configuration==
Edit the afpd configuration File ({{Ic|/etc/netatalk/afpd.conf}}) and the follwing line to the very end of the file replacing the existing one:
+
===System===
 
+
Edit the afpd configuration file ({{Ic|/etc/netatalk/afpd.conf}}), and add a line similar to
{{hc|/etc/netatalk/afpd.conf|...<br> - -transall -uamlist uams_randnum.so,uams_dhx2.so -nosavepassword -advertise_ssh<br>...}}
+
{{hc|/etc/netatalk/afpd.conf|...<br>- -mimicmodel TimeCapsule6,106 -setuplog "default log_warn /var/log/afpd.log"}}
 
+
This tells netatalk to use the system's hostname, mimic a TimeCapsule, and log warnings and errors to file.
==Configure shared volumes==
+
===Volumes===
To add a shared volume, we have to edit the {{Ic|/etc/netatalk/AppleVolumes.default}}-Configuration file, add a line like this:
+
Edit the volumes configuration file {{Ic|/etc/netatalk/AppleVolumes.default}}, and append the following to add a TimeMachine-like share
 
+
{{hc|/etc/netatalk/AppleVolumes.default|...<br><path_to_share> <sharename> allow:<username> options:usedots,upriv,tm}}
{{hc|/etc/netatalk/AppleVolumes.default|...<br><path_to_share> <sharename> allow:<username> cnidscheme:cdb options:usedots,upriv<br>...}}
+
* The {{Ic|volsizelimit:<limit_in_whole_mebibytes>}} argument can be useful here to limit the total space reported to TimeMachine.
 
+
* If you wish to turn off "home" shares, change the {{Ic|~}} line to {{Ic|#~}}.
{{Warning|Avoid nesting volumes, do not share directories, which are filed under already shared directories}}
+
{{Warning|Avoid nesting volumes, and do not share directories by any other protocol. All file changes must be made via afpd only}}
 
+
{{Note|If you you use {{Ic|cnidscheme:cdb}} be sure to start {{Ic|/etc/rc.d/cnid}} with afpd.}}
+
 
+
==Enable Time-Machine Support==
+
To enable Time-Machine-Support just add {{Ic|tm}} to the options for the volume in {{Ic|/etc/netatalk/AppleVolumes.default}}.
+
 
+
==Enable Autodiscover==
+
To enable Autodiscover (your osx systems see your netatalk-server in the finder), we have to install avahi and nss-mdns
+
 
+
#pacman -S avahi nss-mdns
+
 
+
Now configure the nss service ({{Ic|/etc/nsswitch.conf}}) and add {{Ic|mdns}} to the {{Ic|hosts:}}-line so it looks like this:
+
 
+
{{hc|/etc/nsswitch.conf|...<br> hosts: files dns mdns4 mdns<br>...}}
+
 
+
Create a new service configuration file ({{Ic|/etc/avahi/services/afpd.service}}):
+
 
+
{{hc|/etc/avahi/services/afpd.service|2=
+
<?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>
+
      <type>_device-info._tcp</type>
+
      <port>0</port>
+
      <txt-record>model=Xserve</txt-record>
+
    </service>
+
</service-group>
+
}}
+
  
==Make it work with Lion==
+
==Enable Bonjour/Zeroconf==
When you try to mount a shared drive with Lion, if you get the message "The version of the server you are trying to connect to is not supported", it's because AFP DHX2 Authentication is not supported, which Lion requires. It can be configured when building pre-2.2 versions of netatalk, or you can just install netatalk-git instead.
+
Bonjour/Zeroconf is now a requirement of netatalk and is compiled by default. No configuration is necessary, netatalk will register its own services using the dbus link. Make sure you set {{Ic|-mimicmodel}} to the desired string (see {{Ic|/System/Library/CoreSerivces/CoreTypes.bundle/Contents/Info.plist}} on a Mac for a full list).

Revision as of 23:05, 8 April 2012

Netatalk v2.2.2 is a free, open-source implementation of the Apple Macintosh network protocols, including AppleTalk (ATalk), Apple Filing Protocol (AFP), and Printer Access Protocol (PAP). It allows Unix-like operating systems to serve as file, print, and time servers for Macintosh computers.

Compiling

Use the netatalk package available in AUR, which has initscripts tailored for ArchLinux.

Choosing Features

With the deprecation of DDP (ATalk, PAP, timelord, and a2boot), which will be completely removed in v3.0, netatalk has been divided into netatalk and netatalk-ddp, albeit in one (split) package. A normal build of the AUR package will only build the "modern" features cnid_metad and afpd, with Bonjour/Zeroconf support only.

To build the full complement of features with SLP support, run makepkg --pkg netatalk-ddp instead. The necessary dependencies will be added and resolved. When v3.0 is released, netatalk-ddp will branch to a separate maintenance package.

Installation

Install your finished package with pacman as usual, and remember to add "netatalk" to the daemons list in /etc/rc.conf.

Configuration

System

Edit the afpd configuration file (/etc/netatalk/afpd.conf), and add a line similar to

/etc/netatalk/afpd.conf
...
- -mimicmodel TimeCapsule6,106 -setuplog "default log_warn /var/log/afpd.log"

This tells netatalk to use the system's hostname, mimic a TimeCapsule, and log warnings and errors to file.

Volumes

Edit the volumes configuration file /etc/netatalk/AppleVolumes.default, and append the following to add a TimeMachine-like share

/etc/netatalk/AppleVolumes.default
...
<path_to_share> <sharename> allow:<username> options:usedots,upriv,tm
  • The volsizelimit:<limit_in_whole_mebibytes> argument can be useful here to limit the total space reported to TimeMachine.
  • If you wish to turn off "home" shares, change the ~ line to #~.
Warning: Avoid nesting volumes, and do not share directories by any other protocol. All file changes must be made via afpd only

Enable Bonjour/Zeroconf

Bonjour/Zeroconf is now a requirement of netatalk and is compiled by default. No configuration is necessary, netatalk will register its own services using the dbus link. Make sure you set -mimicmodel to the desired string (see /System/Library/CoreSerivces/CoreTypes.bundle/Contents/Info.plist on a Mac for a full list).