This is the Weblog of Mediaproducer
Matthias Kretschmann more...

19thJun 08

HowTo: Make Ubuntu A Perfect Mac File Server And Time Machine Volume [Update2]

Ubuntu Mac File Server ConnectivityFor quite some time I use my Ubuntu machine as a file and backup server for all Macs in my network which is perfectly accessible from the Finder in Mac OS X. There are some instructions available in the web for this task but all failed in my case so I wrote my own tutorial with all the steps needed for it to work properly.

So here’s my little Tutorial for connecting Mac OS X Leopard with Ubuntu and using your Ubuntu machine as a backup volume for Time Machine but all steps can be reproduced on every Linux box and they work with Mac OS X 10.4 Tiger too. At the end of this tutorial you will have a server which shows up in the Finder sidebar and behaves just like a Mac server when accessing it from your Macs. To be perfectly integrated with Mac OS X we’re going to use Apple’s Filing Protocol (AFP) for network and file sharing.

Although this Tutorial involves using the Terminal in Ubuntu and looks a bit geeky it’s very easy even for beginners. I have tried to explain all steps and Terminal commands so you may learn a bit about the Terminal too. At the end of the article you can download my Server Displays icon pack quickly made by me with custom icons for a Mac, Ubuntu and Windows server.

Personally I use a fresh installation of Ubuntu 8.04 Hardy Heron Desktop version (32bit on one machine, 64bit on the other) and Mac OS X Leopard (10.5.3 and later) to connect to them. On my Ubuntu boxes there’s no other file sharing protocol like samba (Windows sharing) or NFS activated.

Here are the steps involved in setting up your Ubuntu box as a Mac file server:

1. Modify and install Netatalk (Open Source AFP implementation)
2. Configure Netatalk
3. Configure shared volumes (and Time Machine volume)
4. Install Avahi (Open Source Bonjour implementation)
5. Configure Avahi and advertise services
6. Configure TimeMachine
7. Conclusion, Problems and more informations
8. Downloading and using the Server Display Icons
9. Article History

1. Modify and install Netatalk

Netatalk iconNetatalk is the Open Source implementation of AFP. Mac OS X requires encryption to work properly but the standard package of netatalk provided in the Ubuntu repositories doesn’t include this feature. So we have to build our own netatalk package from the sources with the encryption feature enabled.

First you have to enable the Source Code repositories via System > Administration > Software Sources under the Ubuntu Software tab. Check the Source Code Box, click Close and choose Reload in the next dialogue.

Source Code Repositories

Update 09/28/2008: Alessandro has built a nice .deb package for i386 machines. Although written in italian you can follow the necessary code snippets for installing this package in his blog post. If the install package works for you just skip the following self compiling process and head over to the Configure Netatalk section.

Now fire up your Terminal under Applications > Accessories and execute the following lines (separately). You have to type Y for yes when Terminal asks you if it should continue:

sudo apt-get build-dep netatalk
sudo apt-get install cracklib2-dev fakeroot libssl-dev
sudo apt-get source netatalk
cd netatalk-2*

Now you have downloaded the source code of Netatalk to your home folder, installed some required packages for building Netatalk and changed the directory to the downloaded folder.

Next you have to build the Netatalk package with the encryption option enabled:

sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot

Depending on your hardware this may take a while but you can enjoy the geeky build output in your Terminal:

Building Netatalk

If everything went through without errors (except the signing warnings, can be ignored) you can install the recently created package:

sudo dpkg -i ~/netatalk_2*.deb

To stop Ubuntu from overwriting your custom Netatalk package you should set its state to hold. This will cause the Netatalk package being grayed out in the Software Update dialogue:

echo "netatalk hold" | sudo dpkg --set-selections

Now you have successfully build and installed your custom Netatalk package which now has support for encrypted logins. Now let’s configure the whole thing.

2. Configure Netatalk

Netatalk iconFirst you should deactivate services provided by Netatalk which are not needed if you just want to use your Ubuntu box for file sharing. This will speed up the response and startup time of Netatalk dramatically. For instance Netatalk starts the old AppleTalk protocol by default which is just needed for pre OS X systems. So we’re going to use the graphical editor gedit for stopping unneeded services:

sudo gedit /etc/default/netatalk

gedit should pop up with the defined file loaded as superuser (needed for saving). Find the “#Set which daemons to run” part and replace the default values with these to enable just AFP and disable all unneeded services. Let the cnid_meta daemon run too and if you want to share your Linux connected printer with your Mac also enable the pap daemon (set to yes):

ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no

Here it’s very important to run the cnid_meta daemon because this service will handle all the metadata for us (namely the reosurce fork) which would get lost due to the fact that your Linux box isn’t formatted as Apple’s HFS+. If you’re interested what the other services could do: atalkd is the AppleTalk daemon (pre-OSX file sharing, old printing), timelord can make your Linux box a network time server and please don’t ask me for what a2boot is good for (If you know it, post it in the comments please / Kelly suggests it’s a netboot server for client Macs).

Press Ctrl + S to save the document or choose File > Save. Next we have to edit the main config file for AFP sharing called afpd.conf:

sudo gedit /etc/netatalk/afpd.conf

Scroll to the very bottom of the document and add this to the bottom (replace the whole line in case there’s already one). This is one line so be sure that there’s no line break in your afpd.conf file:

- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh

Press Ctrl + S to save the document or choose File > Save.

3. Configure shared Volumes

Time Machine Volume iconNow we have to tell the afpd daemon what Volumes to share. This is defined in the AppleVolumes.default file inside /etc/netatalk/. The following line will open this file in the gedit editor with superuser privileges (required for saving) where we can define our shared volumes:

sudo gedit /etc/netatalk/AppleVolumes.default

Scroll to the bottom of the document and define your Volume shares. By adding the following line you will share each users home directory with the user name as the Volume name. To make things more secure you can define all users who are allowed to connect to your Ubuntu box via AFP:

~/ "$u" allow:username1,username2 cnidscheme:cdb

Because we want to use the Ubuntu machine as a backup server for Time Machine you should define a second volume just for Time Machine. Create a new folder in your home directory first and name it TimeMachine (or anything you like). Then add the following line to your AppleVolumes.default. This is one line so be sure that there’s no line break in your AppleVolumes.default file:

/home/username/TimeMachine TimeMachine allow:username1,username2 cnidscheme:cdb options:usedots,upriv

Thanks to tsanga for pointing out the usedots and upriv options. The usedots option is required if you want to use invisible files and folders (those starting with a dot in the name). Otherwise afpd would encode them as :2e which is bad if you have to use invisible files (like .htaccess). If you’re on Leopard and have no Tiger installed Macs in your network or mixed OS X versions in your network you should use the upriv option which adds support for AFP3 unix privileges. If you have Macs with Tiger installed just use options:usedots to avoid unexpected behavior:

/home/username/TimeMachine TimeMachine allow:username1,username2 cnidscheme:cdb options:usedots

Finally if you want more stability and can accept slower file transfers you can use the dbd cnidscheme (cnidscheme:dbd).

Press Ctrl + S to save the document or choose File > Save. Of course you can define every folder you like or even an attached USB disk. Just define the correct path. External drives in Ubuntu should be found under /media

Finally restart Netatalk to activate the changes:

sudo /etc/init.d/netatalk restart

Although we now have a fully configured AFP file server it will not show up in the Finder sidebar on Mac OS X Leopard (but it’s reachable via Go > Connect to Server… in the Finder). Macs use a service called Bonjour for the sidebar thing (and for a lot of other cool stuff) and on the Linux side we can have this functionality with the Open Source implementation of Bonjour, called Avahi.

4. Install Avahi

Bonjour iconSo the Avahi daemon will advertise all defined services across your network just like Bonjour do. So let’s install the avahi daemon and the mDNS library used for imitating the Bonjour service. When fully configured this will cause all Macs in your network to discover your Ubuntu box automatically:

sudo apt-get install avahi-daemon
sudo apt-get install libnss-mdns

To make everything work properly you have to edit the nsswitch.conf file:

sudo gedit /etc/nsswitch.conf

Just add “mdns” at the end of the line that starts with “hosts:”. Now the line should look like this:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns

Press Ctrl + S to save the document or choose File > Save.

5. Configure Avahi and advertise services

Bonjour iconNext we have to tell Avahi which services it should advertise across the network. In our case we just want to advertise AFP sharing. This is done by creating a xml-file for each service inside /etc/avahi/services/ following a special syntax. Let’s create a xml-file for the afpd service with the following line:

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

A blank document should open in gedit. Now paste the following into the document and save the file by pressing Ctrl + S or by choosing File > Save:


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

update: The last part is used to assign a specific (Apple) hardware model to your Linux box. In this example your server will be advertised as an XServe and will be shown with this icon in the Finder sidebar. This will come in handy when you want to use your own icon for it or the one’s made by me provided within this article. Thanks to Simon Wheatley for figuring this out. Additionally you can use these models in this file: RackMac (same as Xserve), PowerBook, PowerMac, Macmini, iMac, MacBook, MacBookPro, MacBookAir, MacPro, AppleTV1,1, AirPort

Finally restart the avahi daemon to activate all changes:

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

Now you have configured the Avahi daemon to advertise AFP sharing across your network which will cause your Ubuntu box to show up in Finder’s sidebar in Mac OS X Leopard. In Mac OS X 10.4 Tiger your Ubuntu server should now be visible under Network.

Now you’re done with setting up AFP file sharing on your Ubuntu box and advertising it across the network for Finder’s sidebar. Check if everything works as intended by clicking on your Ubuntu server in Finder and clicking on the “Connect As” button. Enter your username and password (the ones you’re using on your Ubuntu machine) and you should see the Volumes we defined earlier with the AppleVolumes.default file:

Netatalk shares

Another side effect of using AFP is that your Ubuntu box will show up as a nice Apple Cinema Display icon instead of the BSOD windows icon. Here you see my Ubuntu server showing up in Finder as Rockhopper:

Ubuntu box in Finder

update: If you’ve followed the revised version of this article your Linux box should now be represented by a Xserve icon in Finder:

Ubuntu box as Xserver in Finder

6. Configure Time Machine

Time Machine iconupdate 07/14/2008: On the Mac side you have to enable the option to use network volumes as Time Machine drives first. Without it your freshly shared and advertised network volume won’t show up in the disk selection dialogue in Time Machine. This is a hidden option not accessible via the graphical user interface so you have to copy & paste this in Terminal (it’s one line):

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

Thanks to FoolsRun and tsanga for pointing this out in the comments

Now just mount the “TimeMachine” Volume first and choose it as a backup disk in the Time Machine system preferences. Time Machine will create a sparsebundle disk image inside the volume and mounts that too. This is needed because the hard drive on your Ubuntu box is formatted as ext3 or Reiserfs and not the native Mac format HFS+. Because Time Machine backups everything to the disk image all metadata (like creation dates etc.) will be preserved.

When your first Time Machine backup is done you can remove all Volumes and the next time Time Machine starts it will automagically mount the disk image from your TimeMachine volume on your Ubuntu box without mounting the whole TimeMachine volume:

Finder sidebar

7. Conclusion, Problems and more informations

You see that Linux and Ubuntu can be configured to behave like Macs in your network. But it’s sad, that you have to fire up the Terminal to achieve this. I hope especially the Ubuntu team will simplify this in future versions. Another sad thing is that Ubuntu is missing a useful avahi/Bonjour and AFP implementation for Nautilus, the file manager. So there’s no way to access your Mac from Ubuntu via AFP in the file manager. In my network I use SSH to access the Macs from Ubuntu or Linux by allowing Remote Login on the Macs in the Sharing preferences. But there’s a command line based AFP client available called afps-ng which uses the FUSE system.

Some other strategies of connecting Ubuntu/Linux and Mac OS X would involve sharing via Samba (Windows sharing) or NFS but according to my experiences nothing beats the speed, stability and secureness of AFP.

But if you’re interested you can have a look at this post on the ubuntuforums to learn how to setup NFS for file sharing between Ubuntu and Mac OS X Leopard.

Although I have checked all log files while using file sharing and especially while Time Machine is running and found no errors or warnings I cannot guarantee it’s working without errors or backup data loss on your system too. So I encourage you to check the system logs on Ubuntu AND on Mac OS X with the Console app in your Utilities folder. If you see no errors or warnings this configuration should be pretty bullet proof in terms of stability.

Finally the only problem remaining is that your Ubuntu or Linux box isn’t formatted as journaled HFS+ so some scenarios would fail or make problems. This can include having your iTunes, iPhoto or Aperture library on your Ubuntu server. But the cnid_meta daemon will always try handle that for us. This will cause some hidden folders to show up in Ubuntu which are used to store all the metadata required to almost reproduce a HFS+ file system. But if you ever run into problems you can easily resolve these by creating sparse disk images on your server with the Disk Utility built into Mac OS X. Just create a new sparse disk image on your desktop, copy it to your mounted Ubuntu volume and mount the copied disk image by double clicking it. Now you can put all the files and libraries in it which depends on HFS+

update 07/06/2008:

Problems with creating the backup disk image

If time Machine says “The backup disk image could not be created” during the first backup attempt you can do the following to avoid this problem and some others (backup fail due to permissions):

In short, you have to create the backup disk image on your Desktop and copy it to your mounted Time Machine volume. But Time Machine creates a unique filename for the disk image and we can find out this name with a little trick:

First open up the Console from your Applications > Utilities folder and open the Time Machine preferences. In Time Machine preferences set your backup volume back to none. After that reselect your mounted Time Machine volume. The counter should start and Time Machine’s big button will change to on. When the backup tries to start and fail have a look at your Console (Click All Messages in the sidepane). There should be a line tellung you the name of the disk image:

Creating disk image /Volumes/TimeMachine/computername_0014e3856bd0.sparsebundle

The computername should be the name you have assigned to your Mac. Now just click on that line and hit command + C to copy the message.

Now Open Disk Utility from your Applications > Utilities folder and click on New Image in the toolbar. Now just hit Command + V in the Save As field and remove everything before the name of the sparsebundle.

Update: The secret number Time Machine adds to your computer name is nothing more than your network devices MAC address, as Simulacrum found out in the comments. As he points out you can open up Network Utility and under the info tab you’ll find a field called “Hardware Address”. Just remove the colons and you have the number Time Machine adds to the disk image name.

In the field volume name write Backup of computername. Now first chose sparse bundle disk image as the image format and adjust the volume size to the size of your internal harddrive (minimum, choose more if you like) afterwards. Remember that Disk Utility won’t let you make a bigger image file as you have physical hard drive space available if you don’t chose sparse bundle disk image as the image format first. For reference have a look at this screenshot:

Time Machine sparse bundle disk image

Select your Desktop as destination and click create. After the creation is finished drag the created disk image to your mounted Time Machine volume (you can delete the disk image on your desktop when copy is finished). Finally go to Time Machine preferences and start your backup again and everything should work as expected now. After the first backup (this can take a long time depending on your harddrive) you can unmount your Time Machine volume and the next time Time Machine starts it will grab and mount the sparse bundle disk image automatically (with “Backup of computername” as the volume name).

update 09/21/2008:

Firewall Settings

As Kevin points out in the comments you would have to adjust any firewall you use. But the standard Ubuntu installation won’t use any Firewall.

In short you have to allow communications over port 548 and 5353.

“Connection Failed”

If you get one of those errors:

"Connection Failed - There was an error connection to the server. Check the server name or IP address and try again"

or

"There was an error connecting to the server. Check the server name or IP address and try again. If you are unable to resolve the problem contact your system administrator."

you should first be sure you have either no firewall on your Ubuntu box in use or have it configured to allow AFP communications as suggested in the above paragraph.

Remember that this error can be caused by a myriad of problems and just a lot of other configurations on your side. So you should try a minimal way: On my Ubuntu boxes I have no other file sharing protocol like samba or NFS enabled (even not installed) so the samba hostname and the AFP hostname can’t interfere with each other. Also I’ve left the Workgroup field blank under System > Administration > Network > General tab.

If you still can’t connect to your Ubuntu box you can edit your /etc/hosts file as I’ve pointed out in the comments:

sudo gedit /etc/hosts

Add the following two lines at the very top of the file.

127.0.0.1 localhost
127.0.1.1 Rockhopper.local Rockhopper

My server is named Rockhopper, adjust the name according to your server name. There should be some sort of name already but the important part here is the servername.local which is the AFP way of server names. If there are any other numbers at the beginning in your file leave them as they are.

If that won’t solve the connection problems you can test out Eric’s solution as suggested in the comments which would involve removing and reinstalling netatalk.

Sorry I can’t give you any other solutions for that but in most cases it’s some sort of network misconfiguration outside of netatalk or avahi and on Linux these can be a lot of configurations on your side I can’t know of. And since I’m not able to reproduce these errors I can’t investigate in them.

But for those people still having problems with these error messages: On Mac OS X have a look in the Console app inside your Utilities folder. Click on “All Messages” in the left sidebar, try to connect to your Ubuntu box in Finder and see the messages in Console. These are the “real” error messages which normally will lead you to a solution.

-5014 error

Some people have problems when connecting to an AFP share and get a -5014 error. As J5 pointed out in the comments you have to delete the hidden .AppleDB folders on your Ubuntu box and restart netatalk afterwards:

sudo /etc/init.d/netatalk restart

Time Machine Full System Restore

In case of a full system restore you would have to boot your Mac from the Mac OS X installation DVD (the one delivered with your Mac) by pressing the c key during boot. Your Mac will start with a minimal UI where you have a Utilities section in the top menu bar. There you’ll find “Restore from a Time Machine Backup” but it won’t find your network share with your Time Machine backup. Luckily Dmitry Nedospasov found a way to manage this by simply mounting your Time Machine network share with the Terminal (which you can find under Utilities in the menu bar too) by utilizing the following syntax (shamelessly copied from Dmitry):

mount -t afp afp://username:password@hostname/ShareName /Volumes/ShareMount

Replace everything instead of /Volumes with your matching names. You can test if your network share was properly mounted by doing

ls /Volumes

which outputs the content of the Volumes folder and you should see your network share.

Now you can close the Terminal and select “Restore from Time Machine Backup” from the Utilities entry in the menu bar and select your mounted Time Machine backup and thats it. Oh, needless to say: a gigabit ethernet connection will speed things up dramatically even compared to (draft)n-WLAN.

More Articles

8. Downloading and using the Server Display Icons

Ubuntu Server DisplayI’ve quickly crafted a custom icon for your Ubuntu server. It’s the Apple Cinema Display with the default wallpaper of Ubuntu 8.04 called Hardy Heron. Additionally I’ve included an icon with the default Leopard and the default Vista wallpaper to represent your Leopard and Windows server too (The default Mac server icon uses the old Tiger wallpaper).

Here you can see the icons included in the Server Displays icon pack:

Server Displays

Because I’ve just modified Apple’s standard icons these icons are just available via this blog post and they will not show up in my Goodies section. Just download the whole package directly via this link:

v1.0 | 4 icons | zip-file | 5.5MB

How to use the icons

In the avahi configuration part in this article you have assigned the Xserve device info to your afpd.service file. All you have to do is to replace the generic Xserve icon (or whatever model you have assigned in your afpd.service file) with an icon from this icon package. Just rename the Ubuntu Server.icns to com.apple.xserve.icns and navigate to

/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources

Drag & drop the renamed file into this path and replace the generic icon (making a backup before doing that is a good idea) and after a logout all your avahi advertised Ubuntu servers should be displayed with the new icon (assuming that you assigned a device model in avahi).

If you’ve used another model in your afpd.service file, browse the Resources of CoreTypes.bundle to get to know the correct filename for the device icon and replace that file.

As for the Windows Vista server icon: Just rename the Windows Server.icns file to public.generic-pc.icns and navigate to

/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources

Now drag & drop the renamed file into this path and replace the generic icon (making a backup before doing that is a good idea) and after a logout all your Windows servers should be displayed with the new icon.

update: A solution for the icon problem is here: Simon Wheatley figured out how to assign a different icon to your avahi advertised Linux box. All you have to do is assigning a device info part at the end of the avahi service file for AFP. I’ve updated this article to include this part. Please head back to the Configure Avahi and advertise services part in this article and edit your afpd.service file again if you’ve followed the first revision of this article.

Oh no!

Congratulations! You finally arrived at the end of my article. There’s a good chance that your coffee or tea cup is now empty. But before making your next coffee you should share this article on your favorite social website. Your vote is highly appreciated! After you’ve finished voting and making your next coffee or tea you could subscribe to my RSS- or Atom-Feed, discuss this article or buy me my next coffee ;-)

9. Article History

Update 1 - 06/21/2008:

  • added instructions for changing the server icons in Mac OS X

Update 2 - 07/06/2008:

Update 3 - 07/14/2008:

Update 4 - 09/21/2008:

Update 5 - 09/28/2008:

  • added a link to the precompiled Netatalk .deb package from Alessandro

-

Tags: , , , , , , , , , , , , , , , , , ,




Apple Store

Related Posts



185 Responses to “HowTo: Make Ubuntu A Perfect Mac File Server And Time Machine Volume [Update2]”

  1. JS says:

    Sweet! Thanks! Despite having purchased an external TimeMachine 2.5″ disk, this might still come in handy! And, btw, the console isn’t a dirty thing, it’s, in fact, the almighty thing that makes all things work. ;)

  2. WPF says:

    Wow! I have been scouring the internet for these kind of instructions for weeks. I still had to create the sparsebundle on my own a la this page: Time Machine Wireless Backup Continued…, but it seems to be working as I write this. Thanks!

  3. krema says:

    Thank you JS and WPF. Glad I was able to help you with this tutorial.

    And JS, indeed the console (or the Terminal on Mac OS X) is the almighty thing but it can be pain. Especially if you see that all this just requires one single checkbox in Leopard. By the way: you can attach your recently purchased 2.5” disk to your ubuntu box with hfs+ formatted and use that as Time Machine volume over network. You just have to install the HFS+ package from the repositories in Ubuntu.

    And thanks for the coffee WPF! ;-)

  4. tsanga says:

    Thanks! This is awesome. Can’t wait to try it.

    I have found some documentation that says AppleVolumes.default also needs “options:upriv,usedots”.

    See, as an example (under “Setup”):
    http://www003.upp.so-net.ne.jp/hat/netatalk/debian40.html

    Should these be added?

    Here’s another reference why usedots may be necessary:
    http://www.simonwheatley.co.uk/2008/04/06/netatalk-hex-encoded-dot-files/

    As for upriv, what I can gather is that it should be turned on for OS X (uses AFP3).

  5. krema says:

    Hi tsanga, many thanks for pointing this out. I’ve updated the article under the Configuring shared volumes part. Indeed the usedots options is required if you’re going to use invisible files like Simon Wheatley in your provided link.

    As for upriv: Setting this option would break the compatibility with Mac OS X 10.4 (Tiger) or would lead to unexpected behavior on the Mac side when accessing the AFP volumes on your linux box. But if you’re on Leopard you can use this option to add support for AFP3 unix privileges which are just supported since Leopard. This would enable you to fine tune the permissions for your shared volumes (like who has in which directory or on which file on your volume just read access). I would advise to just use it when all the Macs accessing your linux box have Mac OS X 10.5 Leopard installed.

    For reference you can have a look at the AppleVolumes.default section in the Netatalk online manual where all available options with their descriptions are listed.

  6. tsanga says:

    krema,

    OK, thanks for the tips!

  7. krema says:

    You’re welcome! And many thanks for the delicious coffee ;-)

  8. tsanga says:

    krema,

    One more thought - regarding the comment to install the HFS+ package to use JS’s HFS+ formatted disk.

    I thought that Ubuntu will not write to a HFS+ journaled disk. Has that changed?

    If JS did a local TM backup with that disk, most certainly it was already formatted HFS+ journaled.

  9. krema says:

    yes, you’re right tsanga and Ubuntu has support for HFS+ included in the Kernel since Feisty so in fact no package installation should be required. But it still has read/write support just for non-journaled HFS+ (waiting for this since 2005!) :-( Interesting enough everything the developers need to know about implementing this functionality is available from Apple.

    But you can simply turn journaling off on the fly without reformatting your disk either through Disk Utility or in Terminal with sudo diskutil disableJournal /Volumes/VOLUMENAME (on the Mac)

    But doing so assumes you know what journaling is good for. Apple’s recommendation is as follows:
    “If your server contains high-bandwidth usage data files, such as large video, graphics, or audio files, you may want to weigh the benefits of using journaling against the performance needed to access your data. In most cases, the impact of journaling upon data access performance are unnoticeable to users, but its implementation may not be practical for servers where data access demands outweigh its benefits.”

    But I guess you already knew all this ;-) Just thought it’s a good idea to write this down for future readers.

  10. tsanga says:

    That is great reference information.

    I guess ultimately what I’m hoping for, is that by writing to a HFS+ formatted drive, I can restore the backup to the Mac using a direct connection (e.g. USB, Firewire) vs. having to do it over the network through the Linux box.

    I have not personally restored anything from TM but I read that it won’t restore from a directly-connected drive that’s not formatted HFS+ (Journaled).

  11. krema says:

    Since Time Machine doesn’t backup to non-HFS+ disks when directly connected I would say that it won’t restore from them too, regardless of journaled or non-journaled. An interesting test would be to use an external drive with ext3 formatted (just like the Ubuntu harddrive, readable with MacFuse), running Time Machine over AFP/Netatalk and trying to restore it when directly connected to the Mac. But I guess this way we would loose all the metadata (everything the cnid_meta daemon stores) which would make the restore fail.

    But since wired ethernet today is (or can be) faster than USB/Firewire the network backup and restore seem to be a better choice. ;-)

  12. tsanga says:

    I’m going to try this experiment:

    Backup via network to an external drive formatted HFS+ (NOT Journaled) attached to my Ubuntu system.

    Then try and restore the HFS+ (NOT Journaled) drive directly connected via USB.

    This should work because I think by design, TM will use a sparseimage structure any time the backup is performed over the network (regardless of format), vs. using a directory structure when the drive is directly connected.

    By this logic, using an ext3 formatted drive should work too. But the benefit of the HFS+ formatting is then when booting from the Leopard DVD, no other package will need to be installed before being able to read the external drive.

    P.S. No Gigabit yet. :(

  13. Abe says:

    I am stuck. Please help me. I really do not understand linux but I wanted to do this to get familiar with using the terminal, in linux and in OS10.

    abe@abe-desktop:~/netatalk-2.0.3$ sudo DEB_BUILD_OPTIONS=ss1 dpkg-buildpackage -rfakeroot
    dpkg-buildpackage: warning: using a gain-root-command while being root
    dpkg-buildpackage: set CPPFLAGS to default value:
    dpkg-buildpackage: set CFLAGS to default value: -g -O2
    dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
    dpkg-buildpackage: set FFLAGS to default value: -g -O2
    dpkg-buildpackage: set LDFLAGS to default value: -Wl,-Bsymbolic-functions
    tail: cannot open `debian/changelog' for reading: No such file or directory
    dpkg-buildpackage: failure: tail of debian/changelog gave error exit status 1

    Please advise!

  14. krema says:

    Abe, Are you using ss1 instead of ssl in the first line? It should be DEB_BUILD_OPTIONS=ssl

  15. tsanga says:

    krema,

    Works great, except….

    Avahi seems to be working well for me, since my Xserve icon shows up in the Finder sidebar whenever the Ubuntu machine is on.

    However, the only way I can ever successfully connect to the Ubuntu share is if I first manually log onto Ubuntu and restart netatalk with:
    sudo /etc/init.d/netatalk restart

    Once I do this one time, then everything seems to work. But if I restart the Ubuntu box, then I have to do this step again.

    Any ideas?

    EDIT: I’m not the only one with this issue.
    https://bugs.launchpad.net/ubuntu/+source/netatalk/+bug/176472

  16. yuskovitz says:

    Hi,

    Fantastic tutorial! Avahi and Netatalk on ubuntu work absolutely fine with my MBP. Unfortunately TM does not work for me at all - what am I missing? How can I go about this mountpoint ownership?

    Jul 4 03:57:35 mbpro /System/Library/CoreServices/backupd[367]: Backup requested due to disk attach
    Jul 4 03:57:35 mbpro /System/Library/CoreServices/backupd[367]: Starting standard backup
    Jul 4 03:57:35 mbpro /System/Library/CoreServices/backupd[367]: Network mountpoint /Volumes/AgTimeMachine not owned by backupd… remounting
    Jul 4 03:57:35 mbpro /System/Library/CoreServices/backupd[367]: Failed to remount network volume.
    Jul 4 03:57:40 mbpro /System/Library/CoreServices/backupd[367]: Backup failed with error: 19

    please help before I go completely mad…

    Y.

  17. Alex says:

    I got this error from time machine:
    “The backup disk image could not be created”
    Any help?

  18. tsanga says:

    Figured it out!

    I had to disable “roaming mode” in NetworkAdmin. Seems like something with roaming mode wasn’t making eth0 available to netatalk at startup. With it turned off, netatalk starts properly in the few times I’ve rebooted.

    Reference:
    https://help.ubuntu.com/community/NetworkAdmin

    @Alex,

    I found that I still needed to first use the hack to enable unsupported network volumes, and second, to create the sparsebundle image locally before putting the volume on the network.

  19. krema says:

    tsanga, very uncool bug. You could write a little bash script which starts netatalk and make this script a startup program. And thanks for the hint with the local sparse bundle disk image ;-) Is everything working now?

    edit: Hi yuskovitz and Alex. I’ve updated the article with a solution for the problems you both have under the Conclusion part. Sorry for my first suggestions to you both. I’ve tested them and they won’t work (those stuff between the nonsense tags).

    And by the way, I hope all of you have the latest Mac OS X update installed… Versions prior to 10.5.3 can cause a lot of conflicts with Time Machine network backups…

    <nonsense>Hi yuskovitz, seems like your Time Machine Volume and the sparse disk image have the wrong permissions. Maybe this will solve it: Mount your Time Machine Volume via Finder, rightclick on the volume > Get Info. There you can change the permissions down the window. Make sure that all owners who are going to use Time Machine have read & write access to that volume and are listed in the Get Info window. If it won’t work try to leave the upriv option out of your AppleVolumes.default.

    Hi Alex, same for you. Check the permissions of the Time Machine volume first, add your login user with read/write access and try to select it again as a Time Machine volume.</nonsense>

  20. FoolsRun says:

    Hi,
    First of all, thanks a lot for this article. I’d managed to figure all this out on my own from various resources, but it’s great to have a single source to both bookmark and reference for friends and colleagues who want to set up the same thing.

    I noticed, however, that you don’t include the “unsupported volumes” hack in this tutorial; is this hack no longer necessary to use Time Machine on network volumes, or does advertising the server as an “Xserve” somehow cause it to work? I’ve never gotten Time Machine to “see” network volumes without the “unsupported volumes” hack (referenced here)

  21. de-escalator says:

    This is genius (I say before finishing). I kept getting an error message:

    “sudo: DEB_BUILD_OPTIONS=ssl: command not found”

    with your command:

    sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot

    So I tried the Ubutnu forums and found this variation which seems to be working fine right now:

    DEB_BUILD_OPTIONS=ssl sudo dpkg-buildpackage -rfakeroot

    Here’s the thread:

    http://ubuntuforums.org/archive/index.php/t-347019.html

  22. coucou78 says:

    very cool guide , yes !

    does netatalk supports ACL (extended)

    ie : Xserve:/raid0/Commun # getfacl Reseau/
    # file: Reseau/
    # owner: root
    # group: root
    user::rwx
    user:root:rwx
    group::rwx
    group:root:rwx
    group:Commun_RW:rwx
    group:Commun_R:r-x
    mask::rwx
    other::—
    default:user::rwx
    default:user:root:rwx
    default:group::rwx
    default:group:root:rwx
    default:group:Commun_RW:rwx
    default:group:Commun_R:r-x
    default:mask::rwx
    default:other::—

    ?

  23. enduser says:

    At the first terminal step I type:
    sudo apt-get build-dep netatalk
    and I get this message:
    Unable to find a source package fr netatalk
    ? what am I doing wrong?

  24. Nath says:

    enduser: You need to edit your sources.list:
    sudo vi /etc/apt/sources.list

    Check that you have a source repository enabled
    e.g deb-src http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse

    Then update your packages
    sudo apt-get update

    Then you’ll be able to get the source packages.

    This is a great article - if you make sure you read every step then it works perfectly. I got this working on Mint Linux 5 Elyssa.

  25. enduser says:

    I am sorry I really don’t know my way around a terminal, so I don’t even understand what parts of Nath’s instructions are code, what parts are just notes, and what to expect to change when I enter these things into the command line. I really want to make this work and it is embarrassing I can’t get past the first step.

  26. krema says:

    Hi FoolsRun, theoretically Time Machine won’t need this hack anymore since version 10.5.2 (I believe). But it seems like some people have to use it anyway to get network backup to work. I will test this with a new Leopard installation and will report the results. But thanks for linking to the hack resource!

    Hi de-escalator, this is interesting since I had no problem with this line of code. Good you figured it out and posted it here. Thanks!

    Hi coucou78, It should support ACL because of the upriv option we set in the AppleVolumes.default file but this seems not to work as expected. I also can’t change the permissions and this is causing the problem with the creation of the TimeMachine volume (Leopard tries to change the permissions while creating the sparse bundle image). Seems like we have to wait for a new Netatalk version…

    Hi enduser, please read the second paragraph under 1. Modify and install Netatalk. I wrote how you can enable the source repositories the graphical way. Even with a screenshot. You did that?

    Hi Nath, thanks for helping out while I’m away ;-)

  27. enduser says:

    krema, thanks for helping me with this I am sorry I am a real beginner with all of this. I did do the first part of step 1 before going to the terminal. I didn’t want to clutter up you site with my lack of skills so I posted a thread on the ubuntu forum. http://ubuntuforums.org/showthread.php?p=5355794#post5355794
    You have put together really clear instructions and I am very thankful for them, to often I get help suggestions that are over my head and therefore not actually productive in helping me learn how to fix my issues.

  28. tsanga says:

    krema,

    For the record, I’m running the latest Leopard 10.5.4 and I had to use the hack for TM to see my afp shared drive.

    Also, thanks for all your help, everything is working great. About using a bash script to start netatalk as a work-around to the bootup bug - I did include a netatalk start line in my rc.local file, but it still didn’t start. So I finally just disabled roaming mode to make eth0 visible to netatalk.

    One more thing I noticed: when I tried to create the sparse image on my local drive, Disk Utility kept automatically resizing it down so that the image’s max size was limited to the free space I had available on the drive (even though the image size is only initially ~100MB). Having an image smaller than the local drives size isn’t very useful for backup. So finally, I had to create the image on an external drive that had ample free space, and copy it back.

  29. Scott says:

    Great instructions!! I only have one problem. I got all the way to the end and went back to my Mac to give it a try. I found the icon and hit “connect as”. At this point it filled in my ubuntu username and asked for my password. When I hit connect i get the following error:
    “Connection Failed
    There was an error connection to the server. Check the server name or IP address and try again”

    Does anyone have any ideas where I went wrong and how I can fix it?

    Thanks.

  30. kapetanski says:

    After running sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot I get this output (starting at the first error):

    make[1]: *** No rule to make target `distclean’.
    make[1]: Leaving directory `/home/beta/netatalk-2.0.3′
    make: [makefile-clean] Error 2 (ignored)
    rm -f debian/stamp-makefile-build
    rm -f debian/stamp-autotools-files
    /usr/bin/make -f debian/rules reverse-config
    make[1]: Entering directory `/home/beta/netatalk-2.0.3′
    for i in ./config.guess ./config.sub ; do \
    if test -e $i.cdbs-orig ; then \
    mv $i.cdbs-orig $i ; \
    fi ; \
    done
    make[1]: Leaving directory `/home/beta/netatalk-2.0.3′
    if [ -d "." ] ; then \
    cd . && QUILT_PATCHES=patches quilt –quiltrc /dev/null pop -a -R || test $? = 2 ; \
    fi
    No patch removed
    if [ -n "patches" ] ; then \
    if [ -L ./patches ] ; then \
    rm ./patches ; \
    fi ; \
    fi
    rm -rf ./.pc
    rm -f debian/stamp-patch*
    rm -f debian/stamp-buildinfo
    rm -f debian/stamp-copyright-check
    rm -f AUTHORS ChangeLog INSTALL
    rm -rf m4
    rm -f debian/netatalk.init
    dpkg-source -b netatalk-2.0.3
    dpkg-source: building netatalk using existing netatalk_2.0.3.orig.tar.gz
    dpkg-source: building netatalk in netatalk_2.0.3-9.diff.gz
    dpkg-source: building netatalk in netatalk_2.0.3-9.dsc
    debian/rules build
    test -x debian/rules
    mkdir -p “.”
    Scanning upstream source for new/changed copyright notices (except debian subdir!)…
    licensecheck -c ‘.*’ -r –copyright -i ‘^(debian/.*|(.*/)?config\.(guess|sub|rpath)(\..*)?)’ * \
    | LC_ALL=C perl -e \
    ‘$n=0; while () {’\
    ‘ if (/^([^:\s][^:]+):[\s]+(\S.*?)\s*$/) {’\
    ‘ $files[$n]{name}=$1;’\
    ‘ $files[$n]{license}=$2;’\
    ‘ };’\
    ‘ if (/^\s*\[Copyright:\s*(\S.*?)\s*\]/) {’\
    ‘ $files[$n]{copyright}=$1;’\
    ‘ };’\
    ‘ /^$/ and $n++;’\
    ‘};’\
    ‘foreach $file (@files) {’\
    ‘ $file->{license} =~ s/\s*\(with incorrect FSF address\)//;’\
    ‘ $file->{license} =~ s/\s+\(v([^)]+) or later\)/-$1+/;’\
    ‘ $file->{copyright} =~ s/(?{copyright} =~ s/(?{license} [$file->{copyright}]“;’\
    ‘ push @{ $patternfiles{”$pattern”} }, $file->{name};’\
    ‘};’\
    ‘foreach $pattern ( sort {’\
    ‘ @{$patternfiles{$b}} @{$patternfiles{$a}}’\
    ‘ ||’\
    ‘ $a cmp $b’\
    ‘ } keys %patternfiles ) {’\
    ‘ print “$pattern: “, join(”\n\t”, sort @{ $patternfiles{$pattern} }), “\n”;’\
    ‘};’\
    > debian/copyright_newhints
    Found 736 different copyright and licensing combinations.
    ERROR: The following new or changed copyright notices discovered:
    UNKNOWN [1998 Owen TaylorPermission to use, copy, modify, and distribute this software and / notice appear in all copies and that / notice and this permission notice appear in supporting]: doc/htmldocs/netatalkconfig.1.html
    To fix the situation please do the following:
    1) Investigate the above changes and update debian/copyright as needed
    2) Replace debian/copyright_hints with debian/copyright_newhints
    make: *** [debian/stamp-copyright-check] Error 1
    dpkg-buildpackage: failure: debian/rules build gave error exit status 2

    Sorry for posting this scheisse output here, but I don’t how to solve it :(

  31. FoolsRun says:

    Krema,
    As I said, I’d set this kind of thing up myself before finding this blog and had that issue where Time Machine starts to create the backup volume and then fails out and deletes the volume after a minute or so presumably because it can’t change permissions. I worked around it by manually making a copy of the file before Time Machine deleted it:
    $ cp -R computername_0014e3856bd0.sparsebundle computername_0014e3856bd0.sparsebundle.temp
    And then renaming it once Time Machine failed and deleted it:
    $ mv computername_0014e3856bd0.sparsebundle.temp computername_0014e3856bd0.sparsebundle

    This seemed to work, but it was too hacky for my blood and I ended up just buying an external 2.5″ hdd for my Macbook.

    But if what you say is true, and this is a permissions issue with Netatalk and not a Time Machine issue, that’s relatively good news.

  32. krema says:

    enduser, we’re here to learn, right? ;-) Did activating the source repositories help?

    tsanga, if I select the disk image format as sparse bundle disk image first in disk utility and then adjust the volume size I can even create a 3 TB disk image on my MacBooks desktop. Sure, after mounting it displays the free disk space (”Available” in the Get Info window) according to the free physical disk space on your harddrive. But the image can still hold 3 TB (”Capacity” in the Get Info window) when on a harddrive or server with enough disk space available. So no automatic resizing here on my side. Are you sure it’s the “Capacity” which changes automatically or just the “Available” display?

    Hi Scott, had a similar problem, this solved it:

    Type in Terminal (on Ubuntu/Linux) to open the /etc/hosts file in gEdit:

    sudo gedit /etc/hosts

    I’ve added those two lines at the very top of the file. My server is named Rockhopper, adjust the name according to your server name. There should be some sort of name already but the important part here is the servername.local which is the AFP way of server names. If there are any other numbers at the beginning in your file leave them as they are:

    127.0.0.1 localhost
    127.0.1.1 Rockhopper.local Rockhopper

    Now the easiest way is to restart your computer after those steps. Then try connecting again from Leopard. Please report if it solved your problem. Would be good to know so I can update the problem section in this article.

    Hi kapetanski, did you try the variation of this codeline as suggested by de-escalator some comments above?

    FoolsRun, as I’ve said, it can be quite geeky ;-) As for the permissions: I’m not sure if it’s caused by Netatalk but fact is I can change the permissions of files INSIDE the image but not on the image itself.

  33. yørn says:

    I had the “The backup disk image could not be created” problem, so I made the disk image myself, but it still didn’t work. Then I noticed the filename was hostname_00123456789a.tmp.sparsebundle, note the “tmp”. When I removed the .tmp part, it went okay. I think Apple introduced this with some software upgrade.

    By the way, I use Fedora on my server, so this guide roughly works for other systems as well. Good job!

  34. enduser says:

    I updated to Ubuntu 8.04 and things are running more smoothly. I do have this question.

    Quote: “If you’re on Leopard and have no Tiger installed Macs in your network you should use the upriv option which adds support for AFP3 unix privileges. If you have Macs with Tiger installed just use options:usedots to avoid unexpected behavior:”

    What if I have Tiger on one Mac and Leopard on another?

  35. FoolsRun says:

    yørn: I knew I’d forgotten a step! I had to do that, too! That’s part of what made the whole thing feel a little too hacky for my taste.

    I hope that whatever’s causing Time Machine (or Netatalk) to be unable to write change the permissions it needs to change, or whatever, is indeed fixed so that we can begin backing up reliably to the network. Until then, the rest of this tutorial is awesome!

    krema: I also got resumable screen sharing (over VNC) set up, so that there’s a “Share Screen” button in the server’s Finder entry which would provide me with the typical GDM login screen. This is different from Hardy’s built-in VNC screen sharing because it runs without a user being logged in to the machine!

    it was a while ago, and I bookmarked the resources I used to set this up, but I can’t guarantee I remember all the little tweaks I needed to make. Here’s what I remember:

    1. First I set up VNC with resumable settings in Ubuntu. The only major tweak I remember having to make for this was adding -XFIXES and changing the fonts path in the “server_args” line in /etc/xintetd.d/Xvnc
    So the line becomes
    server_args = -inetd :1 -query localhost -desktop Media-Server -geometreometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc DisconnectClientClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES

    I also created a service file for Avahi:
    /etc/avahi/services/rfb.service
    <!--*-nxml-*-->
    <?xml version="1.0" standalone='no'?>
    <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
    <service-group>
    <name>%h</name>
    <service>
    <type>_rfb._tcp</type>
    <port>5901</port>
    </service>
    </service-group>

    Honestly there was some other tweaking I had to do, but I really don’t remember it all. This should put you on the right track if you’re interested in setting this up. I think resumable VNC sessions, which provide the connecting user with an Ubuntu login screen, would be a great addition to this article!

  36. FoolsRun says:

    Woops! Clearly my /etc/avahi/services/rfb.service file pasting didn’t work :)

    Here’s a link with the the how the service file should look, the only difference being that I use port 5901 (and the rest of the above howto uses 5901, too), so as not to interfere with Ubuntu’s built-in screen sharing option.

  37. enduser says:

    krema, thanks for the encouraging words. I am still posting greater detail on the issues I have run into on this forum http://ubuntuforums.org/showthread.php?p=5355794#post5355794

    At the end of all this I will write up what I learned and post it here so everyone can benefit. At this point I am stuck on editing the AppleVolumes.default file I don’t really know where to edit what or if what I have done is right, so I am hesitant to go on to the next step.

  38. krema says:

    Hi yørn, interesting, thanks for the info. Maybe introduced with 10.5.3? Don’t know. But glad it’s working on your system too.

    enduser, sorry for the unclear instructions, should be “If you have Macs with Tiger installed or mixed OS X versions in your network just use options:usedots to avoid unexpected behavior.” But remember, we have discovered some comments above that upriv seems a bit useless since we can’t change any permissions so leaving it out even on Leopard shouldn’t hurt. And a hint for your AppleVolumes.default: You can delete everything with # as first sign since these are just commented instructions (indicated by the #)

    FoolsRun, I’ve used the newest versions of everything and the problems with the permissions (and therefore the problems with disk image creation) remain. Thanks for pointing out the VNC thing. I even have set it up for myself here ;-) I will write a separate article for that. Activating Ubuntu’s built in screen sharing and advertise the service via avahi was the only thing I had to do to get the extra button in Finder. But this will cause another server to show up in Finder sidebar like Nathan experienced in his setup (and of course in mine too). You experienced the same with your solution or is there just the extra “Share Screen” button in your setup?

    Oh and by the way, I’ve fixed your rfb.service code. You would have to encode the entities (like the brackets > and <) so Wordpress won’t interpret them as HTML tags.

    Finally to tsanga, FoolsRun and all others: The quick Time Machine hack to select a network backup volume as suggested by FoolsRun is definitely needed. Tested it with various fresh installations. This will find it’s way shortly into the article. Thanks for the suggestions.

  39. FoolsRun says:

    Krema,
    Correct, my setup has a single server entry in the Finder sidebar with a “share screen” button. Clicking this button asks for a password and then gives me the GDM login screen so I can log in as whichever user I choose.

  40. krema says:

    Alright, thanks for the info FoolsRun. Seems like we have to forsake the simplicity of Ubuntu’s built-in screen sharing to let our Finder sidebars uncluttered ;-)

    edit: Oh, I noticed you say the GDM login. So you don’t have to be logged in as a user to get access to the screen? Because that’s the case with the built in screen sharing where you can just access the screen when already logged in as a user. Interesting!

  41. FoolsRun says:

    krema,
    Right, that was my motivation for setting it up; my server is headless and I needed a remote display tool without having a sudoable user logged in at all times.

    Basically what need to do is set up a VNC server which starts on request (which is what xinetd does) and then advertise that service via Avahi. This is obviously more complicated than it sounds, but essentially that’s what you’re doing.

  42. Anonamouse says:

    I tried following these directions, and I got filesharing from my Ubuntu box to work. However, I’m having two problems:

    1) I don’t seem to be able to offer anything but home directories as separate volumes (including folders inside home directories and mounted disk images).

    2) Time machine doesn’t recognize *any* shared volume on the Ubuntu machine. It just doesn’t have anything to mount.

    I can, however, see all files inside my home directory on my Ubuntu machine, and I can read and write to those directories.

    What am I doing wrong?

    Thanks!

  43. krema says:

    Hi Anonamouse your first problem sounds strange. Would you mind posting your AppleVolumes.default entries (the relevant uncommented lines at the bottom)?

    Your second problem is due to the hidden preference of Time Machine to use network volumes which is off by default. I’ve updated the article to include these instructions as I’ve said it some comments above. You were just 20 minutes too soon here ;-)

  44. Ralf G. says:

    Thanks for the detailed instructions. I had some problems with netatalk and Mac OS X and never had the energy to find out what’s wrong, now you did it, that’s great. ;)

  45. Grant says:

    Thanks for this guide- its almost exactly what i’m intending to do in the near future- the only difference is that i’m gonna have the shared disk space backed up in a RAID5 array.

    I was thinking about the potential issues regarding the resource fork compatibility in netatalk- would formatting the disk to HFS+ stop these issues from happening? or would you recommend using sparsebundles as the most straightforward way of dealing with this?

    Again- superb guide- many thanks!

  46. coucou78 says:

    don’t use :

    options

    but :

    option

    perm can work with that !!!

    perm:0770 option:upriv

    With opensuse 11:
    be sure to have :

    -rw-r–r– 1 root root 377 Jul 20 00:12 afpd.service

    correct rights for avahi services !!!

  47. krema says:

    Hi Ralf, glad my tut helped you.

    Hi Grant, in fact formatting the shared drive with HFS+ lead to other problems as we have discussed some comments earlier. And yes, if you want to be absolutely sure no single bit of the resource fork data gets lost you should use disk images for that. As an example: Personally I use a sparse bundle disk image for my Aperture Vault and another one for my Aperture Master files which works perfect.

    Hi coucou78, this sounds great as it seems you found a way to get the permissions to work, right? I’m not at home at the moment so I can’t test this out. Interesting enough the perm option is not listed in the AppleVolumes.default man page nor in the afpd.conf man page. So what exactly does setting the permissions with this way cause? Is this a way to globally set the permissions for all folders and files or are we able to change them individually for each folder or file via AFP? Is Time Machine able to change the permissions in order to create the backup disk image with this option? Would be glad if you could provide us with some more informations so we maybe can solve the Netatalk permission problems.

  48. paradrome-c says:

    Can you use Ubuntu Desktop instead of Ubuntu Server? I can’t seem to configure Ubuntu Server’s Display driver.

  49. krema says:

    Hi paradrome-c, I use Ubuntu Desktop for this but it shouldn’t be different to setup on the server version of Ubuntu. But isn’t the server version of Ubuntu supposed to be non-graphically?

    You can install the Desktop version and install all server functions afterwards anyway so no need to use the server version if you want to have a GUI.

  50. Tim says:

    Whatever I do to setup the server, I cannot:
    1. See the Avahi service in the ’shared’ menu in leopard, it shows up as smb (samba).
    2. Change the icon to a Xserve, tried ‘Xserve’ and ‘RackMac’.

  51. FoolsRun says:

    Tim, it seems like Avahi isn’t working properly on your machine. Have you restarted avahi?
    $ sudo /etc/init.d/avahi-daemon restart

    Have you edited your hosts file as krema points out here?

  52. Manuel says:

    krema: I am having a similar problem as Scott (post 29). Your answer from post 32 did not do the trick for me.

    Whenever I start the avahi-daemon the connection fails

    Whenever I stop the avahi-daemon, the connection works but to a point - i see the shared folders ( i have one called TimeMachine2 with a small text file in the folder just for testing).

    On my iMac it shows the folder “timemachine2″ (i.e. no caps) and when I try to open it an error message says:

    the operation cannot be completed because the original item for “timemachine2″ cannot be found. I tried adding another folder on my ubuntu box without capital letters (timemachine3) - it shows up correctly but when I double click on it I get the same error.

    Any chance you can help with this one ?

    Thanks… Manuel

  53. FoolsRun says:

    Manuel, I’m not Krema, but I’ve seen the errors you’ve described on occasion with my setup: are the “timemachine2″ and “timemachine3″ shares on an external drive?

    I’ve had weird issues connecting to external HDDs attached to my server, especially if they’re in read-only mode from being unmounted uncleanly.

    Try sharing your home directory only and connecting to that from the Mac –does that work?

  54. Manuel says:

    @Foolsrun - the timemachine 2 and 3 are folders on one HDD in my ubuntu PC…

    home directory did not work yet either.

  55. FoolsRun says:

    Manuel,
    On the mac, try opening a Finder window and pressing CMD-K (Connect to Server). In the server connect window that pops up, type afp://[your server's ip]

    And see what happens.

    You can also try afp://[Your Ubuntu Username]@[your server's IP]

    If that works, the problem with with Avahi. If not, the problem is with Netatalk :)

  56. FoolsRun says:

    Also, check ownership on the “timemachine2″ and “timemachine3″ directories.

    You could also try restarting Avahi and then trying to connect to your home directory first –sometimes connecting to a broken share can screw up the good ones, too, for some reason.

  57. stephen says:

    this works well, except, when i follow the steps on TWO linux boxes, they both show up as separate xserves in the finder sidebar, but both severs show only the same shares… whichever one i connect to first, the other server will then show only the same shares as on the first server. what do i change in the setup to have the two linux servers show up as independently operating sharepoints?

    tia,
    stephen.

  58. stephen says:

    ok, after lots of experimenting only by specifying a different -signature in each linux box’s afpd.conf was the finder able to mount their shares independantly of each other. what’s more the “-signature host” option documented in afpd.conf did NOT work, i had to specify a different “-signature user:” in each linux box’s afpd.conf . (where is something different in each case, i just used the box’s hostname forllowed by an underscore followed by ‘afpd’ as a unique signature for each box.)

  59. Manuel says:

    Frustration is mounting :(

    @FoolsRun - checked the ownership and it is set to my username. Also, for some reason I cannot set the “Read & Write” option in folder permissions… ??

    I tried accessing again today, just with the home folder, no luck.

    I then added a 2nd drive (who knows right?) and tried accessing it… no luck again.

    Without avahi (i.e. stopped), I can “log in” only as Guest. And then I can still not access the drive. At least the windows offers me “Guest” and “Registered User” but once I enter my proper ubuntu username/passwd it says : “Sorry, you entered an invalid username or password”.

    Once I try to restart avahi, the system will not even let me log in (same problem as already described).

    And on top of that, with avahi running on Ubuntu, I never see the icon in the Finder’s sidebar…

  60. Manuel says:

    Just to add, the drives and folders are shown as shared
    Owner is all set to my username (manuel) and permissions shows:

    Folder Access: create and delete files
    File access: — (this is the one I cannot change with sudo)

  61. FoolsRun says:

    Manuel: if the drives and folders show as “shared” in Ubuntu, they’re being shared out via Samba, not Netatalk. To share them via Netatalk you have to set them up in AppleVolumes.default as noted in Step 3.

    Also, were you able to connect to the shares using “Connect to Server” in Finder and typing afp://[your server's IP]?

  62. Manuel says:

    FoolsRun

    I shared them via AppleServer.default. No luck, that is why I tried to manually also share (which you say is via SMB).

    I can see the folders using the Conect to Server in Finder but I cannot access them, the message is as previously mentioned.

  63. Manuel says:

    ok, here is my setup, maybe something else is wrong…

    Ubuntu box connected to Airport Extreme
    Ubuntu wired connection IP address set to 169.254.8.55
    Ubuntu Mask set to 255.255.0.0

    folders no longer shared using the Properties, instead with AppleVolumes.default only

    I have followed all steps above, twice and still do not get it to work properly.

    Right now the drives do not even show up in finder.

    The icon for the ubuntu box shows but once I try to connect the message is “Connection Failed”

    argh…

  64. Manuel says:

    I got it working now :)

    My Airport Extreme was setup completely in the wrong way. I have now tried several settings and managed to find the one that works for me (created a 2nd network) whilst the AE connects via Ethernet to my iMac (which in turn uses wireless to access internet).

    I now have ethernet access to my Ubuntu box and a 2nd wireless network for other devices that may be connected

    The only thing that doesn’t work properly is to show the connected drives in my Finder’s sidebar but I can live with that.

    Thanks for the intended help!!!

  65. krema says:

    Hi Tim, did editing the host file help?

    Hi stephen, this signature stuff sounds interesting. Will have a look at that.

    Hi Manual, glad it worked for you in the end although the Finder sidebar stuff would make it more Mac like. Or is it just the mounted and connected shares (and not the server icon) which aren’t present in your sidebar? That’s the generic behavior of Leopard. Mounted shares are just visible on the Desktop (adjustable with Finder > Preferences). If you want to have the mounted shares in the sidebar too you have to drag the volume icon from your Desktop to the Devices section in the Finder sidebar. After remounting they will stay there in the sidebar.

    And finally thank you FoolsRun for helping out. ;-)

  66. Manuel says:

    krema

    I have nothing shown in my sidebar except an ‘imac’ icon which, when opened displays the CDrom drive, my HDD and the Network icon.