HowTo: Make Ubuntu A Perfect Mac File Server And Time Machine Volume [Update6]
For 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.
Update 12/07/2008:
Rumors are Apple will add some undocumented AFP commands with the Mac OS X 10.5.6 update which therefor won’t be supported by the current Netatalk package (and maybe never will). So be sure to check the latest comments on this article when the 10.5.6 update is out to see if this rumor is true and if there are problems caused by that.
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. Translations Of This Article
1. Modify and install Netatalk
Netatalk 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.

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:
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
First 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
Now 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
So 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
Next 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:

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:

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

6. Configure Time Machine
update 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:

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 the MAC address of the network device that your Mac uses to talk to your server, as Simulacrum and Todd 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 THEN 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:

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.
update 12/07/2008:
Netatalk backup disk reaching maximum capacity
As Seron pointed out in the comments, there is some discussion on the net regarding problems with Netatalk and TimeMachine when the backup disk reaches maximum capacity. This is due to missing support for the AFP commands FPSyncDir aka commands 78 and 78 in Netatalk. As a commenter in an ArsTechnica forum says: “As soon as your backup volume will reach max capacity, it will self destruct because of it.”
In the forum you’ll also find some links to various patches to avoid problems with that. If you have tested such patch please post your experiences in the comments for this article.
More Articles
- In case you want to connect your iPhone via AFP: An AFP Server on your iPhone. This uses the Netatalk package too
- Netatalk 2.0 manual
- All possible AppleVolumes.default options (part of the Netatalk manual)
- Overview and templates about services Avahi can advertise
- In-depth article about Sparse Bundle disk images
- How-to: Get files off a Time Machine backup without using your Mac: In case you have to access Time Machine backups from Ubuntu or any other Linux system
- Using NetBSD, with guest account: Johannes laid down the steps to use NetBSD instead of Ubuntu.
8. Downloading and using the Server Display Icons
I’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:

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.
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. Translations Of This Article
The following articles are direct translations of my article but some of them are slightly modified or simplified. Remember that the authors/translators are responsible for the content.
German: Ubuntu + Apple Fileserver + TimeMachine on kde4.de
French: Tuto: Comment créer votre serveur Time Capsule sous Debian on the Blog of Pierre de la Celle
Article Updates
01/19/2009 added links to some translations of this article
12/07/2008 added a warning regarding the new undocumented AFP commands which maybe will be added by Apple with the Mac OS X 10.5.6 update
09/28/2008 added a link to the precompiled Netatalk .deb package from Alessandro
07/14/2008 added the Time Machine network volume hack under 6. Configure Time Machine
07/06/2008 added a new part Problems with creating the backup disk image
06/21/2008 added instructions for changing the server icons in Mac OS X




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.
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!
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!
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).
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.
krema,
OK, thanks for the tips!
You’re welcome! And many thanks for the delicious coffee
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.
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.
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).
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.
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.
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 -rfakerootdpkg-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!
Abe, Are you using ss1 instead of ssl in the first line? It should be DEB_BUILD_OPTIONS=ssl
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
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.
I got this error from time machine:
“The backup disk image could not be created”
Any help?
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.
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>
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)
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
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::—
?
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?
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.
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.
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
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.
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.
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.
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
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.tempAnd then renaming it once Time Machine failed and deleted it:
$ mv computername_0014e3856bd0.sparsebundle.temp computername_0014e3856bd0.sparsebundleThis 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.
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/hostsI’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 localhost127.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.
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!
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?
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 XFIXESI 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!
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.
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.
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.
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.
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!
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.
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!
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
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.
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!
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 !!!
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.
Can you use Ubuntu Desktop instead of Ubuntu Server? I can’t seem to configure Ubuntu Server’s Display driver.
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.
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’.
Tim, it seems like Avahi isn’t working properly on your machine. Have you restarted avahi?
$ sudo /etc/init.d/avahi-daemon restartHave you edited your hosts file as krema points out here?
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
Manuel,
Bit late on the reply, so I hope you’ve solved it by now (!), but I had exactly the same problem you did with the “original item could not be found” error, and it was because somehow I’d ended up with old .Apple* folders in the root of my share.
In Ubuntu, I did “rm -fr .Apple*” in the root of the share to delete all the files, restarted netatalk, and I was able to connect again.
Hope that helps you or someone else.
Thanks for this great tutorial – I was having a seriously hard time with an Airdisk on an AEBS that I was using for Time Machine, with the drive constantly being lost, or locking up. I suspect the AEBS allows the drive to spin down and then isn’t very elegant at starting it up again. Switched over to this solution and it works beautifully. Much faster to read/write files to the disk than the AEBS too.
For what it’s worth, I used the latest version of netatalk that comes with Lucid (2.0.5) and have had no problems. I believe that version implements the commands necessary to automatically get the backup to roll over when it reaches maximum size as well, which is a bonus.
Cheers,
Tom
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?
@Foolsrun – the timemachine 2 and 3 are folders on one HDD in my ubuntu PC…
home directory did not work yet either.
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
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.
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.
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.)
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…
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)
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]?
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.
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…
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!!!
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.
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.
Got the sidebar running properly now too
It had all to do with a wrong setup of my Airport Extreme, I now have 2 wireless networks running and that solved the problem.
Thanks for all the help guys !!
Thanks a lot!!!.
I was looking for this, but not success. Now I’m making by backups via airport and my ubuntu box wirelessly.
Thanks again.
I was copying and pasting your commands into the terminal to avoid typos, but I got stuck at this point:
michael@fidgit:~/netatalk-2.0.3$ sudo dpkg -i ~/netatalk_2*.deb
(Reading database ... 161622 files and directories currently installed.)
Preparing to replace netatalk 2.0.3-9 (using .../netatalk_2.0.3-9_i386.deb) ...
Stopping Netatalk Daemons: afpd cnid_metad papd timelord atalkd.
Unpacking replacement netatalk ...
Setting up netatalk (2.0.3-9) ...
Starting Netatalk services (this will take a while): AppleTalk not up! Check your syslog for the reason. Child exited with 1.
invoke-rc.d: initscript netatalk, action "start" failed.
dpkg: error processing netatalk (--install):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
netatalk
Can you help?
krema, maybe you can help… one little issue.
My finder occasionally crashes and I cannot even relaunch it.
I now show 2 Shared devices, linux and localhost. The linux shared box is the Ubuntu server I have managed to get working with your help. The localhost shows
- an old Windows terminal as icon
- two folders “manuelhome” and “test”
- “Kind” is “Sharepoint”
I am connected as “Guest” but I do not know how to disable this connection. I have a suspicion that this may be the cause for the Finder crash.
When I first tried setting up the ubuntu box, I added a user test so this is where the name comes from. The user test has long since been removed from the ubuntu box.
Any idea what could be wrong here ? Is there maybe a cache I can remove that might cause the “localhost” to continue to appear ?
I have tried restarting both netatalk and avahi-daemon but the localhost still shows up alongside the linux box
Manuel
to krema :
yes standard ACL works (inheritance too, with s bit for group)
but such as afp 3,1 doesn’t support extended acl … netatalk (afp 3,1 implementation) doesn’t too …
I think i will write a complete tutorial for setting up an afp d server with group strategy end backup architecture (rsync + mail send for success or failed)
hi all!
I followed your guide and everything worked perfect, except for avahi…
in leopard the server shows up, I can connect to it.
But if I’m waiting a few minutes, then try to click on the server, it says “connecting…”, then the server vanishes in the whole local network.
But I still can connect through Command-K so netatalk is working fine, but it’s not visible in leopards “Shared” list anymore.
if I restart avahi through /etc/init.d/avahi-daemon restart
the server is visible again. then I wait a few minutes, try to connect – same again.
Checked every preference file, ran
avahi-daemon –debug
which doesn’t show any error, logs show no error, seems like avahi-daemon is running fine but it isn’t…
anyone now a solution?
is this a problem with avahi?
is there a network timeout in avahi?
thanks in advance!
So are we still at the stage where we need to copy the sparsebundle to a new location before Time Machine fails out and then rename the copied sparsebundle as I mentioned above, or do we have a less hacky solution to over-the-network Time Machine backups?
Hi,
nice tutorial, thanks for that, but I have the same problem as amathon, the server vansishes after a wile could not find out what the problem is.
massi
Thank you for this great tutorial!
Unfortunately I’m not able to connect. I have the same error as Scott and thus changed the /etc/hosts file. But it didn’t work.
I tried to connect manually with afp://gal@10.0.1.5 which is my Ubuntu machine IP. But didn’t work either.
I guess the problem is with netatalk.
AppleVolumes.default
~/ "$u" allow:gal,anya cnidscheme:cdb/home/gal/TimeMachine TimeMachine allow:gal,anya cnidscheme:cdb options:usedots,upriv
afpd.conf
- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_sshnetatalk
AFPD_MAX_CLIENTS=50
ATALK_NAME=`/bin/hostname --short`
ATALK_MAC_CHARSET='MAC_ROMAN'
ATALK_UNIX_CHARSET='LOCALE'
AFPD_GUEST=nobody
ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no
ATALK_BGROUND=no
export ATALK_MAC_CHARSET
export ATALK_UNIX_CHARSET
Thanks for your time!
Just checked the log when starting netatalk.
I get the following errors:
uam: loading (/usr/lib/netatalk/uams_randnum.so)uam: uam not found (status=-1)
uam: loading (/usr/lib/netatalk/uams_dhx.so)
uam: uam not found (status=-1)
I also searched my system for these files but they don’t exist.
Found it.
For some reason libssl-dev was not installed on my system when I compiled netatalk.
Now it works!
Great tutorial.
I’m having a weird problem. When I first followed the instructions, I was able to connect no problem and successfully backed up with Time Machine to my specified /home/user/TimeMachine volume.
Now for some reason I cannot connect to that network share. If I “Connect to Server”, I have no problems connecting to my home folder, but I cannot connect to my Time Machine volume. However I can browse my Time Machine volume if I connect to my home folder and then open the sub folder. Any idea what could be causing this problem? It’s driving me crazy. Thanks in advance for any help.
Hi, I am having trouble with this. The parseimage is mounted as “Backup og Asles MacMini” but I get an error in the console:
14.08.08 12.19.11 kernel USBF: 544.337 [0x433ed00] The IOUSBFamily was not able to enumerate a device.
14.08.08 12.19.12 kernel USBF: 545.383 [0x433ed00] The IOUSBFamily is having trouble enumerating a USB device that has been plugged in. It will keep retrying. (Port 3 of hub @ location: 0xfd110000)
So all that happens is that TimeMachine says “Preparing…” (translated from Norwegian).
Hi man,
fantastic work, impressive! I’m not even a newbie in linux. I’ve never touch it before but i need to setup a network with daily automatic backup of certain folders. we have 3 mac and 4 pc at my office plus this other pc that i want to use as a file server.
Can your solution work with mac and pc or mac only?
To explain : i need to setup a file server that everyone can access without hassle and with defines restriction on users according to the folder. All new file will be backup everyday on the server and of second firewire drive.
Do i have to follow the same process or do i need to do some more for the pc?
thanks a bunch
oxyde
Hi, great article! (Love the site design too.)
I’ve been having problems building netatalk on Ubuntu Server, although I can build it fine on my lappy (on Ubuntu Desktop). Both are running Hardy Heron.
I built and configured netatalk on the server, and couldn’t connect from my leopard machine. I built the package on my laptop, and installed that .deb on the server machine, and leopard could connect to it right away. (The md5′s don’t match, I’m not sure if they always should though.)
My main concern is that I’m missing a library or something and won’t be able to build it in future.
Any ideas?
Hi,
I’m getting that backup disc could not be mounted. I have all do ass it says here, but still no success. I have created image with disc utility, does this file have .dmg at the end? Because disc utility add .dmg to filename? But I have also tried withouth .dmg but still the same.
On ubuntu machine I have all permissions set to user that I connect with to backup machine.
But on created “time machine disc”, time machine have created some directory’s, it just cant mount disc image :/
Any tip?
Thanks,
cheers
Thanks for the tutorial, it works like a charm !
hey,
have you ever tested a full system restore using the backups from this method. does it work just like the time capsule? – if not how do you restore?
Regards,
Zachary
P.S. this is the best guide i have ever seen for something done on linux.
Awesome guide!!! I widh this article would get the top rank on google when searching for timemachine across network.
Your explanations are very good. Thanks again
Is it safe to delete all of the files and directories that were created within my home directory? I see a number of netatalk files and a netatalk-2.0.3 directory.
Hi Félix and Manuel, glad it worked for you.
coucou78, a “complete tutorial for setting up an afp d server with group strategy end backup architecture (rsync + mail send for success or failed)” would be awesome! Remember to post the link here if you’ve finished it.
Hi amathon and massi, sorry I have no idea why avahi stops working after a while in your case. If there’s no error reports whatsoever it’s kind of hard to find a solution. I believe there’s an avahi mailinglist and posting the problem there may be a good idea.
Hi Gal, glad you figured it out. Thanks for sharing the solution here.
Hi flaggh, seems like you have different configurations for the two shares in your AppleVolumes.default?
Hi Asle, these error reports clearly states that OS X has problems with the attached USB device. Could be an incompatibility problem between the USB drive and OS X and has nothing to do with Time Machine nor it can’t be caused by instructions stated in this tutorial.
Hi BlazS, be sure to select sparse bundle disk image as the Image Format in Disk Utility. This way you will end up with a file with a .sparsebundle extension and not .dmg
Hi Zachary, yes I’ve performed a successful complete restore last week during a new Leopard installation. The restore procedure can easily be started after you’ve booted your Mac from the installation disk.
Hi gzambran, yes all the files created in your home directory with Netatalk in the filename can be deleted. If you have problems deleting them because of insufficient permissions open up Terminal, type in
sudo rm -rand drag all the Netatalk files from your home directory onto the Terminal window (with a blank space after -r)
Did I forget someone?
Wonderful tutorial! Easily among the most friendly I’ve ever found.
When I tried to create the disk image with Disk Utility I had difficulties (sizing of the partition, etc.). I found this workaround useful to create the sparsebundle manually from the terminal:
hdiutil create -size 250G -fs HFS+J -type SPARSEBUNDLE client hostname_client MAC address.sparsebundleBy the way, as you might tell from the line above, that odd number that TM uses is the MAC address of the machine. To find it without all the runaround above just open the Network Utility and under the “Info” tab look for a line that reads something like “Hardware Address: 00:17:f2:d9:1c:f3″. That number is the MAC address. Removing the colons will get you the number in the SPARSEBUNDLE disk image name. Thus you merely look up that number and name the file “[name of my computer]_[MAC address of my computer].sparsebundle” (e.g. “Freeside_0017f2d91cf3.sparsebundle”).
Using the above line of code will generate the SPARSEBUNDLE in your home directory. Then simply drag it over to the drive where you want backups to be stored. Then dig in for a long wait while TM makes its first backup.
Hi Simulacrum, try to change the Image Format in Disk Utility first to sparse bundle disk image (read/write image is the default) and then adjust the image size. This way there shouldn’t be any limits. But nevertheless thanks for this Terminal snippet and more thanks for the MAC address hint. Always thought Time Machine just creates a unique number but learning never ends! thanks
hey, i did everything right, i can see the server on my MacBook, but i cannot connect. I tried restarting netatalk and avahi but it did not work. email me at airforceones7[at]gmail[dot]com or my AIM is LeBron 0wns Y0u if you can help. thanks in advance
Hi Nate, what’s the error message? what does the error logs say (in Console application)? Did you try this workaround from some comments above (answer to Scott)? Can you connect with Command + K and typing afp://[Your Ubuntu Username]@[your server's IP] as mentioned some comments above?
Oh and sorry, I won’t give any mail or chat support for that but I will try to help you here in the comments so others can benefit from that.
Krema,
A great tutorial and a great idea. I am having some trouble getting it working though.
I have the latest version of Ubuntu desktop and have updated Mac OS X. I can ssh into my server, 192.168.1.8 from my mac using terminal.
I am having the same problem Scott described in 29, I can see the icon in finder, it is the new one, but I cannot connect to the server. I attempted the following solutions you already posted:
- Implemented solution you provided in 32; added lines to hosts file as recommended to Scott and restarted my computer. No difference.
-Implemented FoolsRun solution in #55 but could not connect. I tired both afp://192.168.1.8 and afp://dave@192.168.1.8 where dave is my Ubuntu username.
-Attempted to determine if my problem was the same as Gal’s in 75,76 and 77 but do not know where to find the logfile for netatalk.
-Executed the following command to ensure libssl-dev was installed: sudo apt-get install libssl-dev. Received the output below which I assume means it was already installed:
Reading package lists... DoneBuilding dependency tree
Reading state information... Done
libssl-dev is already the newest version.
The following packages were automatically installed and are no longer required:
libavutil1d libdc1394-13 libavahi-compat-howl0 libtagc0 libavformat1d
libgsm1 libavcodec1d
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Restarted Netatalk and Avahi anyhow, no change. When I restarted Avahi I received the following output:
* The AVAHI_DAEMON_START option in /etc/default/avahi-daemon has been deprecated.* Please remove this setting from the configuration file.
* To disable the service use a runlevel editor like sysv-rc-conf or bum instead.
* Restarting Avahi mDNS/DNS-SD Daemon avahi-daemon
...done.
I am not sure if “deprecated” is the problem or how to fix it if it is. Any help on this one? Thanks though for all that has done on this project. This is a great learning experience and this tutorial is so well done. Really like the website layout too!
-Dave
yeah, i am basically having the same problem as above. i did everything right, i tried cmd k, i see it in the sidebar but cant connect. i am new to ubuntu, but i still understand what everything means… help!
Further to Zachary’s question, can you lay out the steps to performing a full restore from the networked backup?
I’m able to backup to a networked afp share on a Debian machine using more or less the same procedures that you have here, but I’m a bit concerned with having to do a full restore. I’ve read in other places that people aren’t able to mount the share after booting from the OS X installation disk.
Thanks.
Just a couple notes for those interested.
When compiling the source I get an error regarding copyrights, the steps to fix are shown in the error, but they are to
cd debianand then
cp copyright_newhints copyright_hintsand then of course
cd ..
The other issue I encountered is a -5014 error when attempting to connect to an AFP share. Turns out there are hidden .AppleDB folders in the root of any directory you share as an AFP volume which may need to be removed when upgrading netatalk. Simply remove or rename (i.e. mv .AppleDB .AppleDB.old) these directories and restart netatalk with /etc/init.d/netatalk restart to fix the -5014 error.
Hi
When trying to connect from my leopard 10.5.4 machine to my ubuntu 8.04 machine it refuses with the message “Your password has expired”.
System times are identical and correct.
I’ve tried to create a new user at the ubuntu machine, with password set to never expire, (and also a far future date), but I still get the same error.
Any ideas?
Hi
I had huge problem with setting up TimeMachine an AFP share, so I thought I would share what I learned. I was able to setup everithing according to your instructions (had to create a sparseimage on the desktop and then copy it, though), but just when starting backup TimeMachine was failing miserably, saying it can’t mount network volume. There were these messages in system.log:
/System/Library/CoreServices/backupd[1088]: Network mountpoint /Volumes/TMS not owned by backupd... remounting/System/Library/CoreServices/backupd[1088]: Failed to remount network volume.
/System/Library/CoreServices/backupd[1088]: Backup failed with error: 19
I found that I actually had to mount the AFP share I intended to use for backup, set it up in TimeMachine preferences, and then unmount it before starting backup.
Thanks for helpful info,
Slawek
Hi,
first of all, a big THANKS for this tutorial!
I’ve followed your setup step by step, and i see the backup-computer in the finder, but i cant connect because it wont accept my user name and/or my password (i’m using Ubuntu server). Any idea?
Galla
I have a fairly NEW MacAir. I used it in my offices where we have a few wireless nodes to allow access all over the property. With my new Air, I also got a Time Capsule. I thought I setup the Time Capsule with Time Machine, correctly, but I noticed a few times, on the little dialogue box, that it was trying to backup almost 100 GB of data?!?! I just ignored it and let it do it’s “Magic”, thinking my NEW RELIABLE MAC AIR would never need a restore anyway. I would sometimes sit at the desk near the Time Capsule (presumably on it’s network) for a few hours and then leave the area with my Air, to return again later for minutes, hours and more. I noticed sometimes it would try to perform a backup while I was BUSY with other stuff and I would click cancel, figuring that it would bounce back to where it left off later, as the system is advertised. 4 days ago my Air lost everything. I went to the Apple store for an exchange and took the time capsule with me, hopefull they would make my new one an exact clone of my other one, which I had spent dozens of hours customizing, etc PLUS had thousands of files exclusively stored on it. The tech said there we no backups on the time capsule??? I brought both back and installed Time machine on a PC in the network and found 3 FOLDERS, one a “parse” folder. Using the migration feature on bootup of the new AIR didn’t work after several attempts, it couldn’t :”find”: any back ups??? I looked at the folders on the PC and one folder has almost 98 GB’s of files and over 100MBs in the others. I moved these folders to the HrdDrive on the new Mac Air, but when I try to click on them (hoping it would launch some sort of uncompress app or something), it says” WARNING: Image: Appled MacBook_00163782389271…..tmp.sparsebundle”Reason: “Operation not supported” That one file is 68.1 MB, and it say’s under “kind”, on the general info tab: “Sparse Disk Image Bundle”. Can these be used in this form at all? I still have the “files” and would LOVE to get my new Air back to where the “old one” (4 weeks old), was. Ideally, I would LOVE all settings, software, applications, customizations, etc to follow, but at the VERY least, the documents, music, images, pictures, spreadsheets, word docs, etc would be very useful. Any ideas on what I can do here?? ANY HELP IS APPRECIATED!
I’m good at following instructions but know hardly anything about programing etc. I have set up my old Dell pc with 2 x 500gig disks as raid1 and had Ubuntu on it for backups but then came across this article and decided to give it a go. Although I never got it to link up with my macbook running Tiger, when upgraded to Leopard it all ran as described. It was when I noticed the connect as button at the top right of the Shared window that it all came together. I don’t know if I missed this button when running Tiger.
Thanks for everything. This is a great way to give purpose to your old pc when you leave the darkside!
Using NetBSD, with guest account
Based on this howto I tried the same using NetBSD. Why NetBSD? It is supported by various (old) devices, can be installed quickly and supports the UFS file format which Mac OS X supports, too.
This is the way I did it: I assume package-system (pkgsrc), bash, nano, sudo is installed and network is up and running. Please note: All needed software is built from source. This may take a long time if you use old hardware.
Here it comes:
Become root:
# sudo -iGet repository with additonal packages (checkout pkgsrc-wip, this may take some while)
# cd /usr/pkgsrc
# cvs -z3 -d:pserver:anonymous@pkgsrc-wip.cvs.sourceforge.net:/cvsroot/pkgsrc-wip checkout -P wip
Install OpenSSL:
# cd /usr/pkgsrc/security/openssl
# make install
# make clean clean-depends
Install netatalk:
# cd /usr/pkgsrc/net/netatalk
# make install
# make clean clean-depends
Let netatalk start at bootup time, edit rc.conf:
# nano /etc/rc.conf
Insert the following lines (no appletalk/printing support):
atalkd=NO
afpd=YES
cnid_metad=YES
And copy rc-files:
# cp /usr/pkg/share/examples/rc.d/atalkd /etc/rc.d/
# cp /usr/pkg/share/examples/rc.d/afpd /etc/rc.d/
# cp /usr/pkg/share/examples/rc.d/cnid_metad /etc/rc.d/
Link the configuration files to /etc for compatibility:
# ln -s /usr/pkg/etc/netatalk /etc/netatalk
Edit netatalk.conf, afpd.conf etc. as described above. You may use nano as before.
If you want to use guest access (see further down) then the line in afpd.conf should look like this:
- -transall -uamlist uams_randnum.so,uams_dhx.so,uams_guest.so -nosavepassword -advertise_ssh -guestname "guest"
Then you can start afpd:
# /etc/rc.d/afpd start
Install avahi:
# cd /usr/pkgsrc/wip/avahi
# make install
# make clean clean-depends
Configure rc:
# nano /etc/rc.conf
Insert:
avahidaemon=YES
# cp /usr/pkg/share/examples/rc.d/avahidaemon /etc/rc.d/avahidaemon
Install mDNS-Responder-nss:
# cd /usr/pkgsrc/net/mDNSResponder-nss/
# make install
# make clean clean-depends
Configure avahi/mDNS
Edit nsswitch.conf:
# nano /etc/nsswitch.conf
Make the Hosts:-line read like this:
hosts: files dns mdns
Link the avahi-config to /etc:
# ln -s /usr/pkg/etc/avahi/ /etc/avahi
Edit new file:
# nano /etc/avahi/services/afpd.service
Insert as described above.
Now you can start avahi:
# /etc/rc.d/avahidaemon start
That’s it, your Apple fileserver should work!
One thing more I did:
Add a guest account:
# useradd -g users -d /home/guest -m -s /usr/bin/false guest
Set this account for AFP-guests:
# nano /etc/netatalk/netatalk.conf
Edit, so that this line looks like:
AFPD_GUEST=guest
You should have set the line in afpd.conf as mentioned above.
Then restart afpd:
/etc/rc.d/afpd restart
Good luck!
Thanks for a great, detailed howto. I’d love to get this working, but I seem to have run into the same problem as Scott, above. When I try to “connect” to my ubuntu box from my Mac’s finder window, I get this error:
“Connection Failed
There was an error connection to the server. Check the server name or IP address and try again”
Avahi seems to be working correctly, since I can see my ubuntu box in the finder window, and it goes away when I shut down avahi on my ubuntu box.
I looked around a while for some log files that might give me a clue why the connection is failing, but I couldn’t find anything. (Where are the afp logs I wonder?)
Any suggestions? Thanks in advance for any help.
oh, also, I tried the fix that Krema suggested for Scott, namely, adding an entry in /etc/hosts with the server name + .local at the end – this didn’t solve the problem
My problem seems to with netatalk. Found the following lines in my syslog:
uam: loading (/usr/lib/netatalk/uams_randnum.so)
uam: uam not found (status=-1)
uam: loading (/usr/lib/netatalk/uams_dhx.so)
uam: uam not found (status=-1)
I checked that libssl-dev was installed (thanks Gal #77), but that wasn’t the problem.
These two .so files are present in the netatalk source directory, but are not in /usr/lib/netatalk. I am guessing that they are not being installed because configure can’t find ssl and/or doesn’t think that I want to compile with ssl support? Not sure how to make netatalk compile correctly though.
Got it. I had libssl-dev installed properly, but after some googling, it looked as though some shared object files were still missing. I installed libssl0.9.8-dbg (which apparently contains a bunch of symbol tables) and also a few libpam packages (sorry, I don’t remember which ones exactly, but I think they were libpam0g, libpam0g-dev and libpam-cracklib). Not sure which package did the trick.
Then, I remade the deb package and installed:
rm -fr ~/netatalk*
sudo apt-get source netatalk
cd netatalk-2*
sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot
sudo dpkg -i ~/netatalk_2*.deb
Thanks again for a great tutorial.
I was also getting the Connection Failed error.
To solve it, I first removed netatalk:
sudo dpkg -r netatalkI removed all the netatalk folders and files from my home directory
rm -Rf netatalk*I then did this (found here) :
sudo apt-get source netatalksudo apt-get install devscripts fakeroot libssl-dev cracklib2-dev
sudo apt-get build-dep netatalk
cd netatalk-2.0.3
DEB_BUILD_OPTIONS=ssl debuild
sudo dpkg -i ../netatalk*.deb
Awesome tutorial! Not surprisingly, the directions worked fine on Debian etch.
My only suggestions:
*) Document any firewall requirements. Am I correct that 548 and 5353 have to be allowed, and in particular, broadcasts to 5353? I had to do a little nitty-gritty configuration of Firestarter to allow the latter.
*) Point out that in afpd.conf, you can replace %h with a name of your choice if you are unhappy with the hostname that is exposed. My lame-O server has a fake hostname (e.g. http://www.blah.com), so by default it shows up in Finder as ‘www’.
Maybe I’m missing something here but I can’t understand your workaround for the “The backup disk image could not be created” error message. I only have about 20 GB of free space on my MBP, so it won’t let me create a .sparsebundle any larger than that. So then when I copy my .sparsebundle file to my mounted volume on my Ubuntu, I get the error message saying there is not enough free space. It’s ironic because the disk image for the 19 gb sparsebundle is only a few mb. Is there a way to create a larger .sparsebundle without having the availability for it on my hard drive?
paul
Ok well you can ignore that last comment and you might as well delete it. But, it does bring up a possible improvement to the workaround section. Those who don’t understand how a .sparsebundle works (like me until about 5 minutes ago) don’t understand that they WILL allow you to create a drive larger then the hd of the computer. A possible fix to the workaround would be to mention that you have to set the image format to “sparse bundle disk image” BEFORE you can set the size of the drive.
Cheers,
Paul
Hi,
It worked perfectly on my network.
Unfortunatly I can get spotlight to index the ubuntu shares.
Does anyone manage to get it work ?
Thank for your hints,
gerald
Thank You! You are my new found hero! I just got an old IBM esetber from work for free and wasn’t 100% sure what to do with it (it rides the slow bus)! This is absolutely wonderful thank you thank you and thank you! Also, I love your web design. Thanks again hero!
Hum, i just upgraded to 10.5.5 and it doesn’t seems to work anymore. Anyclues ?
Hi, i just wrote a reply before saying the 10.5.5 broke everything. Forget it, it just took ages in order to prepare the save but it works !
Thanks again for your tutorial !
fantastic page, couldn’t have been easier. One tiny problem though. I can’t seem, for the life of me to get the custom icons to appear for my server shown in the finder window. I’m running Mac OS X tiger and connecting to Ubuntu 8.04. The icon that appears in Finder is the same as the network icon, the purple-ish globe, but mine also has a transparent box around it. I copy and pasted the xml snippet from the instructions, leaving it as model=Xserve. I then took the Ubuntu Server.icns renamed it to com.apple.mac.icns and placed it in the /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources. After restarts of the services on ubuntu, restarting my mac and ubuntu, no luck. Anybody else have issues with this? Thanks in advance.
@mikeo #113: It seemed to me that Finder would’nt show the right icon if the (hostname)settings of Netatalk and avahi dismatch. So it might help to check whether Netatalk and avahi transmit the same hostname etc.
Amazing tutorial. Saved my life twice now. Now if only I could get my ubuntu box to see more than 2GB of my raid.
Anyway, this system is perfect for me.
Hi Johannes, hmmm good point, exactly how would I check this though? Thanks.
So bummer, am I correct in assuming the custom icon setup is only for Leopard? I pulled out my MBP for work which runs leopard and I was able to get the icons to work.
I imagine A2boot daemon will allow your linux server to act as a netboot server for client Macs. Something I might just try as it’s not that easy to get desktop Mac OS X to do it. The Mac OS X server package does it out of the box, but not the desktop version.
So an interesting little wrinkle if that is what it’s about.
I have followed the directions and neither my 10.4 client, nor my 10.5 client can connect to the afp server. I get the error:
“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.”
from my 10.5 client. Not sure what information to give to start troubleshooting… are there log files I can look at?
I followed this tutorial – and it’s fantastic. Time Machine was working so well, too. I was sharing two folders: my home folder, and a Time Machine backup folder.
I don’t know what I’ve changed, but now when I try to access the Time Machine folder – and only that one, the Home folder still works – I get the following error: “The operation could not be completed because the original item for ‘Time Machine’ could not be found.’”
I’m subscribing to this comment feed, but someone please maybe help me figure out what might be wrong. (conf files have not been touched from when I did the initial setup).
Hi All! Sorry for not answering to all your probs in the last weeks but I’ve tried to collect the main problems and errors and updated this article with hopefully successful solutions. Thanks to all of you who have contributed fixes for some problems or reported about their experiences with this setup!
gerald, hey didn’t think of Spotlight but you’re right. Spotlight seem to not index the Ubuntu shares. But you can use the search field in every Finder window and click on “Shared” et voila you can search through all your shares. But it seems this is some kind of live search and not a blaming fast index search.
mikeo, can’t tell for sure but it would be logical when the custom icon setup just works with Leopard since the whole UI stuff changed with Leopard. So did anyone using Tiger had success in using a custom icon?
Gatlin, this sounds like you somehow changed a line in your AppleVolumes.default.
I guess some details would be I’m running hardy 8.04.1, kernal 2.6.24-19-server. My clients are running 10.5.5 and the most up to date version of Tiger. I do not see the server in the finder sidebar, nor can I connect with connect to server.
Okay, in my /var/log/daemon.log file I have the same message as Gal. But when I run apt-get install libssl-dev, apt-get tells me it’s installed to the newest version… what else could be wrong?
This is brilliant!!! Thank you for writing this in such a careful way.
What if we added to this file server Firefly Media Server, so the music in it would appear as an itunes shared library?
Hello, Thanks so much for sharing this tutorial! Everything worked great for me (I didn’t try to set up time-machine, just sharing), until I restarted ubuntu. I’ve added netatalk and avahi-daemon to the startup items, and I can connect to my home folder under Network in Finder, but I can’t get it to show up in the left-hand column of my Finder window anymore. Any ideas?
I’m only using the Ubuntu box as a file server (for the moment), got a permissions problem with an internal hard drive on that machine where I keep my music, seems it’s because it’s FAT32. I need to read and write in this drive, I can give it a new format, should I try HFS+? is it easy to use with both systems?
@Gatlin: I was having exactly the same issue. My problem was because I didn’t have write permissions for the folder I was sharing. I was using an HFS-formatted volume connected via USB on the remote server.
This would make it extremely easy to disconnect and plug directly into my mac should I need to restore directly from the Leopard Install Disk.
Unfortunately, a power outage had cold-booted my server, and the disks didn’t unmount cleanly, providing me only with read access.
Check your permissions, rename any .AppleDB files in the folder, and give it another go.
@ignacio: Format as HFS (Not HFS+). The Ubuntu HFS driver does not support the Journaling, and will give you read-only access to the disk.
As my above example illustrates, Ubuntu is picky with HFS volumes though, so it’s up to you, if you think it’s worth the potential problems.
Ha, Just wanted to post that my problem seems to have resolved itself… and it wasn’t major anyway. Thanks again for the site, it has been very helpful.
Well, I had to uninstall everything and start from scratch… I don’t know what was different the third time around. I may not ever know… but it works now… pretty much flawlessly as far as I can tell.
Hello. Great article!
).
I’m doing a simpler one about the same topic in my italian blog. The main difference is that I made a Netatalk package with version 2.0.3-brando0 (brando is my nickname…) which is never upgraded by the official one (until the version 2.0.4 won’t be out, of course
I would like to use your front picture to introduce my article. Obviously, I will insert a link to this one and I will specify that you are the owner of the picture.
Thank you in advance, Alessandro
Thanks so very much for this guide, it works like a charm.
Only one question: Time Machine would show a lovely Icon for the disk containing the backup. Now it only is a blank removable icon (like any .dmg). Is there a way to change this?
randomlogic, glad it worked for you in the end although reinstalling everything three times doesn’t seem to be an elegant solution.
Hi ignacio, well there’s no reason not to publish your Firefly media server
But avahi is included in Firefly so you don’t have to add a service file manually. Here’s a good tutorial how to do that.
Regarding the HFS+ question: Trace is right (thanks Trace). Linux can’t handle write access on HFS+ Journaled file systems or more exactly it’s buggy and therefore deactivated. We’ve discussed the HFS+ topic earlier in the comments.
Hi Thomas, that was definitely an avahi-problem but glad it worked out for you.
Hi Alessandro, thanks for the info regarding your netatalk package. I’ve updated my article with a link to your package. It’s perfect for those who have had problems with compiling Netatalk for themselves.
Hi Casparz, without Candybar you can simply change every icon in Mac OS X via the Get Info dialogue.: ctrl + click (or right-click) on the desired application, file, folder or volume and click “Get Info”. Leave the Get Info dialog open and browse to your desired icon and open the Get Info dialogue of it too. Now click on the icon in the upper left corner so it has a subtle shine around it noticing you it’s selected. Now copy the icon by hitting command + c or choose Edit > Copy from the menubar. Make the dialog active we have opened in the first step by clicking on it and select the image in the upper left corner and hit command + v or choose Edit > Paste from the menubar. Now the desired icon should have been applied to the new folder or volume.
Dude, this guide is fckin awesome!!!
Very detailed and everything works out perfectly on my first try!!
Thanks for all your time putting this up for all of us!!
excellent tutorial. I’ve bookmarked it for future use.
I’m having a problem though – my ext3 drive on ubuntu works fine on my mac, but when I try to open my ntfs drive share on my mac, it says the drive name has been lost. The share still appears in the list, but cannot be opened.
It’s set up with the same params as above (and my ext3 drive), but is there any problem using an NTFS drive and this method?
First thanks for this howto, it worked great without the usual trial and error.
I have a question some of the other people who posted here: What is the advantage of using an HFS(+) partition? It’s still marked experimental in the latest kernel, I would avoid such a filesystem wherever possible.
This is an awesome tutorial and incredible helpful, however:
Although my avahi and netatalk seem to be running fine, avahi only seems to advertise when it is started.
If i disconnect my mac from the network and then reconnect the ubuntu machine does not appear in the finder bar unless i restart avahi?
Fabulous guide. Thank you very much Matthias.
It works for me.
Although I have 2 servers showing up in my Leopard side bar!
One is my ubuntu – named danbuntu and has the xserve icon.
The other is named as the IP address of my ubuntu server and has the blue monitor icon.
So:
danbuntu
192.168.11.7
I can log into my home directory on the ubuntu server using either of them.
Why do I have two things in my sidebar? Does anyone know?
Thanks
Dan
@Dan B
Perhaps are you using my netatalk package (netatalk_2.0.3-brando0_i386.deb)? In my package the netatalk’s native support to avahi is enabled, whereas is not in the standard package. But, unfortunately, the netatalk’s support to avahi shows the IP address instead of the name.
So, the advertising with the IP address is originated from afpd itself, and the other from the file /etc/avahi/services/afpd.service.
You can either remove this file, or disable the avahi support in netatalk, modifying the file /etc/netatalk/afpd.conf as follows:
add the option -nozeroconf to the line that you have already added, and then restart netatalk.
Hi David Cabrejo, fcking thank you
Hi bryan, yes there are problems with accessing NTFS drives on a Linux box over network. Have the same problem but wasn’t able to identify where the problem comes from. The share shows up on Leopard but it just won’t open. I suspect it either something to do with the lack of permission settings on NTFS drives or with the ntfs-3g driver which is the tool which enables NTFS on Linux (and on Mac too). But I heard there was a new version released recently…
Hi da.phreak, well the advantage of using HFS+ is you can just plug it in your Mac and use it. Ext3 on the Mac isn’t really available (but for ext2). In Terms of buggy HFS+ support you’re absolutely right saying “I would avoid such a filesystem wherever possible.”
Hi Matthew Spence, no generally avahi doesn’t need to be restarted to make it work. Maybe your Finder window didn’t update itself the right way. You can try in Terminal:
killall Finderto force a restart of the Finder. Does your Linux box now appear?
Hi Dan, that’s pretty strange and I bet Alessandro is right with identifying the problem.
And Alessandro, thanks for jumping in and identifying Dan’s problem!
Well, works great. With one exception. The creation of the sparsebundle file from Disk Utility. I wasn’t able to create it via the button ‘create image’. I had to select File -> New Archive to be able to select the sparseimage…
And when you create a file adisk.service for the avahi-daemon with the folowing content, you don’t have to modify the apple default (default write etc.) :
<service-group>
<name replace-wildcards="yes">TimeCapsule</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
<service>
<type>_adisk._tcp</type>
<port>9</port>
<txt-record>sys=waMA=XX:XX:XX:XX:XX:XX</txt-record>
<txt-record>dk2=adVF=0×83,adVN=backup,adVU=956cf67c-f448-453f-9dec-dd17855ee076</txt-record>
</service>
</service-group>
(from http://marc.info/?l=netatalk-devel&m=121076211716326&w=2)
Hi,
Thanks for the great tutorial!
I’m able to mount my home directory and the TimeShare folder from my MacBook with 10.5.5.
If I see the “Network mountpoint /Volumes/TimeMachine not owned by backupd… remounting” failure if I leave the mounts up in finder. Unmounting lets me progress to another fatal error however:
Starting standard backupFSMatchAliasBulk returned -5023 while resolving alias to backup target
Backup failed with error: 19
Any ideas?
@Alessandro
You were exactly right! Thank you
))
/etc/netatalk/afpd.conf
added the option -nozeroconf
Awesome. Very happy now!
Thanks
Dan
YOU ROCK … HARD!!!
After several hours (days) searching, trial, error, I ran into this post a little after 1:00 a.m. Now it’s 2:00 a.m. and I’m 2+GB into the initial full backup.
I want to buy you a cup of coffee but I’m so tired the euro-to-dollar thing on PayPal scares me. I don’t want to buy you a new car – I’ll figure that out after some sleep.
One thing to note: If you have to create the sparse bundle manually, the MAC address needs to be the one from your primary ethernet adapter (en0) – no matter which one you’re using to connect with. That made sense AFTER I thought about it – you don’t want a different backup file every time you connect differently (wired/wireless) – but I created several using the MAC from my AirPort adapter before I figured it out.
@macmenco
how do you figure out your UUID? have you ext3 formatted or HFS+?
Is it better to try it with HFS+? Because during the insallation ext3 isnt supported and i want to recover from time machine
sorry i didn’t read all the comments. i will switch to ext3 and to a recover over network
Hi macmenco, this TimeCapsule service file is awesome! Thanks for finding this. This will find it’s way into my article. Many thanks!
Hi Will, did you try creating the sparse bundle file on your desktop first?
Dan B, nice it works for you now.
Hi Kyle, don’t be scared by the euro-dollar conversion as it isn’t that bad. I guarantee you I’m not able to buy me a new car if you just with coffee donations
Thanks for the info on the MAC addresses. So you say, if you switch the network adapters there will be another backup disk image created?
Hi beanie, did your recover over network work? Be sure to check out my part about restoring from a network backup in this article.
@krema i will do it like you described.
but now i get stuck with the timecapsule service from macmenco.
over afpd.services everything works fine. TM does the backup well. but if i setup the adisk.dervice i get the “connections problems”. there is really no firewall and afpd works, that wires me
beanie, regarding TimeCapsule service: seems like this needs some more investigating. macmenco, had you success with creating the initial backup on your share advertised as a TimeCapsule?
@krema
i actually try this: http://www.dreness.com/blog/archives/48
i does not (yet) work but. its advertises correctly but timemachine won’t accept that share.
I got a problem that I >>Really<< need help with please.
All I wanted was to share files between my Ubuntu Hardy machine and my OS X Leopard machine via my new FireWire cable.
Yeah I know – I do have a normal Ethernet 10/100 LAN. But I wanted the indulgence of a 400Mb connection.
My MacBook (aka “My OS X Leopard machine”) has both Ubuntu Hardy and OS X on it. I couldn’t get the two Ubuntu(s) to share files via FireWire; so I tried to have at least this machine running on OS X while the PC is running on Ubuntu.
I stumbled upon this guide and said to myself “Hey this looks promising! It looks sleek, and sounds knowledgeable!”
But something along the way went terribly wrong… *drama pause*
Somewhere along the “sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot” line to be exact. Where you said “If everything went through without errors” – there were no singing warnings, but there was definitely an error – what a shame I didn’t write it down
Afterwards I did the foolish mistake of trying to retrieve my steps… and so I did “sudo apt-get remove cracklib2-dev fakeroot libssl-dev”
Not smart.
And what’s even less smart is that I moved some of the netatalk files (and folder) from my home folder – to the trash! :`(
(well to be honest I put them back in my home folder before permanently deleting them – but still… very foolish of me).
So I was about to give up on this wonderful tutorial all together and go do this one:
http://ubuntuforums.org/showthread.php?t=305493
(post #2)
But when I did “sudo modprobe eth1934″ I got this message in the terminal:
“FATAL: Module eth1934 not found”.
Please… Please please please help me.
hehe.. I know I did some noobish mistakes over there…
but I just got frustrated by trying so much to no avail.
For now I’ll have to use the normal LAN.
But I’m hoping with all my heart, lungs and liver that someone here can soon help me out and fix all my problems in this matter ^_^;,
Hoping for a saint,
Nekoshu.
P.S.
The tutorial DOES rock, and IS unique – I just think that a paragraph should be added to tell us beginners what to do in case we *do* get an error
*looking in shame towards the floor*
Still, better to have tried and failed – than to have feared trying at all
Oh I forgot one more detail…
I now get an update notice on the notification area, telling me I have an update ready for netatalk. But when I tell it to update – it tells me the next error message:
“E: /var/cache/apt/archives/netatalk_2.0.3-9_i386.deb: subprocess new pre-removal script returned error exit status 1″
krema asks: “So you say, if you switch the network adapters there will be another backup disk image created?”
Answer 1: If you change out your primary network adapter (en0) then, – Yes – You would either get a new sparse bundle or you could change the name of the existing sparse bundle to match the MAC of the newly-installed adapter.
Answer 2: If you just use a different adapter to connect to the network (i.e. no change in hardware) then, No – the MAC address used for the name of the sparse bundle is ALWAYS the MAC address for your primary adapter on the client (i.e., en0) REGARDLESS of which adapter is connected to the network. In other words, it does NOT use the connected adapter’s MAC, it uses en0 – even it that adapter is not in use.
This allows you to do what I did – initial full backup using the wire, subsequent incremental backups using WiFi – they all go to the same sparse bundle.
Sorry I couldn’t do more (I’m a poor Okie – otherwise I would just go buy that new 1TB Time Capsule instead of jacking around with an old ubuntu box I built out of scrap)
It might not be the best coffee…
PLEASE HELP!
Apparently, some Ubuntu update I got has messed up my AFP shares. Now, NONE of my AFP shares are visible in Finder (forget about Time Machine for now).
The server is visible in Finder side bar, but when I click it it churns for a while and then says “connection failed”.
I downgraded the Ubuntu updates as best I could and rebuilt netatalk per the instructions above (deleted all the source & libs first). No go.
System log on the Mac says:
/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder[215]: SharePointBrowser::handleEnumerateCallBack returned -5014
No network problems – NFS shares still work.
Any clue where to start looking at this? At first I thought it was something I did on the Mac, but after installing Leopard fresh, I get the same results. Now I REALLY need to restore that last Time Machine backup I got…
OK – I made some progress.
I deleted ALL the packages mentioned above, delete the source code, etc.
I Accepted all the updates Synaptic wanted to give me.
I rebuilt everything as mentioned above.
Now AFP shares are working again – except for the one where Time Machine backups reside – so, I created a new share and moved everything from the old TM location to it and shared it – Now I can see it again. It read the backup and accurately shows me the oldest & latest backup dates.
Now I’ll try to restore………
guys.. please… any ideas as to what I can do to solve my big problem?
coz as of now I can’t update my ubuntu (because the natatalk update stops the proccess everytime)
Great tutorial… worked almost flawlessly, just need to modify /etc/hosts on the linux box and add the $server.local
Thanks!
System Restore Really Works!!!
I started with the guide at this link so “dvd” on the macrumors forum deserves all the credit:
http://forums.macrumors.com/showpost.php?p=4605711&postcount=15
I will copy his guidelines and add my comments based on what I noticed doing it the first time:
Select “Restore from Backup disk” from the Utilities menu and you should see your backup listed
1) Boot the Leopard Install Disk
1a) Select your language
1b) Click the icon area above the “more info” button (not the button, the white area where the icons are shown) – I had to do this to get the menu bar to show up at the top of the screen
NOTE: You will get wired ethernet support by default. If you have to do this over WiFi you can click the little “fan” on the top menu bar and setup your network.
2) Select Terminal from Utilities menu
3) Ping your NAS box to make sure you have connectivity
4) Create a mount point for your NAS box, i.e “mkdir /Volumes/nas”
5) Mount your backup drive manually
For AFP, use “mount_afp afp://username:password@NAS_IP_ADDRESS/NAS_volume_name /Volumes/nas”
NOTE: the “NAS_volume_name” above is the “pretty” name you configured in /etc/netatalk/AppleVolumes.default (i.e., the 2nd parameter, not the actual path on the server). If it has spaces, wrap it in double quotes after the slash.
6) Make sure the sparsebundle file mentioned above is in the root directory: “ls /Volumes/nas”
7) Exit terminal, “exit”
You’ll have to select the drive you mounted and the sparse bundle that matches the machine you’re restoring (if you have more than one).
NOTE: When you run Restore from the Leopard DVD, the Time Machine backups will be listed in Pacific Time Zone (I guess that’s so Steve Jobs’ won’t be confused like I was at first).
It worked perfectly – took about 2 hours for a 47GB image using 100MBit wired connection.
Nekoshu,
You might try a do-over like I did.
1) Go into Synaptic and manually remove (“complete removal”) all the packages that were installed in the tutorial above.
2) Delete all the source files in your home directory (“sudo rm -R netatalk*”).
3) Let the updater install all the patches it thinks it needs to.
4) Turn updates off
5) Run the tutorial above again.
Don’t know if that will help – hope so.
Krema,
You really are kremalicious…
Thank you for replying Krema.
I tried “Complete Removal” of “netatalk” in the synaptic.
It couldn’t do it.
All it said was, and I quote (from beginning to end):
“E: netatalk: Package is in a very bad inconsistent state – you should”
should what right? that’s exactly what I thought.. but it’s all it said.
Afterwards a dialog window appeared, saying :Not all changes and updates succeeded. For Further details of the the failure, please expand the ‘terminal’ panel below.”
(I know it seems like I made grammer mistakes there, but that is by the letter – what it said.
Down in the terminal window, this is what appears:
“dpkg: error processing netatalk (–purge):
Package is in a very bad inconsistent state – you should
reinstall it before attempting a removal.
Errors were encountered while processing:
netatalk
E: Sub-process /usr/bin/dkpg returned an error code (1)
A package failed to install. Trying to recover:”
Then nothing happens
I think I have already tried re-installing it via the synaptic – doesn’t work. I’ll try again now just in case.
I do not know how to re-install from the terminal…
Is there such a command (apt-get re-install maybe?)
Nekosha,
In terminal it’s:
sudo apt-get remove purge
The “remove” parameter is the same as “remove” in Synaptic. The “purge” parameter is the same as “completely remove” in synaptic.
Good luck…
…just thought of something else.
You might try:
sudo get-apt check netatalk
and see if the output gives you any clues. There may be some dependent package that needs to be removed/purged/installed.
beanie, very sad. Seems like we have to wait a bit before this TimeCapsule stuff fully works.
Kyle, thanks for clarification about the network adapters and, of course, for the delicious coffee
Also thanks for posting your steps for restore so the other readers can benefit from your experiences. Glad your system restore worked flawlessly!
Hi Zilus, glad it worked for you. Have fun backing up!
Hi Nekoshu, something messed up your package management. Did the steps pointed out by Kyle (Again, thanks Kyle!) solved your problem?
I ran through your tutorial and was able to compile a debian package for netatalk with SSL support for Ubuntu x64 and I uploaded it here:
http://www.filedropper.com/netatalk203-9amd64
Hopefully this will save everyone some trouble and they won’t have to compile it themselves. Note that this is 64-bit only!
Thanks for the tutorial!
Thanks for the reply Kyle (I haven’t had the time untill now to see it unfortunately).
It seems I can’t upgrade, can’t remove, and can’t completely-remove the netatalk not in the synaptic nor through the terminal using hte apt-get commands
The output of the upgrade command might help, so here it is:
“$ sudo apt-get upgrade netatalk
sudo: unable to resolve host MyComputersName
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be upgraded:
netatalk
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0B/725kB of archives.
After this operation, 164kB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database … 162736 files and directories currently installed.)
Preparing to replace netatalk 2.0.3-9 (using …/netatalk_2.0.3-9_i386.deb) …
hostname: Unknown host
invoke-rc.d: initscript netatalk, action “stop” failed.
dpkg: warning – old pre-removal script returned error exit status 1
dpkg – trying script from the new package instead …
hostname: Unknown host
invoke-rc.d: initscript netatalk, action “stop” failed.
dpkg: error processing /var/cache/apt/archives/netatalk_2.0.3-9_i386.deb (–unpack):
subprocess new pre-removal script returned error exit status 1
hostname: Unknown host
invoke-rc.d: initscript netatalk, action “start” failed.
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/netatalk_2.0.3-9_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)”
Is there any way to re-install in the terminal? Coz one of them times I tried to upgrade it, it said I should re-install it before I upgrade or remove netatalk.
Or should I maybe reboot and try the purge command via the root terminal in the “Repair console”? (or was it called GRUB console or something…?…hmm…)
Anyway thanks for the help.
Meanwhile I found that if I try upgrading the system via the synaptic – there IS a way to ugrade any OTHER package (not the netatalk though).
I tried this excellent guide with all it’s comments but now I’m at a point where I don’t know what’s going on:
Everything works fine for me but the Ubuntu-Box doesn’t show up in the sidebar.
I can connect via cmd-shift-k (Network) where I can see the box or via cmd-k (connect with server). This works fine. I can copy to and from server. The only thing I’m missing is that the server shows up in sidebar..
I’m using 8.04.1 where Ahavi is already included, added the AFP-Service-XML and there’s no error in syslog. Everything starts up fine and – because I see my server in “Network” – it looks to me that everything is working..
Except – as I said – the server does not show up in the sidebar…
Any help or suggestions are appreciated.
TIA
Peter
Thank you very much for this excellent tutorial. Everything worked as pointed out here. However, in my case I plugged in a second HDD into my Ubuntu-Machine, which is formatted as HFS+ without Journaling. The device is mounted by fstab:
/dev/sdc1 /home/haddad/TimeCapsule hfsplus rw,auto,async,exec 0 0
Accessing, writing, reading the folder and it’s content works fine from my Mac over network as well as from my Ubuntu machine. However, trying to make a backup via TimeMachine fails after about 20 seconds, with the message, that no Volume could be generated. I’d be very happy if someone could have a look at the error-messages (see website) and could help me with that.
Many thanks
IsamTU-BS
Thanks for the guide. I have been looking for a way to get my MAC users off of my Windows shares!
I am running into the authentication issue as some others have. I’m somewhat new so bear with me. I followed the guide and everything completed successfully. I sit down at any of my macs (10.5) and browse the network and I can see my ubuntu machine(I named it XSERVE). It even has the xserve icon but when I click on it and then click on “connect as” it doesn’t matter what credentials I enter, it always says the logon is incorrect and to check the name of the server. Here are some things I have assumed, please let me know if i am wrong…
1. Each mac user nees an ubuntu account which you need to login with at least once to create the home folder.
2. In the AppleVolumes.default line I should replace username1 and username2 with The names of the ubuntu users:
~/ “$u” allow:jim,mary,frank cnidscheme:cdb
I’m just trying to get file sharing working first and worry abou TM later.
Any ideas???
Thanks!
Thank you for this useful tutorial.
I think I have a few problems in understanding your directions though.
Opening AppleVolumes.default and defining users who are allowed to connect to my ubuntu box via AFP:
Do I add ~/ “$u” allow:username1, username2 cnidscheme:cdb after the last line: ~/ “Home Directory” or replace the whole line. and then with adding /home/username/TimeMachine TimeMachine allow:username1, username2 cnidscheme:cdb options:usedots,upriv do add this after all the above mentioned or blend the command into one.
Please forgive my misunderstanding, can you explain this describing an example. You further illustration will be greatly appreciated.
Thank you for posting the tutorial.
I was reading your article on setting up a ubuntu file server that can be accessed by OS X and I was wondering if the same procedure will work for both OS X and windows XP clients.
I have a mix of computers, and I would like a spot where all computers can read and write files to.
Are there any additional things I would need to do to set this up?
Fat32 file system wouldn’t be an option for me as I back up Virtual Machine files that are over the 4GB file size limit of the OS. I also would like to use combination of 500GB and 1TB drives.
I understand that there are programs to you can buy for a mac to write to NTFS and similarly for a PC to write to a Mac file system.
Thanks for you help and I appreciate your help.
Cheers.
Just wanted to comment on an option I’m using.
I am using Vino (ubuntu’s builtin vncserver). I’ve changed the default port to use 5901 under the default preferences (not sure this is necessary?)
I am only using local-link messaging, rfb and afp services. I had put in a /etc/avahi/rfb.service file to broadcast, but soon found that Vino self registers using a sting like “${User}’s remote desktop on ${hostname}” So I was getting Vino’s service listed in Finder, and the duplicate I had in rfb.service.
I saw a post about setting enable_dbus=no in Avahi’s configuration file, but that causes my local-link message service to not show up in iChat/Adium.
So… The work around was simply remove the /etc/avahi/rfb.services and set the name in afpd.service to match that of Vino’s.
So its not optimal but it does make my Mac Finder list only one server with multiple services (Screen Share and AFP)
This could be overcome if Vino had an option to remove self registration or to change the “Name” of the service it registers.
Finally it works for me.. I really don’t know why but I did the Avahi-Part again and now it works. I see my server in the sidebar, access is possible, everthing works fine.
I even managed NIC-bonding and this also works fine with netatalk. And with my 3ware controller I now have 4 TB Diskspace which will be enough for the next few weeks…
Thanks again for this great tutorial.
@Robert: If you have to access from Win AND Mac you better setup a samba-server. You can also access from a Mac with “Connect-To-Server” and “smb://IP.Address.OF.SERVER”. Furthermore, if you implement the Avahi-Part of the Toutorial, your Samba-Box should also be seen in the Mac-Finder Sidebar.
Jon,
I don’t know how you have accounts and groups setup on your ubuntu box or your Mac. I can tell you what I did that simplified things a lot and may help your problems with credentials. BUT BE CAREFUL – THINK THINGS THROUGH BEFORE YOU START.
I modified my account on the ubuntu box to match my account on the Mac (same name, same password and, most importantly, the same uid). Then I changed all the files owned by me to match the new uid – be careful and make sure you have another account you can log in as that can sudo or you could lock yourself out. Do this for every account that needs to access an AFP share from the Mac. Make sure everything works on one account before you change another.
Second, I created a group on both ubuntu and Mac (same name, same gid on both machines). Every user who needs to share AFP from the Mac is a part of that group on both the Mac and ubuntu.
Then I chown-ed all the share points (and files recursively) to have me as the owner and my new group as the group.
Lastly I set appropriate permissions (recursive) on all the files in the AFP shares.
Now anyone who shares has appropriate permissions (via the group) on both boxes — the names match, the permissions make sense, etc. – I have my iTunes and iPhoto libraries as well as my Time Machine archive shared and setup this way. So far I haven’t run into any issues even when different users make changes to different photos, different users run Time Machine, etc.
It solved a lot of my permission problems. Hope that helps.
Thanks for the great tutorial, I followed it word for word and it’s running great!
Ok, i want to check this one here first. I am upgrading my server, the only pakage that is being held back is the netatalk pakage. Since i installed it to get my afp running for my time machine backups i want to make sure i dont break my backup system.
When i run “apt-get -u install netatalk” i get the following output:
sudo: cannot get working directory
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libsmbclient libfreebob0 libatk1.0-0 libgtk2.0-common libxfixes3 libwxbase2.6-0 libxcomposite1 libavutil1d libcaca0 libavc1394-0 libmodplug0c2 libxxf86vm1 libjack0 libgl1-mesa-glx
libspeex1 libiso9660-5 libnotify1 libcairo2 libsdl1.2debian-alsa libthai-data libdvbpsi4 libdirectfb-1.0-0 libcdio7 libavcodec1d libxosd2 libdatrie0 fontconfig libiec61883-0
libvlc0 libsdl-image1.2 libpango1.0-common libdrm2 libpixman-1-0 libsdl1.2debian vlc-nox libwxgtk2.6-0 libhal1 libxinerama1 libxft2 libmatroska0 libtheora0 libice6 libaa1 libthai0
liba52-0.7.4 libpostproc1d esound-common libflac8 libxrender1 libgsm1 libdvdnav4 libvorbisenc2 libdvdread3 libdc1394-13 libtiff4 libavformat1d libraw1394-8 liblircclient0 libmad0
libid3tag0 libpango1.0-0 libsm6 libpulse0 libtar libxdamage1 libglu1-mesa libxi6 libvorbis0a libxcursor1 libesd-alsa0 libxv1 libvcdinfo0 libxext6 libebml0 libmpcdec3 libxrandr2
libcucul0 libgtk2.0-0 libmpeg2-4 vlc-plugin-pulse libogg0 libaudiofile0
Use 'apt-get autoremove' to remove them.
Suggested packages:
tetex-bin timeout
Recommended packages:
db4.2-util rc
The following held packages will be changed:
netatalk
The following packages will be upgraded:
netatalk
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 774kB of archives.
After this operation, 217kB disk space will be freed.
Do you want to continue [Y/n]?
Can i proceed or is there a chance i will break operation?
If i change the cnidscheme from cbd to cdb as suggested i cannot connect to any shares and i receive this error. “the operation cannot be completed because the original item for _____ cannot be found”.
Any ideas?
to elaborate on my first post…
what i’m trying to do is “Index an AFP Share Point” as per the article here.. http://discussions.apple.com/thread.jspa?messageID=648163
If i try and publish the spotlight index on a AFP share that uses the snidscheme:cbd i get this error.
bash-3.2# mdutil -p /Volumes/Software/
/Volumes/Software:
Error: datastore publishing not implemented.
if i try and chage the cndscheme to cdb i get the error above and cannot mount the share at all. I can however see all the shares in finder. And my music share that is served through firefly shows up and works in iTunes.
@Sean note that cnidscheme change is not from cbd to cdb but from cbd to dbd, getting this directive wrong can affect the functioning of your share.
BTW, thanks very much for the tutorial, it worked great for me.
For anyone who hasn’t noticed, the share volume for Time Machine backups HAS TO be mounted by a normal user in a normal user’s directory, otherwise you won’t have enough privileges when connecting from Leopard. (i.e. don’t mount the volume by root on the usual mount points such as /mnt or /media)
@Tiriel you’re right – that’s what i meant to say.
If my shares are defined as follows only the SOftware share will mount.
The music share will show but will not connect in finder and will give me the “the operation cannot be completed because the original item for _____ cannot be found” error…
/mnt/disk4/music Music allow:sean,xbox,vuong cnidscheme:cbd options:usedots,upriv
/mnt/disk4/software Software allow:sean cnidscheme:cdb options:usedots,upriv
Hi A Friend, thanks for the package link!
Hi Isam Haddad, did you try to manually create the disk image on your desktop first and then copy it over to your server? I’ve explained the steps under the Problems section in my article.
Hi Jon, basically your AppleVolumes.default line looks right. Did Kyle’s suggestions work for you?
Hi arjuna, sure, here is my line for the home directory share as an example. Notice there’s no space after the first user:
~/ "$u" allow:user1,user2 cnidscheme:cdb options:usedotsHi Robert, well if you want to make your Ubuntu server the central file server where OS X and WinXP clients can access and write files you just have to activate Samba along AFP/Netatalk on your Ubuntu box. So just use an ext3 formatted hard disk in your Ubuntu server and the file sharing protocols will do the rest.
But if you use Windows Vista you should consider using NFS for file sharing. Vista has optional NFS support and OS X has it included.
Hi MichaelH, thanks for this info! I’ve searched endless times for a way to stop the Vino server advertising itself so there aren’t two entries in the Finder sidebar.
Hi PeterG, glad it worked for you in the end. Looks like the usual Linux voodoo to get it work
Hi Casparz, well if you proceed with upgrading you will overwrite your self compiled SSL enabled Netatalk package. A better way would be to start with my instructions on how to compile the SSL enabled Netatalk package again. This way your package will be built from the latest Netatalk source available through the Ubuntu repositories. Just make sure to NOT overwrite the Netatalk configuration file (you should be asked for that). Oh, and a sudo apt-get autoremove couldn’t hurt in your case
Hi Tiriel, glad it worked for you.
There is some talk about netatalk causing corruption once the backup volume reaches max capacity due to missing support for some AFP commands. There’s a patch that is supposed to fix this. I could not find mention of this in your excellent post.
I could not find a lot of info about it but here’s a link: http://episteme.arstechnica.com/eve/forums/a/tpc/f/942005082731/m/370002065931?r=782005065931#782005065931
I’ve been able to successfully restore the system over the network after a harddisk upgrade, but I don’t remember if it was before or after the backup volume reached max capacity. Since a while back it has reached max several times over without any problems so far, but I haven’t checked any logs.
I use a gentoo-linux machine as host for the backup volume.
I set up a box and have been running an ubuntu studio wide server for a couple months now. This tutorial is perfect. And saved me actually having to go buy an XServe.
I am facing one problem, however. I have 2 shared volumes on the server. One is a 1TB external USB and the other is a 7TB raid. The problem is when I look at these drives on a mac, they both say only 66.6 GB available.
Normally it’s not a problem because the files that are transferred are less than 66 GB. But every so often when, say, we have a big job come in we have to transfer way more than 66 GB worth of files. Then I have to do it in sessions, breaking them up into smaller units.
Is this a problem for everyone? Is this just a mac thing? The sizes read fine on the Ubuntu box. They are just always reported as having 66.6 GB free on the mac.
Any thoughts would be helpful
Great tutorial. Stumbled on your blog, had an old Dell setting in the corner. Added memory and 2 TB HD and a few hours later everything works perfectly.
I have a Mac Pro (Leopard) connected to a Time Machine and broadband. Installed Ubuntu (Intrepid) on the Dell connected to a router and Time Machine.
In order to have faster speeds of transfer I’ve spent hours trying to direct connect the Ubuntu box to the Mac Pro, share an internet connection and still be able to transfer files. Despite hours of searching and reconfiguring both systems cannot share internet and files with direct ethernet connection between two systems. Any advice or have you seen a tutorial for this. Thanks again for the great detailed tutorial.
Sweet tutorial! I will try this at home and i might buy a real server for it if i get it working.
Thanks!
HI,
I am new at the whole linux code. This looks like a great idea and I want to do it so bad. I was wondering I have a Compaq D530 it has like a 60gb harddrive in it now. Can i set everything up on the 60gb and then buy a 500gb or 1TB sata and get an enclosure for it. The enclosure would be usb and can this do the same as an internal drive for backing up and file server? Thanks going to set the first part up in a few day. Maybe Thanksgiving cause NO SCHOOL and have to be with family later in the day. Thanks again
Thanks for the solution. Now I have one more question…
Is it possible to access the volumes from outside of the lan. Say from work? Can this be accomplished without vpn?
Hi,
If you want, I got the custom netatalk package compiled and running properly on a Debian Etch (4.0) System by using just these instructions. If you want it, just email me and I’ll attach it.
I got it all working…I need to add a external harddrive to see if the Time Machine is working okay. how do i get the external HD to show in the server next to the home directory. thanks
I need help changing the icon on mac side of things. I renamed the file and then put it in cortypes.bundle/contents/resources
how do i get it to show up thanks. this is an awesome build.
Thanks a lot for writing this great how-to. It worked perfectly the 1st time, and having AFP access to the Ubuntu server really streamlined development for me. Great site!
@kurt Say the external disk you have on your Ubuntu box gets mounted at /media/volume
As in point 3 all you need to do is add the following to the end of AppleVolumes.default
/media/volume VOLUME allow:username cnidscheme:cdb options:usedots,upriv
Also found I had to source these packages for my desktop 8.1 machine that were already available to my 8.04 server:
http://ftp.estpak.ee/pub/ubuntu/pool/main/o/opencdk10/libopencdk10_0.6.6-1ubuntu1_i386.deb
http://ubuntu.virginmedia.com/archive/pool/main/g/gnutls13/libgnutls13_2.0.4-1ubuntu2.2_i386.deb
Wow! Thank you SO MUCH for this guide! EXCELLENTLY written!
I am running osx 10.5.5 and ubuntu 8.10.
It did NOT work right off the bat — I was getting -5002 errors from Finder.
But this article did the trick:
http://blog.damontimm.com/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/
It seems in 8.10 you have to go an extra mile to get it to work.
… well that worked for the ‘Home Directory’ … but when I try to go into my ‘Time Machine’ share (/media/Z), Finder is saying ‘the original item could not be found’
Will look into this… must be my AppleVolumes file…
I was having connection problems using 8.10; this fixed them:
http://blog.damontimm.com/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/
THANKS FOR THIS AMAZING HOWTO!
I also cannot get it to mount an external. I followed Peter’s tip, but still nothing.
Console says:
/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder[202] NetworkNode::handleMountCallBack returned -6602My AppleVolumes.default has:
/media/Z "Z TimeMachine" allow:dzg cnidscheme:cdb options:usedots,uprivAny ideas?
Thanks so much for a well written article. I am a newbie to Ubuntu and was finally able to find your article that explained exactly what you need to do and why.
Excellent work.
I’d like to add another point. If you’re working on a Case-Sensitive Local Disk, you should also create the sparseimage using a Journaled, Case-Sensitive format.
thanks for the great tut! spared me loads of research figuring everything out by myself.
Hi Seron, many thanks for this info! I’ve added this to the article under the problems section.
Hi kurt, you can setup Ubuntu and Netatalk on your Compaq box to work over network. But this hard drive will be formatted as either ext3 or reiserFS and therefor you can’t just take it out of the linux box and plug it into your Mac. OS X can’t read ext3 or reiserFS. So if you’re planning to use a harddrive plugged into your Mac for use with TimeMachine just use it the supported way. No hacking required
Hi casparz, for accessing the disks over the internet I would use either FTP or SSH which you can setup very easily on your Ubuntu/Linux box. Remember to setup the right ports when behind a router.
Hi Ze’ev, what file system is your external hard drive formatted? Did you modified permissions on the external volume so the network user owns it?
Hi Christophe, good point! Thanks.
I followed this guide to allow access to external disks:
http://www.zaphu.com/2008/05/29/ubuntu-guide-mount-and-share-a-usb-hard-drive-with-macs-using-netatalk/
Also, this guide has more info for setting up Time Machine on external:
http://leamonde.net/smf/index.php?topic=2537
Helo, i’m runing 10.5.5 and ubuntuu 8.10
the AFP part works Great, but the avahi doesn’t work.
It never shows up in finder.
Please HELP!
PD: thas any one knows how to mount an AFP share on boot?
Nice work!!
Excellent article and great posts guys!
I love Linux and I love my MacAir so this is a GREAT thing to do!!
Keep writing these marvellous things!!
Beyond informative thanks you so much…..
has anyone upgraded to 10.5.6 and seen if this no longer works?
Just a heads up. 10.5.6 didn’t appear to break my netatalk functionality (I used the provided .deb file), however my Time Machine volume got a little gimped. I got an error that the volume was read only. Just chmod the sparsebundle file to 777 and the containing folder to 777 and you should be good to go.
Ze’ev, thanks for the links! Were you able to solve your problem with mounting and using your external disk?
Hi Aenima, so I assume you can connect through Command + K? Did you restart everything? Sometimes the Finder on the Mac won’t update itself.
Hi Sax, glad it worked for you!
Hi Brian, well 10.5.6 seem to not break File Sharing functionality on my side. Didn’t tested Time Machine yet.
Ian, thanks for the info! I hope the different permissions will be the only problem.
Anyone here tested a full system restore with 10.5.6 yet?
I finally get it working, but I will only will use it for time machine. I think that NFS works better for a file server.
With AFP when I play media from de share it hangs..but with NFS works perfect.
Awsome guide, working perfectly in a ubuntu 8.10 Virtual host on Server 2003.
running OSX (10.5.6) on my Macbook pro 15″ (Late 2008)
Hey
I keep having a problem with the disk image, although I’ve created one like you described in “problems with creating the backup disk image”
in the log I find:
Error 45 creating backup disk image
Failed to create disk image
Failed to create disk image
Backup failed with error: 20
AFP-VFS afpfs_unmount: /Volumes/backup, flags 0, pid 763
Ejected Time Machine network volume.
Any idea what could be wrong?
Kind regards Fred
Great tutorial. I followed the instructions generally to get this started on CentOS 5.2 i386 and OS X 10.5.6. The backup is still going though. Haven’t tried restore yet.
You should note that when you say “your network device’s MAC address” you really mean “the MAC address of the network device that your Mac uses to talk to your server”. My Macbook has an ethernet device and a wireless device, so it’s more likely that my Mac will use the wired port because it’s a faster connection.
G’day. Thanks for a great guide.
But I too got burned by the file-rename problem that Yorn talked about on July 17 above. The sparse bundle file needs to be renamed WITHOUT the .tmp. string.
Thanks again, I”m up and running.
Hi! I love your article and your site, but despite the thoroughness of the tutorial, I’m having a small problem. I think other people are having it too, but I couldn’t find a solution on this page. My problem is that I have an external hard drive connected using usb to the ubuntu box, and my shares to folders on the external hard drive won’t work. I get the message “The operation cannot be completed because the original item for ‘TimeMachine’ cannot be found.” Here is the line from my AppleVolumes.default
/media/TimeMachine TimeMachineDisk allow:username cnidscheme:cdb options:usedots,uprivThe only solution I found was the following, and it is a pain.
On Ubuntu:
sudo umount /dev/sdb1sudo mkdir /media/TimeMachine
On Leopard:
Go to Finder and open the TimeMachineDisk. It opens as an empty folder, which it is. The file called .AppleDB is created.
On Ubuntu:
sudo mount -t hfsplus /dev/sdb1 /media/TimeMachineOn Leopard:
Go to a different folder (sidebar is wonderful), go back to the bonjour server or the computer icon, and open TimeMachineDisk. VOILA! I can access the external hard drive like it’s any shared folder not on the EHD.
Now, is there any way to have that all done automagically? Or did I completely miss a very simple fix? I tried to read through the comments, but there is so many! My current solution is to mount the /media folder, but it doesn’t change for each of the different hard drive capacities.
Sorry for my bad explaining job.
Zach
Thanks!!! Works great!!! I have been trying to get this setup for months. Great tutorial!!
I went to add my girlfriends mac to my time machine backup and noticed I was getting the error:
12/25/08 9:55:56 PM System Preferences[128] *** -[NSCFString substringFromIndex:]: Range or index out of bounds
from her computer in the console when trying to select a backup disk. I can’t even change the disk on my own mac now.
All of my AFP shares work on all of the macs in my house, however it just seems that 10.5.6 broke time machine. Lame.
Excellent, look forward to trying it! In the meantime I’ve another question…
It seems from your tutorial that the afpd.service file is what tells another Leopard computer on the network which icon to show in the sidebar for that computer.
I have an aged iMac G4 (with the screen on an arm) running as a web server and running OS X 10.4. Although the System->….->Resources folder in 10.5 has an icon for this computer, it shows the generic Apple Cinema Display icon. I’m assuming that this is because the computer running 10.4 isn’t broadcasting the right information for 10.5 to understand. Do you or does anyone else know how I can get it to?
Thanks, and looking forward to setting up my linux system properly (when I get that working again…)
Martin
Thanks a lot for this guide!
One thing is still unclear to me:
Did anyone manage avoid needing a sparsebundle file using an ext2/ext3/hfs/hfs+/whatever-formatted harddrive attached to the Linux box???
If you did, could you please tell me how you did it???
First and foremost, this was an awesome guide! Thank you for taking the time to write it up. I followed all the steps to the ‘T’ and all is working fine – even the custom icons (which I must say are sweet!).
One thing I would like to know is if the username/passwords are the same on both the client (leopard) and server (ubuntu), should it not auto-connect when I select the server in Finder? I understand you can simply enter the same username/password and store it in the keychain but is this necessary?
Thanks again!
–Matt
Thank you! Great tutorial. I just set this up on a new installation of Ubuntu 8.10 and it works great with both my Tiger and my Leopard computers! Thanks again.
Thank you for the excellent instructions
I am using ubuntu 8.10 and this worked first time…
Hi Guys, this setup, per these instructions has been working great since September. But all of the sudden, the afp connection fails to connect upon start-up, I see a message ‘connection failed 32′. If I try the connection again, it connects fine, but not upon start-up. This same thing happens on my wife’s mac as well. Any ideas?
Great guide! worked perfectly. how do i set up my linux server to allow me to access this from outside my lan? I’ve heard that setting up a vpn is the way to go but havent found any EASY guides like this one to follow.
Just updated the Ubuntu box and it started working. Yay! Thanks for the awesome tutorial!
Thanks for this guide. I followed everything except I skipped the part about time machine, I may add that later. Here is my question: I have a second hd on my ubuntu box (just for shared files). How do I make it (120gig media) shared over the network?
I can rightclick files in it and enable sharing, but that puts them in the windows network:(
Thank you
Great tutorial. Thx for that. It’s working on ubuntu 8.10 with Leopard on the hard drive of my ubuntu server. When I connect and mount my WD mybook and change the configuration of the AppleVolumes.default to /media/mybook/backup and restart netatalk and avahi, the connection is refused. My fstab entry is:
/dev/sdb2 /media/mybook/backup ext3 noauto 0 0
Do you have any idea?
Thx Fred
Great tut!
I think I found the source behind the “Connection problem”.
In my setup I didn’t do the whole compile, instead I just went for the Ubuntu-package. After a restart of the netatalk-service I couldn’t connect to the server at all. After some trial-and-error I found the solution in /etc/netatalk/afpd.conf the problem was:
“uams_randnum.so,uams_dhx.so”
so I just changed
“- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh”
to
“- -transall -uamlist uams_clrtxt.so -savepassword”
Problem solved!
Thank you for this guide! You saved me a lot of time here.
Regards, Joakim Ek
This is a phenomenal tutorial. Thanks for taking the time to keep it updated.
Works fine with Debian as a server and Mac OSX 10.5.6 as a client. However, I had to compile netatalk with SSL support since Debian doesn’t do that out of the box for licensing-reasons. I used the following howto for compiling:
Link
Additionally, I needed to create the sparsebundle manually:
http://www.stocksy.co.uk/articles/Mac/getting_time_machine_to_work_how_i_want/
Thanks for the good work!
Is it still necessary to go through all of this with 8.10? I finally got the server set up, but the mac book doesn’t seem to want to find it.
Is anybody else having a problem where the server reports the wrong size to finder? Both of my shared HD’s on the ubuntu machine report somewhere around 66GB available (these fluctuate as much as 1 gig. right now they both report 65.48 GB). Anyway, I’ve run into 2 errors with this. First, I can’t copy files or directorys larger than 66GB (I work with lots of video so sometimes I need to copy hundreds of gigs at a time). Secondly, I recently ran out of space on one of my HD’s but it didn’t warn me as it was getting close.
Just wondering if anybody else’s drives only report a certain size and if anybody found a fix for it?
Great tutorial by the way!
hey! great tut! everything is working as it should. although i have one question.
My ubuntu server is running on a spare pc i have, and i was accessing it through osx on my laptop. However, i recently installed ubuntu on said laptop and I am now trying to access my server. Do i need netatalk installed on my ubuntu laptop in order to access the server?? its not showing up anywhere.
thanks !
Awesome tut! thanks for the instructions! almost everything is working except time machine. my volumes are in the sidebar, I can mount them and create/delete files ok. Time machine mounts the volume ok but then comes a backup…..I get the following message:
The network volume could not be mounted because there was a problem with the network username or password.
another problem is that I dont have a large enough space on my MBP to create a sparse image
also what command to use in terminal the screen outputs what time machine is doing? as seen in conclusion.
Any help would be great, Thanks for your assistance
Craig
Hello Matthias,
Thank you for putting together this great tutorial. I have been able to get everything about 90% set up following your guide. I’m running into an issue when trying to create the initial backup, but the console on my Mac is showing some errors, and the initial backup fails (I’m not at my Mac at the moment). I have checked the user rights on my Ubuntu 8.04 machine, and everything lloks correct.
I did have a question about the file system that I should be using on my Ubuntu box. I’m currently using XFS on my main /home partition. Should this be ext3 instead?
Could XFS be playing a role here?
Your thoughts would be very much appreciated. Has anybody else run into any issues with an XFS file system?
Many thanks in advance
Jeremy
When it comes to sharing everything works fine and great for me but when it comes to using Time Machine it seems to be a different story
For some reason Time Machine will only let me select the home dir as its location. The problem with that being is there is just not enough space and I want to use a separate partition for its destination. I have to sym link the home dir to the partition, I have also tried changing its home dir to the partition but it just wont work. Any suggestions?
Great HowTo….functionally, I’ve got everything working exactly as I’d like. I had to create my Time Machine disk image manually using your instructions. The only think left is to set my disk image icon to the correct time machine looking one…any idea’s where that disk image icon is located?
So, trying to keep up with answering the many new comments here. Sorry if I don’t have a solution to everyone’s problems here.
Hi Todd, thanks for this hint about the MAC address. Updated the article with your wording.
Hi Zachary C., seems like the problems with external disks still remains. To automatically mount something on your network you could try the little Mac app Bonjour Mounter. It can mount your shares silently in the background.
Hi Ian, as I’ve written the 10.5.6 update brought some AFP changes and it seems your a victim of them
Seems like the only way to get it to work again is to setup everything on the Mac side from scratch
Hi Fredrik, as far as I know Time Machine always needs a disk image when working over network. I believe this is also the case with Apple’s own Time Capsule but I’m not quite sure about the latter.
Hi Matthew Bowman, well AFP is always login-based networking. So you must have a user account on the linux box and use that login data to connect from the Mac side. When you save this login data in the Mac keychain the Mac connects automatically the next time. And to avoid some problems at least the username should be the same on both machines.
Hi adam, there’s still no graphical way to share a folder via AFP/Netatalk in Ubuntu. If you want to share another folder you have to make another entry in the AppleVolumes.default file as I’ve described in the third part of my article.
Hi Ubuntu, yes it’s still necessary to go through all these steps to get AFP sharing with Ubuntu 8.10/Linux. And this remains as long as there is no graphical way to do all this in Ubuntu/Linux
Hi hn0j, there’s no graphical implementation of AFP/Netatalk on Ubuntu/Linux so your AFP shares won’t show up anywhere on another Linux box. You could either connect via the terminal with the AFP client afps-ng installed or just use another protocol like sshfs for Linux-Linux connections.
Hi Craig, to see what Time Machine is doing on the Mac side you have to use the Console app in the Utilities folder, not the Terminal app. Also be sure to FIRST select sparse bundle disk image as image format in Disk Utility and THEN set the size of the image. This way it doesn’t matter if there is not enough space on the disk where you create the disk image.
Hi Anthony, you should make sure to give the additional share the same user rights as your home folder and Time Machine should be good.
Hi dean, you don’t have to replace the generic disk image icon. To replace the icon of an application/file/folder/disk on Mac OS X simply ctrl + click (or right-click) on the desired application/file/folder/disk and click “Get Info”. Leave the Get Info dialog open and browse to an icon from this site for instance. There are folders with the icon applied on them. Now simply ctrl + click (or right-click) on the desired folder with the icon applied to it and click “Get Info”. Now click on the icon in the upper left corner so it has a subtle shine around it noticing you it’s selected. Now copy the icon by hitting command + c or choose Edit > Copy from the menubar. Make the dialog active we have opened in the first step by clicking on it and select the image in the upper left corner and hit command + v or choose Edit > Paste from the menubar. Now the desired icon should have been applied to the new folder.
Thank you for the guide. My setup: Server running Ubuntu 8.04 LTS and client running OSX 10.5.6. Timemachine works flawlessly, but my only problem is my music folder on the server. From the client, I can browse everything but my music folder. Although I occasionally can browse and play mp3 files from the folder. The folder permissions for the folder on the server are drwxrwsrwx. If I restart the avahi daemon I can browse and execute files, but all of a sudden, the connection to only the music folder drops. Can anyone help?
Great tutorial!
In my case I had to carry out one additional step, which was to create a file called “.com.apple.timemachine.supported” at the root of the AFP volume. I found this tip which was posted by Ken Allen on the following web site:
http://www.fey.ca/blarchives/2007/11/18/time_machine_and_netatalk.html
This link was also useful:
http://maketecheasier.com/ubuntu-intrepid-how-to-share-file-with-mac-os-x-via-netatalk/2008/11/05
I did end up rebuilding my Linux box using ext3 as my file system.
Be sure to ensure that you add any mounted disks to the list of files that are NOT to be backed up.
I’m all up and running and feeling very geeked!
Kind regards
So here’s the gotcha I ran across … Time machine created the sparse file ok, but wouldn’t write to it. I (lazily) copied the sparse file name over to create the disk image using diskutil. Ahhh but timemachine was too smart for me! It had inserted a tmp before the sparse file (I guess because it didn’t create the file fully). I renamed the file sans tmp, copied it over to the network disk, and perfection. Hope I’ve helped at least one lazy soul out there like me.
Trouble…
I followed this awesome tutorial and had everything working perfectly with Ubuntu 8.10 i386. I got a wild hair and re-installed the AMD64 flavor of Ubuntu 8.10 and now there are problems.
Avahi seems to be advertising things correctly but when I connect from my mac, it says “connection failed”. According to the various log files in /var/log it would seem that AFPD is segfaulting. I’m not sure if the bit about PAM is of concern.
Can anybody offer any insight?
auth.log:Feb 14 08:46:30 humongus afpd[28506]: PAM unable to dlopen(/lib/security/pam_cracklib.so): /lib/security/pam_cracklib.so: cannot open shared object file: No such file or directoryauth.log:Feb 14 08:46:30 humongus afpd[28506]: PAM adding faulty module: /lib/security/pam_cracklib.so
daemon.log:Feb 14 08:46:30 humongus afpd[28499]: server_child[1] 28506 killed by signal 11
messages:Feb 14 08:46:30 humongus kernel: [ 1447.662042] afpd[28506]: segfault at 7fb6dc796520 ip 00007fb6dc5883fb sp 00007fffe478e010 error 4 in ld-2.8.90.so[7fb6dc57a000+1f000]
syslog:Feb 14 08:46:30 humongus kernel: [ 1447.662042] afpd[28506]: segfault at 7fb6dc796520 ip 00007fb6dc5883fb sp 00007fffe478e010 error 4 in ld-2.8.90.so[7fb6dc57a000+1f000]
FWIW, apt-get was spitting out bunch of noise about most of the packages installed by the netatalk no longer being needed which I thought was weird. I went through this a couple of times, purging everything and starting over (including letting apt-get autoremove get rid of the allegedly extra stuff).
Somewhere along the way I did an apt-get update and there was an udpate to dpkg available. After I did this update I no longer get the laundry list of freshly installed packages no longer being needed (I think).
afpd is still seg faulting though….
Any ideas on what the problem may be or how to investigate it further?
Thanks again,
Mike
I think I just solved the problem. I was digging around trying to find some way to turn up the verbosity of logging form netatalk and found somebody posting a solution to trouble writing to a directory. They removed the .AppleD* files from the exported directory.
I just removed .AppleD* from my problematic directory behold, it works!!! ie. afpd is no longer segfaulting.
Any thoughts on what might have happened?
Mike
this is really great it works across windows, and mac? correct?
Tokies,
This is about setting up Apple File Sharing on a linux machine. I have lost touch with Windows but its my understanding you if you want to share files to/from Windows/Linux you need to setup SAMBA.
Now, with that said… If Windows now includes the ability to understand Apple File Sharing than it should work.
Mike
Im having a small error, and it is more than likely my own fault in configuration. However I have a ftp server mounted via curlftpfs to /home/web_drop/ftp. Over AFP I can mount the drive Web Dropbox (pointed at /home/web_drop) yet I can not see, not access the ftp server. If I umount the dir, it appears. This is probably due to how the permissions changes when it becomes a mount point, but is there a way to be able to access this, or am I just asking for trouble?
No matter what I do, Icant seem to compile/buildpackage netatalk! It keeps failing towards the end of the configure script. Any help? (Ibex)
checking for dlclose... yes/root/src/netatalk-2.0.3/./configure: line 23286: _LT_CMD_GLOBAL_SYMBOLS: command not found
checking for _ prefix in compiled symbols... no
/root/src/netatalk-2.0.3/./configure: line 23345: syntax error near unexpected token `newline'
/root/src/netatalk-2.0.3/./configure: line 23345: ` _LT_TRY_DLOPEN_SELF('
make: *** [config.status] Error 2
Anyone able to help me out? Check my thread at ubuntuforums.
http://ubuntuforums.org/showthread.php?t=1071234
Thank you for this great tutorial, first I have done just: “sudo apt-get install netatalk” the service have been installed and started.
I want to connect from my home mac to my work ubuntu station.
I ‘ve got a lot of “mount_afp: AFPMountURL returned error -5002, errno is -5002″ even thru the command line
sudo mount_afp afp://user:pass@hostname/shared /Volumes/sharedand nothing worked until I have done it your way like in the tutorial, downloaded the sources compiled them and all worked on the first try.
I was worried about some firewall between home and work.
But now everything works great.
PS: i didn’t installed the avahi nor configured it.
Thanks again to the commenters also
Mike
Great article!!! Thank you very much! I got the most of things working, fileshare and timemachine. Only have one tiny issue. The time machine volume show up on the Mac side as “cnidscheme:cdb”, although I have followed the AppleVolume.default updates exactly. I have two lines. One volume just the users home, the other is for the TimeMachine.
~/ "$u" allow:user cnidscheme:cdb/home/user/TimeMachine "TimeMachine" allow:user cnidscheme.cdb options:usedots,upriv
Hi Matthias,
Would you mind explaining why I’m editing nsswitch.conf? At least on
Intrepid, I can “ssh myserver.local” the instant I’ve installed
avahi-daemon and libnss-mdns. I’d just like to know what this step
actually /does/, and it doesn’t seem very clear from the nsswitch.conf
manpage.
Cheers,
Dave
I suspect that libnss-mdns is not required at all. This module and the nsswitch.conf changes would make your ubuntu box “see” other devices (like other netatalk fileservers and probably macs) as if they had entries in your /etc/hosts file. I don’t think this is required to make your Unix box be a fileserver, and is more so that your unix box can see other fileservers.
However, I could be wrong, and maybe afpd needs to resolve connecting mac clients names.
I’d still love an explanation, but I must’ve been on crack about ssh working. In fact, installation crashed in dbus-daemon! See https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/334548
in case you suffer from disappearing bonjour server minutes after you started the avahi-daemon.
read this: https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/116984
seems like in the later packages of avahi drop connection after some time.
i can’t even get cups to work, because it uses bonjour to serve.
anything that points to the top level domain “.local” is broken after a short period of time .
if you like to mount your afp/smb/whatever be sure to press command + k in finder to connect to your shares.
quota is (smb://) or afp://ip.of.your.server/sharetomount
you can also drag your mounts to the startup list in the user menu of your system preferences, so they will be mounted at startup.
if someone has a workaround or know if this bug was fixed in the present package of avahi (0.6.24) then please fire up an email to sebastian |at| markow |dot| org
thanks in advance
very nice thanks allot!!
like really !
keep it up
Hi Matthias,
Very nice tutorial, a beautifully designed site, and killa icons, thank you.
Wow, for something that is supposed to be easy for newbies I sure had a heck of a time getting this to work on Intrepid. Anyone who cares can find out more about the system I did this on at TechArcana.
To start with there was this dbus crash bug that I mentioned earlier. To get around that I actually needed to temporarily comment out the start-stop-daemon –start line in /etc/init.d/dbus so I could get installation of avahi et. al. to complete. I looked for ways to untangle the mass of dependencies around the avahi-daemon package — after all, you shouldn’t need dbus, and especially not dbus-x11 to get avahi running (I have avoided installing any X11 stuff on my server)… but it ain’t easy, at least the way the ubuntu package sources are constituted.
Then there was the crazy behavior of netatalk upon initial installation. Before I had a chance to edit /etc/default/netatalk, “starting netatalk (this might take a while)…” was all too true. In other words, it never completed. Most things I could do on my existing ssh connections would lock up in an un-killalble way and I couldn’t make any new connections. So I went downstairs to the server, and for some reason I decided to unplug one of my two bonded ethernet connections, which brought everything back. I have no idea which of the things we turned off in /etc/default/netatalk was responsible for this behavior.
Finally, there was what happened when I tried backing up a 2nd machine to my TimeMachine volume: write permission problems. It didn’t get around to trying (and failing) to create “kicoo.luannocracy.com_002332ceca1e.sparsebundle” because first it would fail to write “.002332ceca1e”. Before any of this I had created a TimeMachine group on the server containing all the users that need to do backups, and given the group write permission on the folder. So what was going wrong? I took a wild guess that the files .AppleDB, .AppleDesktop, and .AppleDouble in that directory had something to do with it. They had all been created by the first user to do a backup, and this other user didn’t have write permission on them. So I changed their group to TimeMachine and was able to continue with the next user.
A couple things still don’t seem to work so well. For one thing, it seems to take a rather long time (10-12 sec) to establish the connection to the netatalk server, considering everybody’s on the same fast, local network. For another, despite having set up avahi, I somehow still can’t “ssh hydra.local” from the client machines. I wonder what’s missing — dbus doesn’t seem like a likely culprit here.
A note about building .debs: you don’t need sudo until it’s time to install them. That’s what the “fake” in “-rfakeroot” is all about
. Strickly speaking, it’s better not to enable full root privs except when they need them.
Cheers,
Dave
Great Tutorial… and I also hate to re post this output. this was never answered earlier that I could find. I’ve tried it both ways. your way and the one with the extra sudo. It is a copyright problem and I have no idea how to fix…(at least I think it is…)
Actually I will not re post it… kapetanski posted the error so please refer to his post… Now your way..
sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot
de-esculator’s way…
sudo DEB_BUILD_OPTIONS=ssl sudo dpkg-buildpackage -rfakeroot
either way, I still receive the same results. any help here?
My dbus crashing problem is fixed by the patch attached here: https://bugs.freedesktop.org/show_bug.cgi?id=15922
This bug probably only affects people who are using FUSE for a part of their regular filesystem (/usr, in my case).
First, great tutorial (look and content), thanks a lot!
Two things I’d like to share after spending three days setting up Time Machine on my Ubuntu (8.10) box.
* After messing around, I eventually ended up locked away completely from netatalk. No matter what I would do, I would get a ‘A volume failed to mount. The volume “Home Directory” could not be mounted’ error in the Finder. I tried to apt-get purge netatalk, find / and remove netatalk remains, etc. Nothing worked. Eventually, I reinstalled Ubuntu. Tested on the vanilla installation, it worked. Imported my old $HOME, got the same error again. I figured this wasn’t related to netatalk, but rather something in my home directory. Eventually, I narrowed it down to .AppleDB .AppleDesktop which are created at the root of your shares. Most probably, .AppleDB had corrupted files which were causing the ‘A volume failed to mount’ error.
Reverted back to my previous Ubuntu installation (thus saving myself hundreds of hours of configuration), rm -rf’ed those folders (and the DS_Stores/AppleDouble while I was at it) and it worked fine.
Second point. Some people have noted that the 2.0.3 release of netatalk does not actually support Time Machine. You can end up with a broken backup if you bust the maximum size, and you can’t actually create the sparsebundle image on the share drive directly. There are work arounds, but it kept me worried. The FPSyncDir was added in version 3.2 of AFP, is being used by Time Machine (and hdiutil when creating the sparsebundle), so I didn’t feel safe knowing I was bypassing some errors.
The good news is that netatalk has been patched. Bolke de Bruin submitted a patch in april 2008 which was then further updated and eventually merged into the HEAD of the cvs (currently corresponding to 2.1dev). There were stil minor fixes until last December (you can follow on the mailing list)
The latest available debian packages for netatalk are 2.0.3 and they are preparing 2.0.4 for Jaunty (9.04). 2.0.4 does not contain this patch – perhaps it will be updated?
Anyhow. Here’s what I did
checked out the CVS version of netatalk./autoconf
./configure
make
sudo make install
By default, it will install everything in /usr/local instead of just /usr
I kept the debian package of /etc/init.d/netatalk but changed the paths to /usr/local
I moved my config files from /etc/netatalk/ to /usr/local/etc/netatalk
/etc/init.d/netatalk restartAnd it worked perfectly. Time Machine (and hdiutil) is capable of creating the sparsebundle image without an error, no need to hack your way with your MAC address and move your image on your network share, etc…
Of course, HEAD of netatalk might not be 100% stable, it’s up to you.
Nice runthrough, thanks.
In addition, the following 2 steps are useful:
1. Configure Screen Sharing
On ubuntu, choose System>Preferences>Remote Desktop
Sharing
Choose Allow users to view…
Choose Allow other users to control…
Security
Deselect Ask you for confirmation
Choose Require the user to enter this password ******
Advanced
Choose Use an alternative port: 5901
On your mac, click the linux server in finder and choose Share Screen
Type your password and then connect
2. (cosmetic, but worthwhile) Make your ubuntu box look a bit like a mac
http://maketecheasier.com/turn-your-ubuntu-hardy-to-mac-osx-leopard/2008/07/23/
This is how every tutorial should look like. It’s perfectly written, easy to understand, and foolproof. You also went the extra mile to create the Icons – wow.
I have installed this system on my personal testing-PC, and I am now thinking of building a NAS using this Tutorial to have my Files secured on a RAID 5.
Thank you so much for writing this tutorial.
Very Impressive Tutorial.
Everything works like a charm.
Thanks !
I downloaded the patch for FPSSyncDir command to fix timemachine blowup from the link in http://marc.info/?l=netatalk-devel&m=121084448214854&w=2 and put it in the directory where the src is downloaded to. Then I did:
ln -s netatalk-2.0.3/ netatalksudo patch -p0 < netatalk_fpsyncdir.patch
cd netatalk-2.0.3
sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot
cd ../
sudo dpkg -i netatalk_2.0.3-11ubuntu1_i386.deb
I’ll let you know if it blows up
Thanks for such a detailed description. I had used your info with Kubuntu and got it working well. However, I’m not sure what happened, but for some reason my MacBook would enter beachball spinning la-la land when trying to connect to the afp share. It wasn’t related to Time Machine as I would get the same problem when connecting through finder.
My Console log showed this stuff repeated over and over:
3/10/09 8:49:23 PM kernel ASP_TCP CancelOneRequest: cancelling slot 14 error 35 reqID 8 flags 0×19 afpCmd 34 so 0x49c7cc0
3/10/09 8:49:23 PM kernel AFP_VFS afpfs_DoReconnect: get the reconnect token
3/10/09 8:51:24 PM kernel ASP_TCP HoldPendingReqs: holding slot 16 reqID 8 flags 0×9 afpCmd 34 so 0x49c7cc0
3/10/09 8:51:24 PM kernel ASP_TCP Disconnect: triggering reconnect by bumping reconnTrigger from curr value 14 on so 0x49c7cc0
3/10/09 8:51:24 PM kernel AFP_VFS afpfs_DoReconnect started /Volumes/TimeMachine prevTrigger 14 currTrigger 15
3/10/09 8:51:24 PM kernel AFP_VFS afpfs_DoReconnect: doing reconnect on /Volumes/TimeMachine
3/10/09 8:51:24 PM kernel AFP_VFS afpfs_DoReconnect: soft mounted and hidden volume so do not notify KEA for /Volumes/TimeMachine
3/10/09 8:51:24 PM kernel AFP_VFS afpfs_DoReconnect: Max reconnect time: 30 secs, Connect timeout: 15 secs for /Volumes/TimeMachine
3/10/09 8:51:24 PM kernel AFP_VFS afpfs_DoReconnect: connect to the server /Volumes/TimeMachine
3/10/09 8:51:24 PM kernel AFP_VFS afpfs_DoReconnect: Logging in with uam 7 /Volumes/TimeMachine
3/10/09 8:51:24 PM kernel AFP_VFS afpfs_DoReconnect: Restoring session /Volumes/TimeMachine
3/10/09 8:51:25 PM kernel AFP_VFS afpfs_DoReconnect: Primary Reconnect failed 5 on /Volumes/TimeMachine
3/10/09 8:51:25 PM kernel AFP_VFS afpfs_DoReconnect: trying Secondary Reconnect on /Volumes/TimeMachine
3/10/09 8:51:25 PM kernel ASP_TCP CancelOneRequest: cancelling slot 16 error 35 reqID 8 flags 0×19 afpCmd 34 so 0x49c7cc0
3/10/09 8:51:25 PM kernel AFP_VFS afpfs_DoReconnect: get the reconnect token
Not finding any obvious solution (I’m new to Macs) I did find a few posts about using Samba with Time Machine similarly. Since my Kubuntu box has Samba setup and working fine I tried it. After figuring out it would fail to mount my sparse bundle if the file had a space in the name (if my computer name had a space), I changed my computer name and away it goes.
It hasn’t finished and I haven’t yet tried to view the backed-up data, but I’m encouraged. Anecdotally, the SMB protocol speed of backup (I’m using a wired 100 Mbit connection) isn’t as fast as AFP was. I would see the AFP backup maxing it out at about 10 Megabytes/sec whereas the SMB connection is much more sporadic (up and down from 1 Megabyte up to 8, but averaging about 5 Megabytes/sec.)
I wish I knew what the burp was with AFP on my MacBook. I did make sure that the netatalk update was “held” in my pacakage manger, but I wonder if some related library got updated and that broke it. Not sure why the Macbook would keep trying to connect over-and-over-and-over, either. The only way I could get the beachball to go away was to power of the Macbook via the button (hard power off.)
Anyway, thought I’d share my experiences. Thank you again for such a nice (and aesthetically pleasing) HOWTO.
I had followed the instructions and was still having trouble. Getting several different errors such as “The backup disk image could not be created” and The backup disk image could not be mounted”. Some of the errors I got were:
Backup failed with error: 21
Backup failed with error: 20
Backup failed with error: 17
Backup failed with error: 19
I followed the areas above but what I found was the “computer name” needed on the sparsebundle is the one located under System Preferences -> Sharing -> Edit. Everything before the period and then adding and “_” with the MAC address and then a “.sparsebundle”. I also changed the permission on the directory to 777.
I am using a LVM on ubuntu 8.04.2 server over 2 250GB and 1 40GB. I also installed the hfsplus packages and created the Time Machine “fake” time capsule as HPS+. Just thought I would share and I hope it helps.
Question: I think I got it to work but I am unable to see the 2, other TB drives connect to my linux box
Is there any way I can fix this or is this the way it is suppose to work. I wonder if I did this correctly.
I also want to say thank you for posting this i got most of it to work which rocks!!!!!
Just a question, has anyone who setup Netatalk/Avahi/Firefly had any issues with a conflict between the built-in, what I believe to be Howl MDNSResponder in Firefly and the Avahi damon? I’ve been struggling with this on a FreeBSD box to no resolution and even though I’d love have used Ubuntu the issue that I had with Ubuntu is it’s lack of support for LSI’s MegaRAID-mbox RAID array. I picked up an Intel Server on ebay with this RAID controller with SCSI disks and could not get 8.04 going but FreeBSD installs and runs just fine.
i have a dual boot windows install on the same computer i have set up my mac file server so i often need to get to some of the files i have on the windows xp install so how would i make it so i can get to that partion of my drive from mac like i can with in ubuntu this somthing i need i think i have to do somthing with media in the AppleVolumes.default ?
I followed the guide and everything worked. This is a sweet Samba replacement.
Thanks
This tutorial is well-done and well-written, and this entire thread demonstrates that – at least in some few corners of the internet – the signal-to-noise ratio can be dominated by the former, rather than the latter. The level of language and the specificity provided in followups is very high relative to most such undertakings.
Congratulations to all contributors – and particularly the original author, krema, not only for folding suggestions, tips, and corrections back into the top-most text, but for indicating having done so in a followup that includes the tip, suggestion, or correction. Kudos, kudos all around!
This is indeed the best tutorial on ‘anything’ Linux I have ever seen.
I have been using this since it was written last year with no problems. First on 8.04, then a complete re-do with 8.10. It was working fine both times, though I recall having to fiddle a little bit with avahi to make it work.
Well, I completely formatted and re-installed 8.04 recently. I did this so I could easily run Zimbra, which is running like a champ. They don’t recommend running anything else on the same box, but for a home networking and mail server, I’m not going to run two.
However, for the life of me I cannot get avahi to advertise properly and I am having trouble just figuring out how to troubleshoot this. I suspect it has something to do with Zimbra also being installed, but am not sure. I am running BIND on this server with split-dns, so my internal domain is named the same as my external domain, but it resolves to internal IPs.
The hostname is mail.domain.com and resolves to 192.168.0.10. There is an mx record for this as well, required by Zimbra. Netatalk seems to work just fine, I can connect via cmd-k -> afp://mail.domain.com and all my volumes come up and I can connect. The funny thing though, is that it is pretty slow unless I turn off avahi all together. With avahi completely turned off, then the cmd-k procedure is lightning fast.
So, I think there is a conflict, but how do I troubleshoot that? Where are the log files and how do I increase verbosity if I need to?
Thanks,
kazoo
DOH!
Nevermind. Of course writing and posting this made me think to keep looking, although I’ve been checking and triple checking my spelling and everything lately.
Turns out that it was extremely simple: /etc/avahi/services/afpd.services is what I had and it should NOT have had an ‘s’ at the end.
So just take these two comments as a “boy do I appreciate kremalicious!” comment.
kazoo
Turns out that it was extremely simple: /etc/avahi/services/afpd.services is what I had and it should NOT have had an ’s’ at the end.
AAAARRRGGGHHH!!!! Half-day spent only for that …
Hey, i used your article to get timemachine to backup to a linux server. Just wanted to say thanks, as it worked out perfectly and its backing up my drive as i type this.
Thanks
Thanks so much for making this easy to do. So often I find tutorials for various sysadmin tasks which have critical flaws, and I end up having to spend so much time to make it work. But this tutorial is *perfect*.
Everything works just as it should. Great job!
Cool!
Finally a way to let my Ubuntu-PC show up as Mac-Server. I was looking for this quite some time now!
Also the info on how to do a full systm-restore via network is awesome!
Everything I need now is a great harddrive, to get rid of that anoying 300gig space-problem I have…
I too was running into the “”Connection Failed – There was an error connection to the server. Check the server name or IP address and try again” error, and Erik’s excellent fix didn’t work for me.
After poking around in console and various logfiles, I figured out Leopard was throwing a fit about no encryption for the password, and instead of giving me any useful error message, it would just kill it quietly. I recompiled once again, making sure to copy and paste all commands. It turned out that I had mistyped “ess ess ell” as “ess ess 1″, and encryption wasn’t compiling properly during the build for netatalk.
Breathless! I really enjoyed following this ‘beautiful’ HowTo.
After launching this command:
sudo dpkg -i ~/netatalk_2*.debI got this error:
nbp_rgstr: Connection timed outLuckily Google told me this.
Apparently because i have VMware server installed, I had to add
eth0to /etc/netatalk/atalkd.confGood luck and many thanks from Ghent, Belgium!!
hey I was wondering what kind of hardware setup you used for this? I have a fairly new amd Machine last 2 years that I used for gaming that I would love to recycle in to a file, media server for My new imac, my ladys’s imac and my macbook. But I want to do it as a network drive. Any ideas would be great
Hi krema,
Very nice tutorial. Sharing a directory on my bootdisk is as easy as followin the steps \o/.
Yet, i also got stuck on an issue listed in these comments. I could not find any solution for the “original item cannot be found” problem.
Sharing my home directory was no problem and works flawless.
But for time machine i need a bit more space than my bootdisk. Therefore i wanted to share my raid array. It sounds difficult but its only another disk/partition as far as ubuntu is concerned.
The comments above suggest that ubuntu mounting (eg /media/massive) will not work. I did try but it failed. Another solution was to mount the sda2 partition from the massive drive into my file system. So i mounted it with fstab as described here: http://www.psychocats.net/ubuntu/mountlinux
The mount shows op fine, i can do whatever i want on this disk. After adjusting the AppleVolumes.default file the error from the Finder remains. Also after restarting avahi and netatalk.
I must be doing something wrong here, yet i cannot see what it is. My opinion tells me that sharing any folder on any drive should be a trivial task. Can somebody help me with this problem?
If you want to help me, please don’t make your help all-to-abstract since ubuntu can be hard to understand sometimes.
Addition: sharing the whole /media folder is a workaround. Yet those disks are not auto-mounted.
Sharing the entire /media is no solution. its part of the ubuntu file system/disk so dumping a backup there is not really a solution.
My gut feeling tells me it’s a permission problem, but why should it be so hard to find it out?
@Brian Catlett and others:
Basically, you need next to nothing except for Harddrives.
Here’s what I bought. The Box is running like a champ.
1x Elitegroup A780GM-M, 780G
The Mainboard. It’s small, cheap, and comes with 6(!) SATA Ports for Harddrives. It also has a Graphicschip, which is perfectly fine for a server.
1x AMD Athlon 5050e
Mind the “e”. It stands for “energy efficient”, which is great for these kind of computers. You could also buy a Sempron one and pay even less, tough I wanted a little more bang for the other duties of my Fileserver (BitTorrent, encoding DVDs, Webserver, Teamspeak).
1x 2GB RAM
Why 2GB? Because I could. 1GB was 17€, 2 were 22€.
3x Western Digital Caviar Green 1000GB, 32MB Cache
These drives are cheap, near silent and more than fast enough for a Fileserver. They also run very cool.
1x 12cm Noname Cooler.
This one blows cool air towards the HDDs.
——–
This made about 450€, since I already had a case lying around.
You’d also need another HDD for the operating system. Just ask around – any HDD with more than 20GB comes into question, and it really doesn’t matter if you buy it second hand.
For this, I got:
1,8 TB usable space (RAID 5, soon to be 2,8 TB)
A very nice Server for Teamspeak, Apache etc.
A very nice computing machine for DVD transcoding.
Peace of mind regarding backups, aaaaaannnddd…
Recognition.
Thanks again for this tutorial, it made my life much easier.
Note: you may see some “afpd: bad function 4F” messages in your syslog. Apparently they are not meaningful and there’s a way to suppress them.
Note 2: you may find that your unicode filenames don’t work so well unless you enable the UTF8-MAC encoding in Netatalk.
Note 3: I also tried this hint for speeding up time machine’s performance over the network, with a compromise band size of ~100M. I didn’t measure anything, but I find I am seldom annoyed anymore by long, slow backups.
Sharing the entire /media is no solution. its part of the ubuntu file system/disk sikiş so dumping a backup there is not really a solution.
My gut feeling tells me it’s a permission problem, but why should it be so hard to find it out?
Excellent, Awesome, Suburb!
Thanks you so much for an excellent tutorial. So far working like a charm. Doing a 120GB backup as I’m typing. All I had to do was to follow the tutorial up top and the creation of the sparsebundle. Working on MacBook Pro OS X 10.5.6 and Ubuntu 8.10 AMD 64-Bit.
Great tutorial, worked well for a while.
I followed all the steps and within half an hour I was backing things up. About a week later the time machine backup on my mac was complaining about the password. I tried resetting it on the client and the server and no good. I finally ditched my backup created a new sparsebundle and then it would connect. I have no idea what went wrong.
Later I bought a new HD for my macbook and rather than installing I restored to it from my linux timemachine as per this article, awesome. No a week later I can no longer connect to my time machine. If I try it totally crashes my mac and I need to hard reboot. I tried ditching my sparsebundle again and recreating it but everytime I try to browse the timemachine folder with finder or try to set a network time machine folder my machine locks up and I need a hard reboot. This sucks.
Anyone else have this kind of error?
Please note I didn’t make any significant changes to either system. On the mac just software updates and on the linux box just updates via pat. And yes I did hold back my custom netatalk.deb pkg.
I miss timemachine. Please help
oops
I meant software updates via apt
not pat
Sorry
Just noticed, this is new
I can now turn on timemahcine on my mac but it doesn’t see the timemachine share on my linux box. This is new. Yesterday it would see it and crash if I tried to point to it.
WEIRD
This is great! Thanks so much. With your tutorial I was able to get afs and TimeMachine working perfectly, I can forget about SLOOOW Samba now.
Thanks for the tutorial, very easy and did exactly what I was hoping it would.
I did run into a problem recently though, the server was up and running fine for about a week and now I get a connection failed error ¨The server may not exist or it is not operational at this time. Check the server name or IP address and your network connection and try again.¨
I tried some of the solutions above that people had listed but it seems like this error is slightly different and thus far nothing has worked. Any input would be great. Thanks.
Hey!
Now can I access the files only from my local network or can I also access them via the internet (like a network drive) just like I could with an HP Media Smart server?
I’m asking because I wanna have all my data on the server at home and only the most important files and applications on my MBP.
When I’m on the road and I need some files that are stored on the server, can I access them somehow?
- flo
Wow. Just did this a 2nd time – without the Time Machine part – on a nother Ubuntu 9.04 box. Thank you SO MUCH!
FYI: one tip: the netatalk “text-gui” installer came up for me somewhere in the course of these steps:
sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot
sudo dpkg -i ~/netatalk_2*.deb
I had a hard time making it go away. The secret is to use TAB to highlight “Ok” and then hit ENTER.
This is a great article! Very easy to follow and now I can use time machine without spending a ton of money.
-Travis
I had some problems using the provided .deb-File on my ubuntu32 maschine (running in vmware fusion) so i build my own deb-file.
You can get it via http://dl.getdropbox.com/u/84866/netatalk_2.0.3-11ubuntu1_i386.deb if you like. Use on own risk.
Netatalk is back under active development. Among other fixes, they are making the necessary changes for Time Machine compatibility. Unfortunately these versions of Netatalk are only available through CVS and have not been Debianized for easy Ubuntu building.
Thanks alot for the guid, it took me ~minutes to get it working and it is working fine on A new macbook and ubuntu intrepid. The speeds are between 8 and 25M/s now on a Gigabit network.
I was searching for some other TimeMachine information and came across your tutorial. I’m not running any Linux servers at home (my home server is an actual XServe running OSX 10.3 Server), but this has got to be one of the most well-written ‘How To’ articles I’ve ever seen on the web, and I’ve seen (and tried to follow) more than I can count, usually with horrific results. What’s so special about yours? A couple of reasons.
1. You include all the “whys.” Why can’t I use the prebuilt package, and why do I have to do ‘netatalk hold,’ for example. So many other people just say “type the following lines,” and when those lines blow up, error out, or fail, the reader is left with no clue what the problem is.
2. You include a lot of “ors.” “I recommend you do this. Or you could do this other thing, if you want blahblahblah.”
I think this section pretty much nails it: “Now we have to tell the afpd daemon what Volumes to share. [Why we are going to do this next step; what is the purpose of this part.] This is defined in the AppleVolumes.default file inside /etc/netatalk/. [Specific details! Making it much easier for me to try to adapt this to a machine running something that keeps its config file somewhere else.] The following line will open this file in the gedit editor with superuser privileges (required for saving) [More why!] where we can define our shared volumes: [More details!]… By adding the following line you will share each users home directory with the user name as the Volume name. [Why!] To make things more secure you can define all users who are allowed to connect to your Ubuntu box via AFP: [And an "or", an optional alternative! Woo hoo!]”
Man, I sure wish more people wrote like you did.
I do want to provide some non-corroborating information for you, btw. You say “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+. ” While that’s true, it implies that if the mountpoint appeared as HFS+, then TImeMachine wouldn’t be making the sparsebundle; it would just use the mount directly.
All my XServe drives are (big surprise) HFS+. Nevertheless, TimeMachine created (or rather, failed to create) a .sparsebundle on the mounted volume. I think it’s going to do that for any network mounted volume, no matter the format. Maybe it’s because my server’s running 10.3, or maybe it’s just standard operating procedure. {shrug}
thanks a lot for this. exactly what i was lookin for and the first linux guide that has actually worked
“coucou78 says:
July 20, 2008 at 00:05
don’t use :
options
but :
option”
Thank you thank you thank you! Removing that s made my drive show up under time machine…. I thought I was SOL there for a bit
Here is a better solution for those that find this method way too challenging.
http://www.l337tech.com/products/l337tech-preconfigured-nas-windows-and-os-x-leopard-compatible/
Another tip – if you find that once an hour is too often for Time Machine backups, you can adjust that in this pref file: /System/Library/Launchdaemons/com.apple.backupd-auto.plist
You can set the interval there to whatever you like, default is 60×60=3600 seconds
36000 is surely often enough for me.
Once again – many thanks for the excellent tutorial.
thanks for an excellent and visually aesthetic tutorial.
on successfully completing my netatalk configurations on ubntu 8.04, i headed over to the mac running 10.5.6, and using the ‘go’ menu, manually connected to the server and accessed the three volumes shared through AppleVolumes.default. Everything works.
I then disconnected, re-edited AppleVolumes.default to add passwords to two volumes of 8 ASCII characters. these two don’t open “the operation cannot be completed because the original item could not be found.” The first time though it had given another error which i forgot to jot down. how do i access password-protected volumes. the one which isn’t password-protected works.
i just disconnected and retried on the mac. the error generated for password-protected volumes is: “The volume could not be mounted.”
I also read through the complete manual of AppleVolumes.default but could not find how to configure this from the mac side.
thanks
regards
niyam
For argument’s sake…
what would happen if I specified a sparsebundle size of 200GB then placed this file on a 160GB hard drive?
would it screw up the backup once the 160GB drive was full?
I ask because I have overestimated the amount of space I needed when partitioning my hard drive, I want to make the time machine volume smaller.
what should i do about a firewall? this media server will be sitting in a cupboard, allowing two macs access and downloading my torrents so i can switch my computer off. i use vnc to see it, it has no monitor. everythings working fine and im scared to try a firewall because as usual linux (read:me most likely) will fuck up and stop working
nice one, worked perfectly on debian lenny.
cheers
What about 9.04? Is it safe to upgrade using the built-in upgrade wizard?
FYI, I’m already doing a backup of my Server using this tutorial:
http://ubuntuforums.org/showthread.php?t=35087
I am pretty sure that an “upgrade” to 9.04 will knock out everything you did on this page.
The L337Tech system is unaffected by updates, just a thought.
AFP is just not meant for Linux at this point. Wait till its naitively supported by Ubuntu. Use SMB or NFS instead for sharing/time machine with an apple computer.
here is an example:
http://www.l337tech.com/products/l337tech-preconfigured-nas-windows-and-os-x-leopard-compatible/
9.04 broke my netatalk install. i even purged the install and redid everything exactly as i did before.
looks like i’m switching to nfs for a while.
Hi Denmaru and ian. I also upgraded to Ubuntu 9.04 (via regular software update), removed Netatalk, redone all the steps to get Netatalk 2.0.4 beta2, deleted the old .AppleDB folders inside my shares (they produced some errors in the system log and broke connecting from the Mac) and everything is working fine here. All the configuration files aren’t touched when updating Ubuntu via software update.
But since we set the netatalk package to hold it isn’t affected when upgrading the system so theoretically there’s no need for redoing everything except maybe deleting the .AppleDB folders inside your shares.
l337tech, this is a guide for users with a linux machine and most of them don’t want to buy another server hardware to have Mac-like network sharing. That’s the whole point of this tutorial. Otherwise everyone is free to just go out, buy a TimeCapsule and have it working out of the box.
neale, the required firewall configuration is discussed in the problems section of the article.
frogstar_robot, many thanks for the infos that Netatalk is back under active development
Thanks for this, especially the part on not being able to create the bundle. I spent about an hour stupidly Googling for a solution before scrolling down and finding it here. My little MacBook is now happily backing up to my Ubuntu box
should add libpam-cracklib to the list of apt-get install debs.
else you get:
Apr 25 12:18:47 scruff afpd[5694]: PAM unable to dlopen(/lib/security/pam_cracklib.so): /lib/security/pam_cracklib.so: cannot open shared object file: No such file or directory
Apr 25 12:18:47 scruff afpd[5694]: PAM adding faulty module: /lib/security/pam_cracklib.so
in auth.log – not sure what it means exactly…but fewer error messages is always good
The upgrade to 9.04 has stymied me. I got this to work for 8.10, then upgraded and made some Mac changes. Now I can’t get the sparsebundle to copy over. I get a name too long error instead. If I try to shorten the name, I get a -1407 error when I try to move the image.
Hi Krema!
Thanks for the fast reply – I’m still running 8.10 since I have no time ATM to fiddle with my NAS.
But what do you mean by “redone all the steps to get Netatalk 2.0.4 beta2″? Did you mean the self-compilation in your tutorial?
Could you also provide us with a simple “find all .AppleDB Folders in the Share and delete them” command? It should be something along the lines of
” find / .AppleDB | rm -f .AppleDB”
(DO NOT enter this command. I have NO clue if it works as I want it to).
Again, thank you for your great tutorial – I’am currently exploring more and more ways to backup the server using cheapo USB-Sticks, or let the whole OS run from one.
Anyone know if it’s possible to mount sparse bundles on a linux machine (so you can see the files stored within them?) Here’s the problem:
I need both onsite (TimeMachine) and offsite backups, for reliability. Right now, I do TimeMachine backups to a server on my local net, and then that server gets backed up offsite. For the offsite part,
I want to switch from my duplicity/Amazon S3-based backup system to SpiderOak. SpiderOak has a really cool feature that avoids storing duplicate files twice, which means I’ll only have to pay once for backing up the system software and common Apps on all my local macs… provided SpiderOak can see the files. But right now, from the linux machine, the backups just look like a bunch of opaque data bands in the sparsebundle. If I could mount the filesystem of a sparsebundle on the linux side, I could back that up instead, and SpiderOak would see the constituent files.
hi i did everything correctly, i think. my ubuntu computer show up on mac and when i open it it asks for my user name and password but it wont except it. i have ubuntu 9.4 and mac osx10.5.6
and ubuntu 9.4 comes with all the avahi stuff installed
I successfully set netatalk and avahi up on a Gentoo box. Can see the shares I created and the Gentoo box is showing as an Xserve server. However, also after setting TMShowUnsupportedNetworkVolumes 1, the shares don’t show up in TM’s backup disk list. Any suggestions?
Well i still think AFP and Linux don’t go well together.
Ubuntu 9.04 comes with with avahi and SMB sharing. To get up and running time machine simply download and install the latest version of SAMBA. Then make a folder called Time Machine and right click on it and turn on “sharing”.
Then go to your apple computer and create sparse bundle as mentioned on this page.
Boom, your done, and immune to updates.
Here is ours:
http://www.l337tech.com/category/products/
We are in the process of making a video on how to get up and running with Time Machine quickly with Ubuntu.
-L337Tech
A really good setup to compliment any sort of file sharing between linux and mac is to setup remote desktop on linux. That way, you can still manage your server without having to plug in a monitor or keyboard. Why waste your time doing that when you can just hit screen share in OSX?
I was able to run all the same commands listed for Jaunty (9.04) with netatalk-2.0.4-beta2 and all my configs from Intrepid (8.10) worked just fine. Despite the SSL changes in the 2.0.4 release, netatalk, alas, still does not work out of the box for Ubuntu.
@denmaru: run all the steps listed here for 9.04 and you should be all set.
Thanks for an amazing tutorial. Wonderfully clear. I ran it on 9.04 and everything worked after I realised I had made the same mistake as Lucazade: /etc/avahi/services/afpd.services
should be
/etc/avahi/services/afpd.service
No ‘s’!
Greetings!
I’m currently working to get a read-only Guest-Account to work (any help with this?) and I’m looking into netatalk 2.0.4-rc1.
In the Changelog (http://sourceforge.net/project/shownotes.php?group_id=8642&release_id=678437), it says
“* FIX: afpd: return the right error in createfile and copyfile if the disk is full.”
Does this mean the dreaded selfdestruction-bug of Timemachine-sparsebundles is gone, and I don’t need to patch netatalk manually anymore?
Thanks,
Denmaru
I am completely confused. I am new to Ubuntu and I can’t get my mac to connect. I have followed all of the instructions as far as I know. I am running OS X10.4.1.1 on a Powerbook and the File Server is Ubuntu 8.10 with the internal drives. I was able to connect through Samba running Ubuntu 9.04 but it had sleeping and waking bugs so started over with 8.10 and now nothing works. On the Mac side I can see the Fileserver and the folder I set to share but i get “the original item can not be found” error. Please help this newbie out.
Thank you
Ray
Ok I am connected to the main hard drive. I don’t know what I did but I am connected. Now how do I connect to a 2nd internal Hard Drive? This will be the drive that I store most of my files. Thank you for this great tutorial and thank you for any help you can give me.
Ray
Kremalicious, thank you so much for putting this guide together! It has been such a huge help. I used your Ubuntu guide and modified it for myself to put together a fully-functioning Mac file server and Time Machine backup on a Fedora box, and it’s been working like a champ for several months.
Today I upgraded the hard drive in my Mac and used the Time Machine backup stored on the Fedora unit to restore my files to my new hard drive across the network. It worked as you described, with only one minor difference. I couldn’t get my share to mount in Terminal using the syntax you provided, so after some digging on the net I tried the following, and it worked perfectly:
mount_afp -i afp://username@servername/Share /Volumes/Share
I was then prompted for my password and when I provided it, the share was mounted immediately.
It seems my server didn’t want to accept the password the other way and I got a lot of error messages (error # 1069).
Anyway, it did finally work and I’m back up and running. Thanks so much for putting this guide together, it’s been a huge help!
very detail guide and i really appreciate all the information provided. awesome work…
Hey all!
Recently I’ve upgraded my box from 8.10 to 9.04 via apt-get. All went fine, my setup with netatalk (2.0.3) was still perfectly working. Then I’ve read about the newer netatalk release 2.0.4 and wanted to try it also … but that was very dumb (never touch a perfectly working system …). Anyway, I’ve triede EVERY solution already suggested here and anywhere else … but without succes! But I think I know what my problem is … Berkeley DB libraries AND headers … this is after that command:
sudo dpkg -i ~/netatalk_2*.debchecking for Berkeley DB headers in /usr/local/include/db4.2... nochecking for Berkeley DB headers in /usr/local/include/db42... no
checking for Berkeley DB headers in /usr/local/include/db4.3... no
checking for Berkeley DB headers in /usr/local/include/db43... no
checking for Berkeley DB headers in /usr/local/include/db4.4... no
checking for Berkeley DB headers in /usr/local/include/db44... no
checking for Berkeley DB headers in /usr/local/include/db4.1... no
checking for Berkeley DB headers in /usr/local/include/db41... no
checking for Berkeley DB headers in /usr/local/include/db4... no
checking for Berkeley DB headers in /usr/local/include/... no
checking for Berkeley DB headers in /usr/include/db4.2... no
checking for Berkeley DB headers in /usr/include/db42... no
checking for Berkeley DB headers in /usr/include/db4.3... no
checking for Berkeley DB headers in /usr/include/db43... no
checking for Berkeley DB headers in /usr/include/db4.4... no
checking for Berkeley DB headers in /usr/include/db44... no
checking for Berkeley DB headers in /usr/include/db4.1... no
checking for Berkeley DB headers in /usr/include/db41... no
checking for Berkeley DB headers in /usr/include/db4... no
checking for Berkeley DB headers in /usr/include/... yes
checking /usr/include//db.h version >= 4.1.0... 4.7.25, yes
checking for Berkeley DB link (-ldb-4.2)... no
checking for Berkeley DB link (-ldb42)... no
checking for Berkeley DB link (-ldb-42)... no
checking for Berkeley DB link (-ldb-4-2)... no
checking for Berkeley DB link (-ldb-4.4)... yes
checking Berkeley DB library version >= 4.1.0... header/library version mismatch (4.7.25/4.4.20), no
Make sure you have the required Berkeley DB libraries AND headers installed.You can download the latest version from http://www.sleepycat.com.
If you have installed BDB in a non standard location use the
--with-bdb=/path/to/bdb configure option and make sure
your linker is configured to check for libraries there.
configure: error: Berkeley DB library required but not found!
make: *** [config.status] Error 1
dpkg-buildpackage: failure: debian/rules build gave error exit status 2
Does anybody know how to solve this? What package is missing? Or is it some kind of wrong ‘symlink’?
Avahi is still working fine, it still publishes my server as a nice Xserve
Thanks in advance for any help!
Found it!!!!!!!
I had to
apt-get remove libdb4.4++ libdb4.4So I only have those Berkeley packages installed:
db4.7-util libdb4.6 libdb4.7 libdb4.7++ libdb4.7++-dev libdb4.7-devSo my system is working again …
Good luck to all others
Fantastic. Very well done tutorial. I ran into issues with the netatalk installation (fail on ‘sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot’) with Ubuntu 9.04 (64-bit)…BUT found very helpful instructions at http://epm-broker.com/cms/node/58 (Beginning to netatalk package installation.) Hope this helps somebody out there surfin’ the tubes…
Stu
Hi all -
I am stuck. Avahi broadcasts the presence of the drive, and after opening 548 I am able to ‘Connect As…’, but that’s the furthest I can get. It gives me the ‘server name / IP’ error. The display on Console.app is below, anything helps (thanks):
5/12/09 1:21:40 AM /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder[91] SharePointBrowser::handleOpenCallBack returned 64
The default package of netatalk on Ubuntu 9.04 seems to work after a minor modification. I had to change “uams_dhx.so” to “uams_dhx2.so” in /etc/netatalk/afpd.conf
Can anyone verify Rob’s claims? Sounds too good to be true.
Can you really just install the 2.0.4~beta2-5ubuntu1 package via the Update-manager in Ubuntu 9.04?
What about the SSL-problem?
I’ve just verified and… it works! As it is explained in the /usr/share/doc/netatalk/README.Debian file, the encryption is now supplied by the gcrypt library, which doesn’t conflict with GPL.
Following this guide just “as is” (recompiling to include OpenSLL support) works even now. But, in Jaunty, it is also possible using the default netatalk package, providing that “uams_dhx.so” is changed to “uams_dhx2.so” in /etc/netatalk/afpd.conf.
I got everything to work properly (after creating the sparse bundle). I just upgraded to 10.5.7 this morning so this tutorial is still good with that update. I am having one oddity: The advertised space in the TimeMachine preferences panel shows only 131GB available. My Ubuntu machine has a RAID1 133GB physical volume and a 232GB physical volume (no raid, single hard drive). I’ve mounted the 232GB physical drive to /TimeMachine and have configured afpd to use that location for the backups. What am I missing to have the 232GB available? Thanks!
Welll, nevermind my problem. I hadn’t fully configured or mounted the additional hard drive. oops. Great instructions, thanks for everything!
Ups – seems like everything between bracets won’t be showed.
Sorry, I had to post it again. Matthias, would you please delete post number 336?
—————————
*) How to enable the Guest-Account on Netatalk
I searched for days on how to enable the guest-account for a netatalk-Server, and I thought I’d share the results with you.
Let’s say you want to bring your Fileserver to a LAN-Party (like I intend to do) – of course, you don’t want to give everyone your password. I’ll show you how to enable a READ-ONLY Guest-Account for a share.
1) Checking for nobody
Open a Terminal and type
gksu gedit /etc/passwdIf you find a User named “nobody” in here, you’re all set.
I can verify that this is the case on a stock-install of Ubuntu 8.10 and 9.04.
2) Edit your Configs
Type in
sudo gedit /etc/netatalk/afpd.confin a Terminal.
At the *very* end of this file, you should have
- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_sshwritten. Now simply add “uams_guest.so” after “uams_dhx.so”. It should look like this:
- -transall -uamlist uams_randnum.so,uams_dhx.so,uams_guest.so -nosavepassword -advertise_sshIf you already upgraded to the 2.0.4 Version supplied by 9.04, it should look like this:
- -transall -uamlist uams_randnum.so,uams_dhx2.so,uams_guest.so -nosavepassword -advertise_sshNow restart Netatalk by typing
sudo /etc/init.d/netatalk restart3) Edit your Shares
Open your AppleVolumes.default:
sudo gedit /etc/netatalk/AppleVolumes.defaultadd “nobody” after your username (allow:your_username>,nobody), as well as “rolist:nobody”. It should look like this:
/path/to/your/share Name_of_share allow:your_username,nobody rolist:nobody cnidscheme:cdb options:usedots4) Setting your permissions
This one was a real PITA.
Anyway, these involves two commands:
4.1)
Type in
sudo chown -R your_ username:your_username /path/to/shareThis changes the owner of all the files in your share to . Normally, this is the way it is, but it doesn’t hurt to do it again.
Keep in mind that there is no / after the last part of the path.
Now, let’s change the rights for these files, too.
Type in
sudo chmod -R -v 2777 /path/to/share
This sets the file-permissions so that anyone can read and write. I had trouble with 2744 (“only the owner of the files can read and write, everyone else only read”).
Fear not – we set “nobody” on the “read only” list in our AppleVolumes.default – your guest can only read.
To be safe, unmount your share
sudo umount /path/to/share
and type these 2 commands again. Then mount it again –
sudo mount /path/to/share
and everything should be fine.
At least, it worked for me – 9.04 with Netatalk 2.0.4 beta2.
Have fun :3
would it really be asking to much for an installer package, so that i dont have to spend the time you spent already? i’m halfway kidding, but seriously: would it be possible to have this entire process put into an installer which would set up the system with a gui?
That would be great, but this is wishful thinking. At best.
But I thought about something bigger – some kind of “L-Serve Distribution”. A Distribution based on Ubuntu Server / Debian which only installs server-stuff (LAMP, netatalk, Samba, VNC).
Now what would differentiate it from Amahi and the likes?
It would have *native* Applications for every platform for remote administration, and not some sloppy webinterface.
Much like MacOS X Server. A simple, clean GTK / Mac program to administer said server.
Well, one can always dream, right?
I can’t seem to get Leopard or Tiger to recognize the system. Where would I be going wrong? I thought I followed everything correctly. I copied and pasted the avahi service file so it wouldn’t be there.
Awesome post. I finally got this thing to work after following your instructions.
However, there is something in this process I would like to know for sure. I can easily add AFP shares from my ubuntu boot volume (formatted as ext3). I also have a USB external drive plugged into the ubuntu box that’s formatted as HFS+, without journaling so ubuntu can write to it. This drive can be mounted on my mac via AFP but then none of the files show up and it gives me the wrong drive size. I wonder if this is a problem with the filesystem being HFS+ or with the USB connection. (the HD is SATA internally and I only have IDE ports on my box so I can’t really know). Any insights will be appreciated.
Never mind its working now. I ended up starting over including a fresh install of Ubuntu and everything is working fine now! Great guide!
I had this working great for a few months.
Now it just stopped. I can’t even mount the ubuntu share via finder.
Console shows the same as #330 Caleb Barr:
sharepoitbrowser::handleopencallack returned 64
Any Ideas?
I rebooted the mac and ubuntu server. Unplugged and plugged my external TM drive thats connected to the Ubuntu Machine. Restarted netalk. Force nettalk reload. Nothing seemed to work. I alsmost gave up and a few hours later I noticed TM on the mac reports that its backed up successfully.
You can see the TM log @ http://27qp0.tk
The log looks normal to me, but maybe it’ll give some insight to someone else with the same issue.
Pedro: Personally, a HFS+ drive with disabled journaling is far inferior than ext3, and I wouldn’t use it. I’m sorry I can’t help you but telling you that you should stick to ext3.
Shai: Never had this kind of problems… Which version of Ubuntu are you running?
Here’s a bit of information I discovered the hard way, hopefully it should help some of you avoid the same pitfall.
Time Machine appears to backup differently to local and network disks. After setting up a successful Time Machine over AFP to a USB 1.5TB RAID on Ubuntu 9.04, I decided to try and speed up the backup of a second machine by connecting it locally for the first backup. Time Machine does a remote backup by creating and updating a sparse bundle (as stated above), but locally it creates an uncompressed Backup.backupdb folder in which to store copies of the backed up machine. This is not so bad.
More importantly, Time Machine will take a HFS+ formatted volume and enable journaling. When I plugged it back in to my linux machine, of course it had trouble. Gparted now showed three partitions on the drive (as opposed to one) and could not read the drive.
Avoid my mistake, let Time Machine backup over the network.
Thanks for this fantastic guide. Maybe someone can help me…
I successfully completed all steps, using Ubuntu 8.04, and the AFP shares show up correctly on Mac.
However, when I try to mount them on Mac, I get “the operation cannot be completed because the original item could not be found.”
I am using a wubi installed version of ubuntu; and the partitions I am trying to access are a mix of NTFS and HFS+ (I think Journaled.) Could this have something to do with the failure to mount? (The NTFS partitions show up as ‘fuseblk’; the HFS as ‘hfsplus’)
Mounting home was working fine before; now it’s giving me the same error.
(I added hfs and hfsplus in the modules loaded at boot up; does this interfere?)
thanks!
update: Restarting avahi restored my ability to mount the shares on the wubi virtual disk — but the others still don’t mount.
Denmaru, Ubuntu 8.04. This seems to be just one of those weird anomalies that have since disappeared. If it happens again I’ll post any new info there is. Thanks
So this guide also works for ubuntu 9.04? Tried this guide for debian but had problems with avahi stopping all the time….
I managed to upgrade to 9.04, but had some difficulties in the process. Hopefully my experience can save you guys some effort in the future.
1) After upgrading, you *must* delete all .AppleDesktop, .AppleDB, and .AppleDouble files/directories. Otherwise, you get a disk unable to mount error.
2) After doing so, you’ll once again be able to mount disks. However, some metadata gets lost. Namely, I experienced this with the “iTunes Library” file I had stored on a network drive. It became a “Unix Executable” which iTunes wasn’t able to recognize.
3) To fix this, I just appended “.itl” to the filename, which forced iTunes to recognize it and load it as a library.
I’ve used these steps – with few distro-specific modifications for Debian – and can successfully use afp over tcp from an OSX Leopard 10.5.7 client to a Debian lenny server. However, even after enabling TMShowUnsupportedTMVolumes, the Time Machine system preference does not show the mounted volume as an available target. Can someone help me figure out why?
Worked perfectly, for me at home,
I have a question? how reliable the whole thing?
can I used it at work too?
Hi!
First off, nice guide! I do how ever have a problem. Everything seems to be working just fine up until i reastart the avahi-daemon. then I get this message:
$ sudo /etc/init.d/avahi-daemon restart
* Restarting Avahi mDNS/DNS-SD Daemon avahi-daemon * avahi-daemon disabled because there is a unicast .local domain
The only thing i can think off (after a few google searches is that my Airport has the name “username.local” is that it? Cuz I can’t change the .local part…
Any Ideas? tnx!
Hello,
First of all thanks for the post. I am currently facing the stated problem of connecting a MaC OS X Leopard with an Ubuntu 8.10 Server. Yet i have the difficulty of several WinXP machines that also need to talk to the Ubuntu server.
Samba worked finely with Tiger but now Leopard cannot follow some links on the server that point to our database, However the home folder is still accessible.
Can somebody give me a hint how to solve the problem as i cannot use both Netatalk and Samba at the same time ?
Hey, I have got everything working without an external hard drive like kurt had wanted. the thing i want to know is can i put multiple username and passwords to access only certian folders on the linux box. Also can i access the file server with windows xp? thanks
Thanks for the guide.
I followed the guide but have a problem at the end.
I am using a Macbook pro with OS X 10.5.7 and Ubuntu 9.04 x64.
I created the sparsebundle according to the instructions and copied it over into the share.
But I still get the “The backup disk image could not be created” error.
When I look at the console output I find this:
[0x0-0x1e01e].com.apple.systempreferences[150] chown: /Volumes/Asterix_TimeMachine-1/.00224127315a: Operation not permitted
com.apple.KernelEventAgent[26] KernelEventAgent: sysctl_queryfs: No such file or directory
I also tried it with a different macbook (also 10.5.7) with a different user/home folder/share on the ubuntu server with the same error.
One more thing. I find it strange that a “-1″ is added after the share name. The share name is actually just “Asterix_TimeMachine”
Has anyone got an idea what could be wrong?
First of all perfect tutorial. Running a Macbook with Leopard and in the basement an old PC with 1TB external hard disk and Ubuntu 8. Time Machine is running wired and wireless flawless. Even iTunes has not problem to find the music on the ubuntu server.
Just recently my hard disk on the Macbook crashed and it was easy to restore everything. I could not mount the Ubuntu server but after installing Leopard, I used the Migration Assistant and everything went smooth. Now everything is running again.
I just realized that I can upgrade Ubuntu.
1) Is it really worth to upgrade?
2) If I would upgrade, where can I find all the files I have to delete as mentioned above (.AppleDesktop, .AppleDB, and .AppleDouble files/directories).
Thanks
Great great great guide!!! Just setup my two mac’s to use my ubuntu raid system as TM backup!
As some commenter’s have also pointed out, it’s hard to make a sparsebundle on your disk since you want to have a bundle size that is slightly bigger than your disk.
So I created the bundle on my disk as described in the guide with the space available. Then I copied the file to the ubuntu server and used the following command from one of my mac’s:
sudo hdiutil resize -size 200g /Volumes/TimeMachine/computername_001b63323456.sparsebundle
Once again, great guide!
/Mirko
Thanks for this simple and straightforward explanation!
For the server to show up in Finder’s sidebar I had to restart finder. This is easily done by hitting cmd+alt/option+esc, selecting Finder and clicking the “Relaunch” button.
@Peer you are getting this -1 since you already created the folder. that is due to the problem when mounting the image and receiving the No Such File or Directory error.
I have no solution for you and i am stuck with the same here.
This worked perfectly well with out Ubuntu 8.10 installation which we upgraded to 9.04. Yesterday we did a complete re-install of Ubuntu. And now Allesandro’s nice .deb package does not work anymore. It gets classified as “defect”.
Does anyone else also have this problem?
Hi fellowweb, it seems 9.04 doesn’t require a recompilation of the netatalk package since it has ssl support included in the default repository package. This was pointed out by some commenters. So you should remove the custom deb package and see if it works with the default netatalk package in 9.04
Hi krema, Thank you very much. I thought I had read the relevant comments. But obviously this perception was wrong. Thank you for answering so quickly!
And above all: Thank you very much for this great HowTo! It’s fabolous!
Nice tutorial. Works great. One thing I wanted to pass along. Using soft links for the share folders worked fine for TM but not so great for writing out to a regular share. The mac looked like it would write out the files but then it would refresh and the files wouldn’t be there. I removed the link and went straight to the files and everything works fine.
Hi Krema,
Sorry for the really late reply (Comment 50 *lol*) but everything is working. The .hosts file did the trick for the icon.
Thanks,
Tim
Oops. By the way, for everyone out there i’ll backup the 9.04 statement. I’m running it all on Ubuntu Server 9.04 with VNC and Fluxbox. All running perfectly communicating to my MacBook Pro. Using Leopard on the MBP.
-Tim
I sporadically get the message “The network backup volume could not be mounted because there was a problem with the network username or password” when time machine tries to backup. When I try again immediately or when I wait for the next scheduled backup, everything works fine.
It there a way to avoid this, or at least to suppress the error message?
I wrote the NetBSD-HowTo some time ago. Now I have to add: Don’t use a backup solution using sparsebundles for critical data! If your sparsebundle image gets corrupted by file system faults it is very hard do recover the data! I can’t use my sparsebundle any more since the last crash! That’s not very bad as my original data is still “alive”, but I don’t want to imagine what would have been if I had to recover data from the crashed sparsebundle! For further information take a look at http://discussions.apple.com/message.jspa?messageID=6028077 (Even raid systems seem to be affected.)
Thats awesome tutorial.Everything is clear and nice. I ran it on 9.04 and everything worked after I realised I had made the same mistake as Lucazade: /etc/avahi/services/afpd.services
should be
/etc/avahi/services/afpd.service
I just did a full restore after a hard drive crash. The network share was mounted in the terminal and then detected. The only problem I had was during the restore I had to try several times for the restore program to find my NEW hard drive (had to go back to the starting screen)!
One of the best if not the best tutorial ever! Great JOB!!!
I’d like to point out that the latest build of 10.6 (aka “WWDC-build”, has no problems whatsoever connecting to my fileserver.
I hereby assume that Snow Leopard won’t be a problem as soon as it retails.
Hy, thanks for that great HowTo!
I got nearly everything to work on my completely self designed Debian Box, whitch acts only as a netatalk/samba server.
normal sharing works perfectly, also sharing one volume with netatalk AND samba (you have to use the samba vfs module “netatalk”).
Now I bought an aditional 500Gb drive, since there are now some 2,5″ models awaylable with 7200rpm. Now I’ve enought disk space for TimeMachine Backups of my 320GB MacBook Pro hdd.
But I’ve got a little problem with timemachine:
It says “unable to create backup image” even after I created the sparsbundle manually. I took the airport mac adress from the preferences, because I could not find the timemachine logs with the console.
Also I was not yet able to read all the comments.
Any suggestes, or had someone already this problem?
Thanks!
I’ve got the solution:
I had taken the mac adress from my airport card. But this was not correct. In the logs an other mac adress appeared, taking that it works fine now!
Has anyone been able to determine if the new version of netatalk still has the self destruct issue?
I’d like to fix it before it becomes a problem.
Error: “mounting of share failed”. When you’re working with an newly installed OS all the old AFP & Leopard files (.AppleDB,.AppleDesktop,.AppleDouble) are still present and configured to the other version of Netatalk. So you need to remove them from the entire shared tree. Than there is no problem anymore.
$sudo find . -name “.AppleD*” -type d -exec rm -rf {} \;
great acticle.
The a2boot service is to allow Apple //e & Apple //gs to boot via localtalk from the network.
i finally got it working – i recommend everyone to check Eric’s link, whereas you get an information how to build your own netatalk package with the additional software matching leopards needs.
thanks a lot!
About the time machine image creation problem: the problem is, hdiutil is trying to run fsync() on the AFP share filesystem after time machine finishes creating the image, and fails. This might be solvable in netatalk server, have to investigate further.
Meanwhile, instead of wondering about the graphical tools, I wrote a small script for our company to prepare the backup disk for time machine use. The script is executed after mounting the share as normal user, I have it installed to user’s backups directory so they can simply double click the script and get time machine ready.
The script is quite simple:
- Set the TMShowUnsupportedNetworkVolumes setting to 1
- Find out hostname and MAC address for sparsebundle name
- Use hdiutil to create a sparsebundle for backups: my defaults are 500GB size, HFS+ filesystem. The bundle is created to user’s home directory on the mac
- After successfully creating the bundle, I move it to the network share
Note that for case sensitive filesystems, you must create the bundle fs with different options: commented in my script already.
The script is available from
http://tuohela.net/paste/timemachine-prepare
Help, please! Your tutorial is awesome, and I think I got it all set up. I can see my server in the sidebar and everything, but when I try to connect, it takes forever (and never does connect). When I try to connect with Command+K I don’t get anywhere either. I suspect that a SMB name or NFS is conflicting somehow, but I don’t know how to disable and/or remove those services.
Any ideas? Thanks!
HEELP!!!! My Mac can connect to my share in the Ubuntu computer, and it lists the files there, but I can’t go inside folders and I cannot copy files from there or to there. Finder will just hang up for ~5 minutes with the spinning beach ball and then it will say that the server disconnected! HEEELP!!!!
Note: on very, very rare occasions, it will work.
I was looking for something exactly like this. The only question I have though, instead of sharing my home directory, how can I share an external harddrive that is plugged in to the computer? That would save me a good deal of money, not having to buy a network drive any longer if I can set it up with an external drive.
Thanks!
Awesome, thanks for the write-up!
Confirmed working on Ubuntu 9.04 including a functioning TimeMachine – upgrade from 8.10.
All I did was re-run the installation process above and then removed all the .AppleDB files from the root share points as noted above…
Thanks
I really love having a ubuntu backup server, but I had one thing that I couldn’t figure out: getting the remote machine to wake up before a backup (I like to put my server to sleep to save power, and keep my office cool). I created a little application & a set of deamons that allow you to put your remote server to sleep. Your mac will automatically wake up your server before a backup. Would anyone be interested in an application like this?
Erik
@Erik Beerepoot: Hi Erik, I would be very much interested! Would you share your achievements?
You can check out the source to this app here:
svn://beerepoot.org/home/erik006/svn/Insomnia
I wrote this app relatively quickly (on the order of 2 weeks), and it’s been working OK for me so far. This application needs works though.
I’ve also uploaded an installer package here:
http://beerepoot.org/public%20files/InsomniaInstaller.pkg
However, I would strongly recommend against installing that if you don’t have any experience with launchd – as any errors would likely have to be fixed manually.
Comments & suggestions very welcome.
email me at ErikBeerepoot (at) gmail
Once again, incredible article!
I hit a few snags, and thought I’d post just in case someone else hits them.
I created the disk image to combat the “The backup disk image could not be created” problem, but I kept getting the same error.
I’m not sure what happened the first 2 times, but on the third attempt it seems to have took. I did discover a couple of things while looking at Console and trying to figure something out:
@Fred Verbeke:
I also saw the “Error 45″ and subsequent entries in Console when I had what I thought was a disk image in the TimeMachine volume.
@Peer & @Yuval:
I also saw the “-1″ appended to my share name (ex. TimeMachine-1). I don’t think it causes a problem though, since it’s just using that as a name for the mount, right? After I got this working, I still see in Console that my Mac is mounting my TimeMachine volume as “TimeMachine-1″ and it’s working fine.
The one thing I noticed on my third attempt at creating the disk image is that when I copied it to the volume, I did get a “Copying…” dialog. I didn’t get that the first 2 times.
Hope this helps someone, and thanks again for the awesome article!
@Eric Beerepoot: Great minds think alike, check out Dustin Kirkland’s powernap tool that will be part of Ubuntu 9.10. I’m sure Dustin will welcome any suggestion you may have.
http://blog.dustinkirkland.com/2009/07/introducing-powernap.html
Hi,
Great guide.
I setup according to the instructions here but I could not see the share in my mac’s finder. I checked and rechecked every file in the configuration on the server side and restarted the daemons several times to no avail. Finally, after some googling I realized that the mac finder can be flaky with regard to showing the bonjour stuff under shared. I knew it was dead because I rebooted a NAS device that I had on my network and it never showed up. I rebooted the mac and voila, there was the avahi share. That kinda bugs me as I hadn’t rebooted the mac since I bought it! Is there a way to fix the mac finder when it gets into this state without a reboot? It’s the first significant problem I’ve run into with my mac. I’m running OS X 10.5.8. Thanks.
Hey. Everything is good except i cant use any other directories.
~/ “$u” works fine and uses my home directory
but if it put
//media/disk/TimeMachine …
it doesnt work. if i put
~/ “$u”
then
//media/disk/TimeMachine …
it goes to my home directory and ignors the rest.
help please
Thanks to your guide, I’ve just build the perfect home file server for my Macs.
Snow Leopard: I was just toying around with the latest build of SL. (the one everyone thinks will be the gm.) Unfortunately, just building a sparsebundle doesn’t work anymore. It’s simply ignored and it still tries to create its own. Mac address in filename is also gone. Anyone got any experience with this yet?? I also noticed the following warnings in the logs:
[...] com.apple.backupd[3905] Warning: Destination /Volumes/Time Machine-1 does not support TM Lock Stealing
[...] com.apple.backupd[3905] Warning: Destination /Volumes/Time Machine-1 does not support Server Reply Cache
I hope we can figure out a new way. Really like backing up to my Debian box.
I got it working on Snow Leopard last night. Turns out that even though SL tries to create a sparsebundle named .sparsebundle you still need to make your own sparsebundle named _.sparsebundle.
It still didn’t work the first time, but at third try it worked perfectly and Time Machine backs up. Even though you use the mac address for you ethernet port, it’s no problem backing up over wifi.
#393 I also got the two errors you get, but it’s apparently no problem for backing up.
Let mer just write that again, forgot about angled brackets doesn’t work:
I got it working on Snow Leopard last night. Turns out that even though SL tries to create a sparsebundle named (computername).sparsebundle you still need to make your own sparsebundle named (computername)_(mac-address).sparsebundle.
It still didn’t work the first time, but at third try it worked perfectly and Time Machine backs up. Even though you use the mac address for you ethernet port, it’s no problem backing up over wifi.
#393 I also got the two errors you get, but it’s apparently no problem for backing up.
I can confirm that Sterrior’s method works. TM tries to create [computername].sparsebundle, but actually still wants [computername]_[en0 MAC].sparsebundle. For some reason, I couldn’t use the old 10.5 sparsebundle anymore. The warnings about missing features aren’t a deal-breaker and as announced, TM is a lot quicker. Initial backup was about 1/3 faster. Sequential updates without many changes are done in a couple seconds. All over wifi.
Hello!
I have problems with my share!
I only see my home directory but when im trying to mount another directory, it fails.
This is my AppleVolumes.default
# By default all users have access to their home directories.
~/ “Home Directory”
/home/klas/TimeMachine TimeMachine allow:username1,username2 cnidscheme:cdb opt$
~/data/Media/ Media allow:username1,username2 cnidscheme:cdb
You tried adding some ” ” to TimeMachine and Media??
Great guide by the way. I’ve had this up and running for a few months now without any problems (thanks to you and all the contributors!).
In the main body of the guide it references a case when the Netatalk backup disk reaches its maximum capacity it self destructs. I haven’t reached the capacity of my external hard drive yet but can anybody let me know whether it self destructs when you reach the limit or does it behave as it should? I’m currently running Ubuntu 9.04.
Thanks in advance!
hey pazk
I had the same problem. So for starters. I thought “username1″ and 2 was a veriable. It’s not. So replace it with your user name and ereasr user 2
# By default all users have access to their home directories.
~/ “Home Directory”
change the line above to
~/ “$u”
/home/klas/TimeMachine TimeMachine allow:username1,username2 cnidscheme:cdb opt$
you don’t need the line above cuz the $u does that for you.
~/data/Media/ Media allow:username1,username2 cnidscheme:cdb
and make sure you change user1 to your actual user and you don’t need user 2.
Gluck
“maclin says:
April 26, 2009 at 01:35
hi i did everything correctly, i think. my ubuntu computer show up on mac and when i open it it asks for my user name and password but it wont except it. i have ubuntu 9.4 and mac osx10.5.6″
i am having the same issue. any suggestions?
Check the contents of the directory: /usr/lib/netatalk/
With the latest version uams_randnum.so and uams_dhx.so seem to have disappeared.
In /etc/netatalk/afpd.conf, I have put:
- -transall -uamlist uams_clrtxt.so,uams_dhx2.so -noguest -nosavepassword -advertise_ssh
and it works!
For some reason i can’t see the other 402 comments already posted on this blog. But I have the server set up and able to connect and transfer files from my mac, I dont need to use it as a time machine so i skipped that part. My problem is hooking up my “My Book” external hard drive to the server, and being able to access that from my mac. I know in section 3 you said it was possible but I just can’t figure out the code. Any help or advice is greatly appreciated
Joubin:
It doesnt work
Any more ideas?
dude, this is awesome, just had to post to say THANKS!!!
To avoid IP address broadcasting add “-nozeroconf” at the end of file /etc/netatalk/afpd.conf
This should end like this:
- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh -nozeroconf
Hi,
Just to say thanks people for updates about Snow Leopard, a few hiccups, but its backing up just great now – although to a new set of backups/sparse bundle.
Thanks, Chris
Hi there
I’ve just setup two different ubuntu servers, one 8.04 and one 9.04 all 32 bit. The instruction has been followed, but I’m getting the “unable to create backup image” error. The strange thing is that I have one mac 10.5.6 and another mac 10.5.8 both having the same problem.
I’ve been looking through all replies regarding the “unable to create backup image” problem, but to no avail.
When I try to do the backup, I’m monitoring the directory where the file from the backup will end. And I do see the sparsebundle file going up to some 200 MB and then deleted by ?
Any help/hint will be received with many thanx
BR
Lars
Taking Sterrior’s excellent advice, I was able to successfully backup using Time Machine on Snow Leopard!
This is an excellent article. To all who have contributed to this tutorial, THANK YOU SO MUCH FOR YOUR WORK!
@Lars, this sounds like you didn’t create the sparsebundle-image yourself and copied it to the tm-backup-directory as suggested in the article.
Sorry, sorry
I got it! And it is working like a charm. It was the sparsebundle-image thing that I did not do right!
Thanx everyone
First, thanks for the awesome how-to!
This worked for about a week before I got Snow Leopard. Now, whenever I try to backup, Time Machine tries to create a new disk image. It seems that the image name no longer includes the hardware address, but just the name of my Macbook. I tried creating a new disk image, but no joy.
I’m not sure where to go from here. I’ve had a Mac for 15 days now. Any ideas?
We had the same issue around 2 weeks ago in mid-Aug. Just read the comments. When I switched, I needed a new sparsebundle. “computername”_”MAC”.sparsebundle. Then copy to network volume and you’re done.
Yeah, I suspect the Volume-1 issue is basically something along these lines:
You mount afp://remote.local/Volume
You tell Time Machine that your TM backup should go on the Volume share.
Time Machine, to be sure that it has your stored credentials, reconnects to afp://remote.local/Volume, but since (the local) /Volumes/Volume mount is already in use, it mounts it as /Volumes/Volume-1. And that sticks for all time. It’s cosmetic, and I’m pretty sure the logs were telling me the same thing on my legitimate Time Machine share via a Leopard client AFP server.
Yup, sure enough. It works now. In case it hasn’t been mentioned yet, make sure to check the sparsebundle’s file name for extra white space after pasting from console. I had an extra space in the file name that was throwing Time Machine off.
Hi everyone,
I’m experiencing an issue with time machine and snow leopard …
I created the sparsebundle like always BigMac_xxxxxxxx.sparsebundle and now when I try to run the timemachine it says that it can’t create the sparsebundle (error 45).
I’m sure that TimeMachine is able to create a file because I see the BigMac.tmp.sparsebundle growing up to 300Mb and then everything fails …
Does anyone have any idea ?
Thanks
PS: it worked like a charm before I update to snow leopard …
just wanted to say thank you – spot on, worked to perfection
Thanks for the article.
I had problems installing the created .deb’s on lenny, as it no longer supports libgnutls13 (it ships with 26)
dpkg: dependency problems prevent configuration of netatalk:
netatalk depends on libgnutls13 (>= 2.0.4-0); however:
Package libgnutls13 is not installed.
The solution was to use the debi command instead of the dpkg command:
cd netatalk-2.0.3
sudo debi
Amazing tutorial, really help me setting up a Ubuntu 9.04 File Server.
Thank you al ^_^
-SI-
Using SL. Had problem with TM creating sparsebundle. Had problem creating my own. Discovered that TM is using the mac address in the sparsebundle file number, BUT, is not selecting the connection interface, but rather some different order. I was using the mac address for my wireless card — my connection is wireless — but TM was looking for a file name with my ethernet mac address. Kind of makes sense if you back away from the problem.
So, my mac is called “Ofi” and the file name TM expects is:
Ofi_.sparsebundle
Oops, that’s:
Ofi_macaddressofen0.sparsebundle
Thanks for this tutorial.
But I have some trouble with snow leopard. I’ve used my debian box since leopard. After upgrading snow leopard, it seemed to back up my air well. but after a day, it was showed “The Backup Volume Could Not Be Mounted” suddenly.
Following is my log.
Sep 6 14:16:00 goodbbai-laptop com.apple.backupd[1002]: Starting standard backup
Sep 6 14:16:00 goodbbai-laptop com.apple.backupd[1002]: Attempting to mount network destination using URL: afp://xxxxx
Sep 6 14:16:25 goodbbai-laptop com.apple.backupd[1002]: NetAuthConnectToServerSync failed with error: 80 for url: afp://xxxxx
Sep 6 14:16:30 goodbbai-laptop com.apple.backupd[1002]: Backup failed with error: 19
Hi,
I have the same problem. The syslog of my debian NAS says:
Sep 6 12:11:32 nslu2 afpd[29681]: dhx login: seym
AM: PAM Success
AM: PAM_Error: Authentication failure
Sep 6 12:11:32 nslu2 afpd[29681]: uams_dhx_pam.c
Sep 6 12:11:35 nslu2 afpd[29681]: uams_dhx_pam.c
after that, the mac console throws:
NetAuthConnectToServerSync failed with error: 80
any ideas?
Thanks you Atkins, that did the trick for me!
You HAVE TO use the en0 mac address instead of the wlan.
People who are getting problems with avahi saying
avahi-daemon disabled because there is a unicast .local domain
goto http://www.dd-wrt.com/phpBB2/viewtopic.php?p=345657
Previously I had my Ubuntu 9.04 box up and running with the help of this article. Everything worked great while running OSX 10.5… I upgraded to Snow Leopard about a week ago, and everything also worked, but I was getting some disconnects while browsing / moving files around on my file server.
Today, the file server shared files can no longer be accessed on my Mac. When I click the server icon in the sidebar, it just sits and sits, while seemingly doing nothing. Nothing on the NAS has changed in the last several weeks.
I can still access all of my files on my windows machine using Samba.
In the daemon.log, I do get a frequent…
“Sep 7 09:37:49 HomeServer avahi-daemon[3206]: Invalid query packet.” “Sep 7 09:37:49 HomeServer last message repeated 2 times”
Does anyone have any ideas…
I just got this working starting fresh with Ubuntu 9.04 (Jaunty Jackalope) and my MB Pro running the latest release version of Snow Leopard (upgraded from Leopard).
I tried following the tutorial instructions exactly, including rebuilding Netatalk. Everything worked perfectly except for one hitch, already mentioned by Sterrior above in what is now post 395: even though the Console shows the sparsebundle file name WITHOUT the MAC address, you still have to include the MAC address in the sparsebundle file name for it to work. If you don’t have the file name right, TM will fail with a disk image creation error. Also, I initially made the mistake of getting the MAC address from the wrong place – I mistakenly used the address of my wireless adapter. The file name must use the main Ethernet adapter’s address. Another post suggested one way to find this: Run the Network Utility app, and under the Info tab, make sure the Ethernet “en0″ is selected. The MAC address is listed here as the “Hardware Address”. Use this number (without the colons) in the sparsebundle file name as Sterrior suggested: (computername_macaddress.sparsebundle)
thanks to everyone, I am now happily backing up using TM over my wireless network and backups are now hassle-free!
hi//
I finally sovle the problem I mentioned.
First, I removed netatalk package and rebuilded to install.
After installing, I changed timemachine preferences.
Previously, I connect to my debian box by domain, but now by avahi.
Now it’s working perfectly.
i have the same problem as SteveG – I can cmd-K to access the new server but cant see the linux box in my side bar. Ive tried and retried the avahi section, but no joy, any suggestions?
Also the linux box is connected to an external hdd with 3 partitions one of which is for TM back-ups. I am given the option to mount the various servers when I cmd-K but when I select the partition I used for TM back-ups, I get an error saying “unable to mount the selected Volume”
1) netatalk must be compiled, do not use .debs
1a) netatalk must be compiled, do not use .debs
1b) netatalk must be compiled due to Free Software License In[s]anity
1c) netatalk must be compiled; people have listed bug reports with everyone, but due to poor social engineering, nothing will happen, due to Free Software License In[s]anity.
2) If you upgraded debian to do this, check that /dev/pts exists, and is mounted. Neither guest not user could login during this. I was getting persistant -5014 afpMiscErr AFP Misc error (see: http://users.phg-online.de/tk/afp_related_errors.html )
3) uams_dhx2.so -> uams_dhx2_passwd.so isn’t working for me right now, with an error “server_child[1] 31497 killed by signal 6″ Work around, use uams_dhx.so to login.
4) Pro-tips for /etc/netatalk/afpd.conf: to reduce error messages if you’re logging, -noddp -noslp The first removes AppleTalk support from the connection (obviously if you’re running oldmacs, you may want this). The second removes service registration with Service Location Protocol, a protocol superceeded by avahi which we’re using.
5) Current issues: avahi not displaying to OS X, the same server is running under a different name and same IP for a sickly samba installation, and only that service is showing.
^
5) Solution to avahi not displaying
5a) check /etc/hosts defines your box’s external address correctly if you’re on a self-defined network
5b) check /etc/avahi/hosts defines your box’s address correctly
5c) in my case neither wanted .local addresses, just machine names
5d) fix, reboot avahi with: /etc/init.d/avahi-daemon restart
5e) displays correctly in sidebar.
I just switched to Snow Leopard, and I also got the “The backup disk image could not be created” error.
Apparently, my existing Leopard sparse bundle image was named “blabla.sparsebundle .sparsebundle” (note the space) instead of “blabla.sparsebundle”. After renaming, the error did not appear again. I don’t know how the sparsebundle got renamed, though.
Hi there,
I’m a fairly new user to Ubuntu, I have 8.04 64 bit installed. In the house I have two Macs, one running OSX Tiger, which is connecting just fine to Ubuntu, thanks to this site, but the other has Leopard, and refuses to connect. Whenever I enter the username and password, it tells me that they’re invalid, it tells me so quickly that I don’t actually think it’s checking the network at all. Given that the usernames and passwords work just fine from the mac running Tiger, I am lost at sea.
Any ideas? Thanks
Hello,
I am having the same problem as John from post #426. My server was working great for months then this morning, for no reason, I can not connect to my server from my multiple Macs. The server icon shows up, but when I click on the icon, it hangs. So frustrating. Can anyone help?
@LePhil 423
Leopard demands a ssl connection. Tiger is fine to transmit passwords in cleartext. You need to change your /etc/netatalk/afpd.conf to include the authentication method uams_dhx.so
Check your install against Step 2 in the original post, especially /etc/netatalk/afpd.conf . Check that the libraries are installed and linked correctly from Step 1 above (did you just install netatalk from a debian package, or did you compile it)?
Hello,
I have had this working fine for the past year with Leopard, but can’t seem to get it to work with Snow Leopard 10.6.1 – using the Sparsebundle I created, It connects to the disk, says it’s “Making backup disk available…” then it says “Calculating changes…” then “Indexing backup” it does this all very quickly, too quickly to actually transfer any useful amount of data, and then finishes, with no error, but no backup either? any ideas?
ps. Best tutorial I’ve ever come across both aesthetically and practically. Thank you
Same problem here: Disk image can’t be mounted with Snow Leopard anymore. backupd simply crashes. Same does Disk Utility when I try to mount via network. Now trying when the disk is attached to my MacBook via USB…
Krema- Great tutorial! I’m having the same issue as a few other people of things just being done working. Would you be interested in starting a project for this to keep it updated and working? Also possibly a script setup? Let me know.
dbd).This proved key in my situation. I’m running 10.5.8 and netatalk just quit working before. I enabled this option and things worked better than before.
I wanted to thank you for the effort you made putting this up. It helped me get afp running on my box although I don’t run ubuntu.
Because of that I also needed to add afpd to my /etc/hosts.allow file to access it, which apparently may not be needed in ubuntu.
In addition I wanted to change the name of the server that Avahi broadcasts to something other than the hostname. I went through all the conf files repeatedly until I found it. For those interested it is in
/etc/avahi/services/afpd.service
name replace-wildcards=”yes” Arch Linux /name”
I have a problem copying files from my osx to the ubuntu share. I have set up everything as described above, the installation went fine, and on osx i have a link in the sidebar to the share, i can log on with my user name and password, i can browse folders and copy individual files, but when i try to copy a folder including content i get the error (translated from danish) “the action could not be completed, because there already exists an item with the name “name of folder”". Then it seems that the folder “name of folder” has been created but nothing is being copied.
I have checked that I have the correct permissions to the share folder and beyond.
Any ideas to what I’m doing wrong?
Typically, after looking for the solution for 2 days, you find the solution 10 minutes after posting for help – the problem was some hidden .AppleDouble files, after sending them to the recyclebin I had no problem copying files!
[Snow Leopard Update]
I just updated to Snow Leopard and had created myself a new sparsebundle image when I noticed that the sparsebundle on my Ubuntu machine and strangely became named:
[MachineName]_[MACAddress].sparsebundle .sparsebundle
So I said, “What the hell?” and renamed it discarding the extra ” .sparsebundle” at the end. I immediately started a TM backup and it seems to be working. Console says it requires a “deep travesal” which is reasonable to expect. Will update on any changes.
When i connect to this network it comes up called”Home Directory” anyway i can change this?
Thanks
Can anybody help me with netatalk on my nslu2?
since the last Kernel update i have no acces with afp.
The problem is uams_randnum.so no longer exist/work??
I read above to change on ubuntu to uams_dhx2.so…
this module dosen’t exist for my nslu2 (sarge).
Thanks
to #444 check the file AppleVolumes.default
the last line contains a tilde which is obviously the path to your home directory and after which you can add a name
~ “Tom’s stuff” allow:Tom
/media/disk “more stuff”
Hello,
thanks for your guide! Its just awesome
The setup worked for me on snow leopard, except that I needed to create the computername_mac.sparsebundle file by myself.
My question is, what’s going on with TimeMachine? My mac has a 120GB disk with less then 50Gb in use. The current backup announces to copy 269 GB of data?
Any suggestions?
I have just noticed a new version of netatalk (2.0.5rc1) is available on the netatalk sourceforge site. In the release notes for that release it mentions something about time machine support. Does anyone have any more info about this?
My sparsebundle isn’t showing up in Time Machine prefs.
AFP is working great. I have one server with 3 sharepoints on the linux box (home, data, archive) In archive I have my sparsebundle image named correctly. Elsewhere I read it my help to place dot [MACaddress] and com.apple.timemachine.supported to help get the disk recognized. Nothing has helped.
I would also like to set the archive share as a second server in afpd.conf but this isn’t working either! Any tips there?
Hey, somehow i fail at this.
Got snow leopard 10.6.1 installed and i can not use my network disk for time machine.
Probably did something wrong and just don’t see it, so thats what i do:
ifconfig en0: ether 00:11:22:33:44:55
mounted the afp volume i want to use for time machine.
created HOST_001122334455.sparsebundle on my desktop and copied it to the selected volume.
did NOT mount the sparsebundle.
it goes for some time saying: “making the backup disk available” and then exits with an error 45.
while running there is a HOST.tmp.sparsebundle file. it does not seem to use the HOST_MAC.sparsebundle at all. but i only got one networking interface, so this really should be the right mac adress…
i tried this for about 10 times now, created different sparsebundle files, no luck.
any ideas would be greatly appreciated!
I just finished this beastly tutorial. I gotta say hats off to the writer of this article, because I really havnt found a website that gives instruction as clear as this one, especially when dealing with terminal. This is the first time ive done any building of packages, id say this article has pretty much converted me to a “non windows computer user.” no reason to go back.
one question regarding the netatalk back up drive. i read that once the netatalk drive is full the time machine back up is useless due to some handling issues. In this statement Im not clear if by back up drive you are refering to is the actual physical partition on the drive or the sparse drive image i put on there, I remember reading a daemon from netatalk will handle it, but i may be mistaken. The reason is because my BacupHDD on the ubunServer is well large enough to accommodate my MBP’s hd but the image file isnt, being that i had to created it on the MBP’s desktop then drag and drop as the tutorial says. So Does it only matter if the HD is full or is it the image size i need to worry about. thanks for all of your research and time.
ok found a solution for snow leopard 10.6.1
there has to be a file inside the sparsebundle now…
check this:
http://www.macosxhints.com/article.php?story=20090905212640957
First of all… thank you! Your guide and the comments it has generated helped me to create a “TimeCapsule” on my Ubuntu Server. I do have a couple of questions for anyone who is willing to answer.
running:
Ubuntu Server 9.04 with Netatalk v2.0.4~beta2-5ubuntu1
Mac OS X 10.6.1
questions:
I created the TM share and advertised this with Avahi. I created a 200GB sparsebundle and am using this for Time Machine.
q1: The size of the sparesebundle is smaller than the partition on which it resides. I saw a comment mentioning that it should be larger… why?
q2: Can anyone explain what will happen when my sparsebundle is filled? Will it continue to work, stop backing up but still be available, or become corrupted? This seems to be due to the “78 and 78″ problem with Netatalk and Apple’s undocumented extensions to AFP.
q3: Will “78 and 78″ be integrated into a newer version of Netatalk? If so, which version? Is this available in Ubuntu’s repositories?
cheers,
S.
Great tutorial! I am new to linux and i was going crazy trying to figure a way to access my files on my pc from my mac. I dont know if you covered this already, but i have a separate drive which is mounted on my desktop. how do i “share” that drive along with the home folder that is shared by default. Thanks.
Can this linux server setup work as a mail and calendar server for mac aswell?
Can this software integrate calendars and be used as a mac mail server.
Followed this awesome tutorial, but still having problems.
Namely I cannot mount the share (which shows up on my mac automagically) complaining about the username being wrong.
I was trying to punch in my Linux credentials. Is there anything else I need to do?
Fixed. I was too lazy and did not compile it.
Unfortunately Time Machine still chokes with an error 45.
I even formatted the disk as HFS+.
Guess this is the end of the line as far as tests go.
Next stop: get a real Time Capsule
clusty did you read the section on creating the sparsebundle manually? it works perfectly on leopard.
got it running on snow leopard with help of the link in #452.
I’ve a problem with avahi. I can connect via cmd+K to my ubuntu machine and everythings works well. But after installing avahi it doesn’t turn up automatically in the finder, nor on my desktop. I rechecked the config files twice and restarted both boxes. On the ubuntu machine, ports 548 and 5353 are open. Do I need to open a port on my macbook? Any ideas?
clusty did you read the section on creating the sparsebundle manually? it works perfectly on leopard.
got it running on snow leopard with help of the link in #452.
——–
I am getting some strange error. Backup not ready or something like that.
Besides that, AFP is painfully slow. I cannot even stream a movie from my server on my mac over wireless. SMB works just fine.
Clues?
First off, excellent guide, I used it to do my gentoo setup.
One thing that should be added, if you make the sparsebundle image, name it correctly, and still it will not work no matter what you do try creating the com.apple.TimeMachine.MachineID.plist file inside the sparsebundle. I do NOT mean mount it and create the file, but rather in the .sparsebundle/ directory (I did it on the server, but it shouldn’t matter which comp it is on). If you want to use terminal, cd into the directory that contains the sparsebundle image then use your favorite command line text editor to create and edit the file. It might also work to use a graphical text editor on linux, as long as it sees the .sparsebundle/ as a directory you should be fine.
Inside that text file add:
com.apple.backupd.BackupMachineAddress
00:00:00:00:00:00
com.apple.backupd.HostUUID
00000000-0000-0000-0000-000000000000
And replace the first string with your MAC address (including the colons) and the second string with your hardware UUID. Your hardware UUID can be found in “About This Mac” > “More Info…” > choose “Hardware” on the left side > at the bottom next to “Hardware UUID:”
One thing I would like to mention is I never had to do this until I switched to Snow Leopard and made a new time machine image. I am not sure if it is a random failure or something with 10.6, but It fixed the problem for me so I hope it helps someone.
Sorry, looks like the site stripped the xml tags. Here’s a shot with a code tag first, if it dose not work the structure can be found in the base of any other .sparsebundle used for time machine.
com.apple.backupd.BackupMachineAddress
00:00:00:00:00:00
com.apple.backupd.HostUUID
00000000-0000-0000-0000-000000000000
A question –
I have had this wonderful system (thank you for this!) working on my Ubuntu 8.10 server for more than 6 months, and during that time I have had one continuous problem…
I don’t use the server for a TM backup, only a media server for 4 macs, using a mix of Leopard & Snow Leopard.
I have 2 SCSI drives (10 GB each) on the Ubuntu box (an ancient Dell server) configured in RAID 1 for the system, and an ATA drive (500 GB) for my media, with the system configured as suggested above using AFP.
The problem is that from any mac even when I go to a directory on the media drive, the free space is reported as that remaining on the OS RAID array (about 3 GB presently), so I can’t copy files more than 3 GB to the directory. However, as I add more files the free space on the media drive gets less and the 3 GB free reported for the OS doesn’t change. I can live with this – just!
This all changed recently. There is now only about 30 GB free on the media drive, and as I add more files the free space is counting down, but not by the correct amount! For example, I added a 1GB file, and instead of 2.90 GB free I now have 2.80 GB free!
What is happening?
As I said the server is Ubuntu 8.10 server edition with no GUI, I use Webmin to manage it from a Mac. The server is in another building nearby, and not easy to access. It is on 24/7 as it also serves web pages for several sites, and only gets restarted when needed. I can see which drives are actually receiving the data and getting full using Webmin.
Thanks
Siddie.
hello
I have a mbpro 4,1 ( Leopard) and a PC with Ubuntu (latest)…
I followed instructions step by step and got stuck at the disk image name (“Backup computername”).
To fix(network utility trick didn’t work for me), i copied the tmp disk image name that time machine creates to launch a back up and paste it to create a new disk image.
Works like a charm
Th
hello all
Nice article.
I have a mac (Leopard) and a PC with Ubuntu (latest)…
I followed instructions step by step ,and got stuck at the disk image name (“Backup computername”) on the mac side.
To fix (network utility trick didn’t work for me) , i copied the tmp disk image name that time machine creates to launch a back up and paste it to create a new disk image with Disk Uility.
Works like a charm now if when image is big enough.
Thank you for the tutorial.
P.S. If i create a folder ( /home/user/netatalk ) to gather installed, will it still work ?
I’ve followed this great guide to the end, however I’m having one problem.
I’m getting error 45: The backup disk image “/Volumes/TimeMachine-1/iMac.sparsebunde” could not be created. When trying to perform the backup for the first time. I followed the steps above to create my own sparsebundle file and named it iMac.sparsebundle, which appears to be correct as Console said: Creating disk image /Volumes/TimeMachine-1/iMac.sparsebundle. So once I put my custom sparsebundle file on the server I tried to do another backup and it did this: Creating disk image /Volumes/TimeMachine-1/iMac 1.sparsebundle. So it’s ignoring the sparsebundle I created myself! What the hell.. Anyone have any ideas?
Cheers
Blogged about this tutor in May:
http://www.idzerda.com/itek/archives/564
Very well done and maintained! I just had to re-install a server. I just took your guide and away I am! Thanks.
Hi Nick and others with the Error 45 Problem.
10.6 aka Snow Leopard uses a different method to recognize the correct image to your mac. Before 10.6 the mac-address in the image-name was used. Now it is in a hidden property in the sparsebundle containing the hardware-uuid.
Use the hint at http://www.macosxhints.com/article.php?story=20090905212640957 to create your image, then it will work under 10.6 as well.
Maybe Matthias want to add this to this great article as well..
cheers
Thx for this tip. This got my manual sparsebundle working on leopard after getting the ‘error 45′
Thanks for the instructions, they’ve been very helpful. However, I ran into some problems when I upgraded to Jaunty Jackelope. It is no longer necessary to do a custom compile of netatalk to provide encrypted authentication to modern versions of OS X, but there are some upgrade issues. I’ve documented the fixes on my blog in the post linked from my name on this comment.
Cheers!
Hello,
I followed this great tutorial step by step and to 90% everything works fine. I can see my ubuntu box in my finder on my macbook pro (SL) and also can access the shares I created on the ubuntu box without problems.
Just when I want to run Time Machine against the sparsebundle that can be found in one of the shares, I get an error message saying, that the backup volume is not available. So far so good.
When I login my ubuntu box with NX free and restart netatalk, everything works fine even TM. But the crazy thing is, when connect to the ubuntu machine with simple ssh and restart the netatalk, that doesn´t help. Crazy!
So my situation at the moment is, I wake up my ubuntu box with wake-on-lan functionality and then I have to connect with NX free, restart netatalk and everything works fine.
I would prefer to have everything in place without login in first.
I tried to restart netatalk autmatically with rc.local, but that didnt help.
Any other idea? Who could give me a hint? What is the difference in starting netatalk via ssh connection and doing it “local” in the GUI? I always thought, that the result should be the same?
Any help would be appreciated.
Jürgen
I would like to thank Matthias Kretschmann and everybody who has left their comments. I now have my iTunes and iPhoto libraries and their related XML files sitting out on my Ubuntu box. It totally rocks. I’m not using my Linux box as a TimeMachine yet, but time will come for that. Thank you everyone!
Michael, thank you for pointing out the article in mac osx hints (post 469). That did the trick to get it working in 10.6 again. I would advise anyone who it trying to get this working to use the script. Doing it the manual way is not worth the trouble. Also thanks to Matthias Kretschmann. These instructions work well for Karmic and OS X 10.6.
The guide is great. BUT…I really need help in getting Netatalk 2.0.5RC3 installed on my ubuntu box since this version includes support for the AFP command 78. I want to use my server as a timemachine backup but i am not willing to take any chances it won’t restore (lot of noise on the net around timemachine backups broken when the backup-disk gets full – apparently due to the missing command 78).
The latest source package in the repos is 2.0.4 which does not contain the “new” command. I would gladly compile the netatalk package myself if i just could understand what options i need to use when i run configure and make.
I’ve tried this guide http://netatalk.sourceforge.net/wiki/index.php/DebianUpgradeto2 but get several compliation errors. Anyone on this thread/blog that has done it ?? I run ubuntu 9.1 with vanilla kernel 2.6.32
Really nice tutorial!
The only problem I had was the thing with Berkeley db which Davy posted on May 9, 2009 at 10:46. This own solution worked for me as well
Great!
“The other issue I encountered is a -5014 error when attempting to connect to an AFP share. Turns out there are hidden .AppleDB folders in the root of any directory you share as an AFP volume which may need to be removed when upgrading netatalk. Simply remove or rename (i.e. mv .AppleDB .AppleDB.old) these directories and restart netatalk with /etc/init.d/netatalk restart to fix the -5014 error.”
Hey, so it might be obvious to everyone but me, but I really struggled with this problem until I found out two things. First off, you’ll want to stop the Netatalk deamons prior to deleting those .AppleDB files. /etc/init.d/netatalk stop
Secondly, I forgot that there was an .AppleDB in the Home folder for the users, which I had been sharing but no one was really using much. I kept deleting the .AppleDB files from the shared server drives and still getting the error, because there was still an .AppleDB file in the user’s Home folder.
Thanks for a very helpful post!
First of all, thank you so much for this clear and concise guide, a complete life saver for a complete linux newby.
Now for the crux. I’m confused by the noise about Netatalk’s latest versions supporting or not FPSyncDir and releases:
https://bugzilla.redhat.com/show_bug.cgi?id=453073
http://marc.info/?l=netatalk-devel&m=121084448214854&w=2
http://sourceforge.net/projects/netatalk/files/
Does it support it or not? How can I know if my TimeMachine sparse image will crash once it fills up?
How can I ‘unhold’ my custom build of netatalk? I hear that the default package will work and i’d like to use that if possible.
@Rodrigo Alvarez: The AFP command #78 FPSyncDir is implemented in the 2.0.5 Release candidate for netatalk. Currently version RC3 is on the web (sourceforge) if you haven’t got that version compiled on your OS you will not have support for command 78. What you need to do is compile the netatalk source on your platform. I tried but did not understand all dependencies and switches for ./configure so i did not succeed. Therefore my last post. Debian packages has not yet included the 2.0.5 source in the repos so you need to download the tarball from sourceforge and compile it manually (i.e. ./configure, make, make install)
Any advice on setting up users and groups for accessing shares with AFP? How does it handle passwords? Does it use Linux users or are we wetting up users and passwords in a files to be read?
As beetlezap, I’m trying to build netatalk-2.0.5rc3, but get errors.
Any help would be really appreciated !
All,
I wanted to share a problem I ran into and how I fixed it. It’s been driving me crazy for days. I upgraded from Ubuntiu 9.04 to 9.10 and boom, my time machine sharepoint would no longer work. It broadcast via Avahi just fine, but when I tried to mount it, I got an error
“original item for cannot be found.”
Turns out that Karmic uses a newer version of netatalk and it is incompatible with the hidden .AppleDB folder on the mounted folder on the Ubuntu box. Just sudo rm -rv .AppleDB to delete this folder in your timemachine folder, restart netatalk and away you go.
hope this helps someone else.
PS I love this tutorial. It is awesome.
This was very useful for me. Works like a charm. Thanks for sharing your knowledge.
I am able to mount my home drive, but not my backup drive. I keep getting the same message… ‘A volume failed to mount’ ‘The volume “TimeMachine” could not be mounted’
My backup drive is /media/TimeMachine
I think my problem may be in the AppleVolumes.default file…
#~/ “Home Directory”
~/ “$u” allow: users cnidscheme:cdb
/media/TimeMachine TimeMachine allow:users cnidscheme:cdb options: usedots,upriv
Any ideas?
Thanks!
Ryan,
See my note above about the .AppleDB folder. When trying to mount via go->connect to server, I was getting the “a volume failed to mount” error. I got the “original item blah cannot be found” error. I, like you, could see my home folder, but not my timemachine folder.
I have something interesting to report. First I should explain. Using the guide on this page I have my macbook backing up to a time machine disk on my Ubuntu 9.10 box.
What’s interesting is that I just filled my time machine disk… and nothing happened… what I mean is… no self destruct. I got the notification from time machine that the backup disk was full. Actually, technically I filled up the sparsebundle file which was set at 160GB, there is still room on the disk.
I should note that I recently upgraded to the new version of netatalk since it apparently works out of the box now and there is no need to compile it yourself anymore. I installed the new version and renamed the .AppleDB folders to .AppleDB.old
John,
you didn’t get an error when you filled the sparsebundle, because timemachine just starts erasing your old weekly backups when you run out of space.
So what’s the big deal about the “self destruct” problem? Just make the sparsebundle file smaller than the backup disc…. problem solved.
For those trying to build 2.0.5rc3: I did some digging in the Debian package git repository and found instructions for updating the netatalk version the package is built on. I haven’t tested the package yet (I’m working through this tutorial on my new Karmic install), but at least it builds.
Here’s what I did: follow the instructions, but stop before the line that starts “sudo DEB_BUILD_OPTIONS”. You should have just typed “cd netatalk-2*”. Then type:
cd ..
1) dch -v 2.0.5rc3-1 “Dummy changelog entry”
(note 1: you’ll be told your current directory’s name has changed)
(note 2: in the future you can replace 2.0.5rc3 with whatever the most recent version on the netatalk sourceforge site is)
2) cd ..
3) cd netatalk-2*
(note 3: steps 2 and 3 are to correct for the changed directory name)
4) sed -i -e ‘s/^\(DEB_UPSTREAM_TARBALL_MD5\b\)/#\1/’ debian/rules
5) debian/rules get-orig-source
6) DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot
7) Wait a long time…
You should now have a netatalk-2.0.5rc3-1_i386.deb (or possibly netatalk-2.0.5rc3-1_x86_64.deb). Continue the instructions on this page starting with “sudo dpkg -i ~/netatalk_2*.deb”.
After a minor system update, my afp services were gone and Time Machine started complaining, so I visited this place again.
I’m happy to confirm too that it all seems to work out of the box on my Ubuntu 9.04 install, without additional compiling of netatalk sources!
Here’s the steps I took (99% sure) to get rid of my custom-built netatalk (and my config files too, btw, so maybe you want to back those up):
# sudo aptitude unhold netatalk
# sudo aptitude purge netatalk
# sudo aptitude install netatalk
I don’t know if this is the best way, but it seems without compromise (something I like). Then, I had to follow this fine tutorial again editing /etc/default/netatalk, /etc/netatalk/afpd.conf (use uams_dhx2.so!) and /etc/netatalk/AppleVolumes.default.
Then, I stopped netatalk:
# sudo /etc/init.d/netatalk stop
… and then removed the .AppleDB, .AppleDouble and .AppleDesktop files using this DANGEROUS COMMAND:
# sudo find . -name .Apple* -exec rm -rv {} \;
Please make sure you know what you are doing; I always check first with something like:
# sudo find . -name .Apple* -exec ls -ld {} \;
Finally, I started netatalk again:
# sudo /etc/init.d/netatalk start
I tested, then rebooted my mac and ubuntu machines anyway and tested again. Everything seemed to work quite smoothly indeed.
Next up is upgrading to 9.10, but I’ll leave things like this for a while…
deleting the hidden .AppleDB folder on 9.10 worked!!!
thanx cainscou (entry #482)!!
Hi, i currenty have a folder in my Harddrive called “tom” what i share with my mac, i have just installed a 500 GB 2nd HDD, how do i config it so that i can mount this from my mac too?
Tom,
Your /etc/netatalk/AppleVolumes.default file probably has a line at the very bottom that looks something like this?
/tom tomsfolder allow:tom cnidscheme:cdb options:usedots
just edit that file and copy the last the line, paste it in at the bottom and change the first part of the line like so:
/foo new_500_GB_HDD allow:tom cnidscheme:cdb options:usedots
where “foo” is the mount point for the new drive on your linux box.
then type
sudo /etc/init.d/netatalk restart
and a sharepoint called “new_500_GB_HDD” should show up on your mac. good luck.
I just had a look, the last line in AppleVolumes.default is
# By default all users have access to their home directories.
~/ “File Server”
But i have a file Applevolumes.default what only contains the lines
-/ “$u” allow:tom cnidscheme:cdb
/home/tom/Timemachine Timemachine allow:tom cnidscheme:cbd options:usedots,upriv
however that isnt the folder what i can currently mount, any idea where i have gone wrong lol?
Please disregard my previous comment (#489). The procedure doesn’t create an appropriately up-to-date package.
Thanks Michael (#469)
I had Error 45 on Snow Leopard and your solution fixed it for me.
Thanks!
For snow leopard and error 45 see http://www.markdeepwell.com/2009/11/using-ubuntu-for-time-machine-in-snow-leopard/
Hi all,
Looks like netatalk 2.0.5 is now officially released, and the release notes says it is Time Machine compatible.
Does anyone know what this means? Is it that we won’t have the “disk full” issue? Is it that we won’t need the “show unsupported TM volumes” option any more?
Looks like we need to enable “options:tm” in the config file… but there’s not much documentation with it.
Thanks !
Hi all,
first of all thx for this great howto!
Two things, first here is a one line command you can use to create a correctly named 50GB sparsebundle for use with Time Machine:
hdiutil create -library SPUD -megabytes 1 -fs HFS+J -type SPARSEBUNDLE -volname "$(hostname -s)_$(ifconfig en0 ether |grep ether | cut -c 8- |sed -e 's/[:| |\t]//g').sparsebundle" "$(hostname -s)_$(ifconfig en0 ether |grep ether | cut -c 8- |sed -e 's/[:| |\t]//g').sparsebundle"The other thing, i published a german adaptaion of this HowTo, focusing on using netatalk for Time Machine backups without the need to use the unsupported device trick.
I’ve been running my AFP server as per this how-to for a couple of weeks and it works like a charm except when it crashes, and when it crashes it is one massive crash.
I may just have found the counter intuitive solution, but I’m posting this here preemptively in case someone else out there has been experiencing this and can benefit or help.
Time Machine backups run quick and clean most of the times but occasionally the backup chokes and completely paralyzes my Mac. The finder and all other applications become unresponsive, force quit does not work and I can’t even type into a previously opened terminal. The cursor/mouse does work and I can switch between windows but the windows are not updated (ie no news on the console or on ‘top’). I’ve left the Mac in this state for hours (about
hoping it would miraculously recover from a long backup but it does not. The only way out is a hard power down of the Mac. I’m up to about 10 power downs in the last week and becoming paranoid of HD corruption.
I’m running Netatalk 2.0.4 from Ubuntu 9.0.4 on a Powerbook G4 and connecting with a MacBook Pro running 10.5.8.
On the Mac side, the last entries on the log before the system hangs are always like:
Nov 8 15:29:26 compname /System/Library/CoreServices/backupd[1755]: Backing up to: /Volumes/My Time Machine Backup/Backups.backupdb
Nov 8 21:48:18 localhost kernel[0]: npvhash=4095
Nov 8 21:48:14 localhost com.apple.launchctl.System[2]: fsck_hfs: Volume is journaled. No checking performed.
On the ubuntu side the logs are clean except from APFD complaining about “Bad function 4F” and “Bad function 4C”, but these complaints are also present when Time Machine backups do succeed.
I’ve reinstalled netatalk as per the instructions and I’ve also changed energy saver preferences on Mac to not spin down drives and not enable screen saver as per some posts online, but my problem persists.
I was first suspect of Time Machine as it seemed like the last log entry but then I googled for ‘npvhash=4095′ and found an Apple discussion thread that exhibited the same symptoms and was related to fonts and good old Microsoft Office (I very recently ran some security critical Microsoft Office upgrade). I followed to post and used my “Font Book.app” to eliminate all font conflicts and I’m crossing my fingers that this fixed the problem.
I will post again if the problem persists.
I’m new to Linux and I love how everyday I have less reasons to use Microsoft Products.
Is there any way to change the name of the disk as its mounted on the Snow Leopard Desktop? I have annoying external drive called “koufax_001d4fff9794.sparsebundle”.
If I rename this on the desktop, will it mess up Time Machine?
Thanks for the great information!
Just set this up on my wife’s PowerMac G4 with the TimeMachine volume on my Ubuntu machine. It all works great!
A couple of notes though:
1) I definitely needed to create the sparsebundle by hand.
2) On the (K)ubuntu (Hardy Heron) side, just putting a hold on the netatalk package was not the best approach, as Adept kept saying that I had available updates, even though it was on hold. I was able to do a “sudo dpkg –configure -a”, then add comments to the package before rebuilding it with the ssl option. This gave me a custom deb that Adept isn’t complaining about.
Anyone have troubles with 10.6.2 disconnecting from the AFP share? The logs in my Console look like:
11/16/09 1:38:12 PM KernelEventAgent[40] tid 00000000 type 'afpfs', mounted on '/Volumes/Time Machine-1', from 'afp_00yVhf00yVhf00yVhf00yVhf-1.2d000027', dead
11/16/09 1:38:12 PM kernel [FSLogMsgID 819337454] [FSLogMsgOrder Last]
11/16/09 1:38:12 PM kernel 00yVhf-1.2d000027] [MountPt /Volumes/Time Machine-1] [Path /Volumes/Time Machine-1/koufax_0023322df5d8.sparsebundle/bands/395] [FSLogMsgID 492112910] [FSLogMsgOrder Last]
11/16/09 1:38:12 PM diskimages-helper[2331] terminating disk2 - image is no longer available
11/16/09 1:38:12 PM com.apple.backupd[2205] Stopping backupd to allow ejection of backup destination disk!
And so on. Anyone seen this?
Netatalk in Ubuntu 9.10 does not need to be built with SSL. The prebuilt package works fine. Also, you need to use the default settings in /etc/netatalk/afpd.conf which does not include -advertise_ssh.
Version 2.0.5 of netatalk now supports Time Machine backups natively via option “tm”. There isn’t an Ubuntu/Debian package for it yet, but it can be compiled from source. On my Debian system I installed 2.0.4 according to instructions here, then overwrote 2.0.5 on top of it (cludgy, I know).
The benefit is you no longer have to do any trickery creating the sparsebundle, it all just works the way it should.
I used the following configure string for 2.0.5, if that helps anyone:
./configure –prefix=/usr –sysconfdir=/etc –localstatedir=/var –enable-debian –enable-timelord –enable-a2boot –enable-cups –enable-overwrite –with-cnid-cdb-backend –with-cnid-dbd-backend –with-cnid-dbd-txn –with-cnid-db3-backend –with-cnid-mtab-backend –with-cracklib=/var/cache/cracklib/cracklib_dict.pwd
Thanks, Dough. Worked for me as well for the source 2.0.5 stable.
Great blog with great information this one.
Jack
Witch is the more easiest to do that? Ubuntu 9.10 or 8.04 please?
Hi
I am usding ubuntu 9.10.When i entered
sudo apt-get build-dep netatalk it says
ladmin@MRADP000005:~$ sudo apt-get build-dep netatalk
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libcupsys2-dev is a virtual package provided by:
libcups2-dev 1.4.1-5ubuntu2.1
You should explicitly select one to install.
E: Package libcupsys2-dev has no installation candidate
E: Failed to satisfy Build-Depends dependency for netatalk: libcupsys2-dev
What can i do for this
I just saw that Debian Sid’s /etc/netatalk/AppleVolumes.default added the line:
# tm -> enable TimeMachine support
anyone familiar with this?
Perfect tutorial!
Very interesting!
Thanks a lot!!!
@neoice: As I indicated above, version 2.0.5 of netatalk has Time Machine support built in. It’s no longer necessary to build the sparsefile locally and then copy it up to the server, it Just Works.
I can confirm that it works too.
No more need to hack the Mac with the command :
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
Cool!
I had this working flawless on my Ubuntu box (Dell Dimension 8200 w/ upgraded 2.5 GHz CPU & 512 MB RDRAM), but the upgrade to 9.10 from 9.04 brought up tons of issues with the whole Intel graphics thing.
Glad I was able to find this guide again, it has made things much more simple for the second time. Thanks
I’m using Ubuntu 9.04 and Snow Leopard and was getting “incorrect password” problem.
In /var/log/daemon.log I found:
Nov 30 22:24:00 oddjob afpd[17086]: uam: loading (/usr/lib/netatalk/uams_randnum.so)
Nov 30 22:24:00 oddjob afpd[17086]: uam: uam not found (status=-1)
Nov 30 22:24:00 oddjob afpd[17086]: uam: loading (/usr/lib/netatalk/uams_dhx.so)
Nov 30 22:24:00 oddjob afpd[17086]: uam: uam not found (status=-1)
Changing the last line of /etc/netatalk/afpd.conf to the following fixed the issue:
- -transall -uamlist uams_randnum.so,uams_dhx2.so -nosavepassword
@Ali: adding your line to myafpd.conf fixed my problem in Ubuntu 9.10. For my installation, I just used the netatalk package as released (didn’t build anything), then installed and configured avahi, but I was having problems with “invalid username or password” when I tried to connect. Adding your line enabled me to connect. Thanks!
if i would like to disable mac ‘metadata’ for specific volumes (like www), how would i go about that?
thanks
@Matthias:Now that we got so many follow ups on your great tutorial, do you think you could update it, to reflect the latest status? Reading all posts and replies is quite uncomfortable
I would appreciate that very much.
Jürgen
@Matthias: I would second Jürgen’s wish. There seem to be a lot of improvements with the current Netatalk version. It would be awesome if this (as well as the other helpful remarks) could be reflected in an update to the original blog post.
However, maybe it would make sense to wait for Ubuntu to include the current Netatalk version in their repositories. Then the installation is much more streamlined for most of the users new to Ubuntu.
I third the suggestion of consolidating the new info but I suggest you branch a new version for Ubuntu 9.10 and the new Netatalk and keep this, the more stable version, as is.
Great tutorial – I compiled and copied over a 2.03 netatalk on my ubuntu 8.04 server. A bit of a kludge but it works great! It does not advertise itself via avahi but once connected it shows up in time machine and relinks automatically – works like my airport extreme. Very nice.
No a perfect mac… for me.
I am usding ubuntu 9.10 desktop.When i enter:
sudo apt-get build-dep netatalk it says
sudo apt-get build-dep netatalk
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libcupsys2-dev is a virtual package provided by:
libcups2-dev 1.4.1-5ubuntu2.1
You should explicitly select one to install.
E: Package libcupsys2-dev has no installation candidate
E: Failed to satisfy Build-Depends dependency for netatalk: libcupsys2-dev
Is there a solution to this? Thanks,
sudo apt-get install libcups2 libcups2-dev
Can anyone help me set up Netatalk to share a 2nd drive? I tried sudo gedit /etc/netatalk/AppleVolumes.default to add “/media/FANTOM K-FANTOM allow:username1,username2 cnidscheme:cdb options:usedots” then restarted Netatalk. I know it is probably something simple, but I cant figure it out. Kevin.P.Martini@wmich.edu if anyone cares to help. Thanks!
UPDATE: I figured it out, I had to add (code in brakets) [/media/FANTOM/ "K-FANTOM"] to/etc/netatalk/AppleVolumes.default BEFORE the default [~/ "Home Directory"] line.
I have successfully added afp shares for both internal (IDE) drives and external (Firewire) drives this way.
Could somebody please explain, how I can install netatalk on my ubuntu 9.10 box including the TM support? I didn´t get it
2.04 is running already.
Thanks
Jürgen
For those that are getting the “libcups2-dev” error. (“E: Package libcupsys2-dev has no installation candidate
E: Failed to satisfy Build-Depends dependency for netatalk: libcupsys2-dev”)
Solution: Open up Preferences > Admin > Synaptic Package Manager. Search for “libcups2-dev” and install it. Retry the steps above.
Worked for me, hope it works for you!
Hi, great tutorial! Everything worked perfect, except for one small problem. I couldn’t get my Ubuntu drives to show up in Finder no matter what I did. I could connect via ⌘-K and then my Ubuntu box would show in the Finder sidebar, but not before connecting. So obviously Bonjour wasn’t working as expected. After much frustration I found that Firestarter firewall on my Ubuntu box was the culprit, it would not allow mDNS requests for some reason and there was no way to change this behaviour from the GUI. Luckily I found a quick and easy fix here. Just add
$IPT -A INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
$IPT -A OUTPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
to /etc/firestarter/user-pre and then restart firestarter. In addition, as mentioned before in these comments, you need to allow ports 548 and 5353 in Firestarter. Hope this helps someone!
I had successfully setup a time machine backup using the excellent tutorial on an ubuntu 8.04 amd64 machine. I recently noticed that the backups had stopped working. Not sure if its since upgrading to ubuntu 9.10 or Snow Leopard. I cannot even mount the volume from the command line. Symptons from the mac ….
mount -v -t afp afp://martin:ZZZZZZ@thecla3/XimeMachine /Volumes/T3timemachine
mount_afp: AFPMountURL returned error -5019, errno is 89
on the ubuntu machine …
Dec 11 00:05:36 thecla3 afpd[1367]: server_child[1] 3274 exited 1
Dec 11 00:05:36 thecla3 afpd[3275]: ASIP session:548(5) from 10.0.0.248:62700(7)
Dec 11 00:05:36 thecla3 afpd[1367]: server_child[1] 3275 done
Dec 11 00:05:36 thecla3 afpd[3276]: ASIP session:548(5) from 10.0.0.248:62701(7)
Dec 11 00:05:36 thecla3 afpd[3276]: DHX2 login: martin
Dec 11 00:05:37 thecla3 afpd[3276]: DHX2: logincont2 alive!
Dec 11 00:05:37 thecla3 afpd[3276]: PAM DHX2: PAM Success
Dec 11 00:05:37 thecla3 afpd[3276]: DHX2: PAM Auth OK!
Dec 11 00:05:37 thecla3 afpd[3276]: login martin (uid 1000, gid 1000) AFP3.1
Dec 11 00:05:37 thecla3 afpd[3276]: logout martin
Dec 11 00:05:37 thecla3 afpd[3276]: 0.60KB read, 0.45KB written
Dec 11 00:05:37 thecla3 afpd[1367]: server_child[1] 3276 done
D
volume root ….
ls -a /data1/timemachine/
. .AppleDesktop mac1_001ff3c9dad3.sparsebundle Temporary Items
.. .AppleDouble.old Network Trash Folder
Ive tried upgrading to 2.0.4_beta, checked for spaces in sparsebundler, remove .AppleDB and .AppleDouble
all to no avail.
Any suggestions welcome.
hhmm, noticed I had not reverted the XimeMachine to TimeMachine. Corrected this and rebooted the ubuntu machine and now get mount_afp: AFPMountURL returned error 1, errno is 89 and I noticed the .AppleDB, .AppleDouble have reappeared. I cannot find anywhere what errno 89 means?
DOH – stupid me, I was trying to do the mount as the user and the mount point was owned by root. It good to talk. Pity the error messages could not be more explicit.
“The operation cannot be completed because the original item for _____ cannot be found”.
Just delete the .AppleDB in the folder that is giving you problems, worked for me.
# rm .AppleDB
Is anyone using Sophos Antivirus.
I had been experiencing awful crashes on my Mac Book Pro (10.5.8) backing up to an Ubuntu 9.04 as per this tutorial. The computer would completely freeze while running a Time Machine Backup and would not provide any debugging information. See my previous post (499) for details.
I have recently turned off Sophos antivirus and my backups now seem very stable and are lightning fast. It seems just turning off ‘scan of network volumes’ works but I have fully turned off the antivirus anyway.
Has anyone else experienced problems or success with Sophos?
Could somebody please explain, how I can install netatalk 2.0.5 on my ubuntu 9.10 box including the TM support? I didn´t get it…
2.04 is running already.
Thanks
Jürgen
I found 2.0.5 here: http://packages.debian.org/unstable/net/netatalk
“I can confirm that Sterrior’s method works. TM tries to create [computername].sparsebundle, but actually still wants [computername]_[en0 MAC].sparsebundle.”
I can confirm that it works as well on Snow Leopard.
“I used the following configure string for 2.0.5, if that helps anyone:
./configure –prefix=/usr –sysconfdir=/etc –localstatedir=/var –enable-debian –enable-timelord –enable-a2boot –enable-cups –enable-overwrite –with-cnid-cdb-backend –with-cnid-dbd-backend –with-cnid-dbd-txn –with-cnid-db3-backend –with-cnid-mtab-backend –with-cracklib=/var/cache/cracklib/cracklib_dict.pwd”
Thanks, Doug, it worked!
Can also confirm that adding the “tm” option to the /etc/netatalk/AppleVolumes.default file makes everything work as it should – that is, no need to manually create a sparsebundle and upload it to the server.
Note, for the above comment, I was referring to netatalk version 2.0.5, which supports Time Machine.
has anyone run into an issue of being unable to transfer files >4GB from the mac to the Ubuntu server?
I am running into this issue. Writing these large files from an external to the server works fine, but not from OSX.
Thanks, this is an amazing tutorial!
I get an error copying folders to my mounted AFP drive if they contain any files or folders:
“The operation can’t be completed because an unexpected error occurred (error code -50).”
1. Create a folder on the mac (NewFolder)
2. Create a folder inside the NewFolder. (e.g. NewFolder/NewFolder2)
3. Copy NewFolder to the mounted AFP volume.
I get this error: “The operation can’t be completed because an unexpected error occurred (error code -50).”
I can copy individual files, create new folders and delete items on the AFP volume successfully, but can’t copy folders over that contain any files or folders. Any one have any idea what the problem could be?
Googling the error I only get one hit which describes the problem but offers no solution:
http://discussions.apple.com/thread.jspa?messageID=10715528&tstart=0
Hi all,
I just tried setting this up on my Ubuntu 9.10 laptop.
I have a 1TB external usb drive attached to this laptop, and I would like to share its contents using both smb (for my wife’s windows laptop) and afp (for my mac) protocols.
I have the following issue:
I can see my Ubuntu laptop in finder, it appears as a windows server, and it allows me to access the external usb drive.
If however I go to Go > Connect to Server and then select the afp protocol to connect to my Ubuntu laptop, then I can only see my /home folder on the Ubuntu machine but not the attached usb drive.
Can anyone tell me what I did wrong?
p.s. I have these two lines at the end of my AppleVolumes.default file:
~/ “Home Directory”
/media/5d1ee8d9-c64f-424d-ae93-c7e04e46222e options:usedots,upriv
Sorry that I keep posting back like this, but I got a step further, I edited the line in AppleVolumes.default to look like this:
/media/5d1ee8d9-c64f-424d-ae93-c7e04e46222e NetworkSpaceAFP options:usedots,upriv
Now when I go to Go > Connect to Server I can see NetworkSpaceAFP in the list of available volumes that I can mount, but when I try to mount NetworkSpaceAFP I get the Connection failed error.
Please help
I should have continued to read the tutorial and all tips to the end, I merely had to delete the .AppleDB folders and am now able to connect using AFP. Thanks so much for this!
Excellent article! I’m in the process of setting up an Ubuntu 9.10 Server on my network as my File and Backup Server and was also concerned about some of the nuisances that I may come across, especially regarding TM. I didn’t want to have to plug in a USB disk to my Mac, nor did I want to keep my existing USB disk connected to my Airport Extreme Base Station. Your guide looks like it will help me achieve what I’m looking for. I have yet to do all the steps, but will be doing so in the very near future.
Thanks again!
This guide is great! I used it and everything works. I featured it on a blog post here if you want to see it in action: http://www.macmufasa.com/MacMufasa/Blog/Entries/2009/12/22_Make_Ubuntu_into_a_Mac_File_Server_and_Time_Machine_Backup.html
Linux noob here.
could somebody explain in detail how to install and configure netatalk 2.0.5 via CLI?
I can’t get it to work because I don’t now how to compile and stuff.
2.0.5 is running now but I can’t login on my server from OSX. although it pops up as an xserve. When I try to connect it says username or password is invalid.
how to fix? thx in advance
It may have something to do with your settings in OSX, select your Ubuntu X-serve and click on the button in the right hand corner “Connect As” and make sure you are connecting with the user/password defined when you configured shared volumes
that’s what i’m doing all the time. I log in with the server’s username/pw.
Is it possible this is because I don’t use encryption?
I launched iTunes, went to iTunes > Preferences > Advanced and changed the Media Folder Location to the “music” folder on my Ubuntu machine.
But no music shows up in the Music library in iTunes. Any ideas? Is this working for anyone?
Hi,
since I updated to netatalk 2.0.5, I can not login with my username/password anymore. In version 2.0.4 everything worked fine. Is in version 2.0.5 ssh still included? (like it was in 2.0.4, but not in 2.0.3)
Could somebody show me his config files, or take a look at mine (I could send via email) ?
Any help would be appreciated.
Jürgen
Unfortunately, I followed all of the instructions to the tutorial without reading the 500 other comments first. I have changed the AppleVolumes.default and afpd.conf files. However, since I have Ubuntu 9.10 and Netatalk 2.0.5 some of those changes don’t need to be made… or do they?
Could someone pleasepost what those two files should have in them with the latest and greatest versions. Muhcas Gracias!
See my post below concerning authenticaiton libraires in /usr/lib/netatalk.
You might need to modify your afpd.conf file to use dhx2.
Regards.
Hi There, I am having some trouble with netatalk and Snow Leopard (I am using the 2.0.4 build that comes with Ubuntu 9.10). Basically, It looks like something’s off when I try to delete folders that have files in them from the Mac. I keep getting the error message “The operation can’t be completed because the item … is in use.”
If I manually get into the directory and delete its contents, I can then go back and delete the outer directory with no error message.
The netatalk settings are all at default, I’ve really done nothing in either AppleVolumes.default or in afpd.conf. Still, I’d expect the defaults to function properly with OS X. Considering how many problems I’ve had with it, I’m starting to suspect netatalk is a dead-end. Is it even possible to get it to work smoothly with Snow Leopard?
Any hints would be greatly appreciated.
Having problems to load avahi-daemon on startup!(?)
I have to manually “sudo /etc/init.d/avahi-daemon” and thats not a good way to do it.
I am having the same issue as Johan (post 543). The avahi-daemon does not seem to be starting on boot. I am on Ubuntu 9.10 server.
I had this working like a dream on 9.10 with 2.0.4 and then like a fool I installed 2.0.5-2 over the top and now I get the Connection Failed error. I kept my old config files so
1. Does anyone know where I might find the original config files which come with 2.0.5? I don’t know how to uninstall and reinstall without it just reinstalling as per the first install I did.
2. Does anyone have any suggestions as to what’s wrong with the bloody thing?!
Try disabling roaming mode on your network connection as stated here: http://bit.ly/7Yv2cS
If you don’t have Network in your System > Administration menu, install Gnome Network Administration Tool (gnome-network-admin).
I’ve successfully compiled 2.0.5 on an Ubuntu 9.10 VM under VirtualBox, and can see the server being advertised via Avahi, but when I try and connect, I get invalid password. I know the password is correct. I disabled roaming, but am not sure that that had anything to do with my issue since I see the advertisement of the share.
Any ideas?
I already have TimeMachine running fine on Ubuntu 9.10 and netatalk 2.0.4 on real hardware, and was trying to get 2.0.5 running.
I just solved my login problem.
In 2.0.4 on my working Ubuntu TimeMachine, in /usr/lib/netatalk, location of the authenticaiton libraries, there is clrtxt, dhx, dhx2, randnum, etc. However in 2.0.5, there is only clrtxt, and dhx2.
I changed the afpd.conf file to this:
- -transall -uamlist uams_clrtxt.so,uams_dhx2.so, -nosavepassword
And now I can login to the share without issue.
Hope this helps someone.
Thank you for this great tutorial and also for all of the many helpful followup posts. As some have pointed out it can get a little confusing with the different versions (Netatalk/Ubuntu/Os X) and there seems to be a number of pitfalls that you can encounter when compiling/installing Netatalk. I’m pretty comfortable compiling and installing software, but I was never able to get Netatalk 2.0.5 compiled and installed on Ubuntu 9.10. I worked through a number of dependency issues and I’m not even sure exactly what my lastest problem was, but no success!
Then I found this post:
http://ubuntuforums.org/showthread.php?t=1341810
Post #3 mentions:
‘deb http://ftp.de.debian.org/debian sid main’ – added to ‘/etc/apt/sources.list’
Once you add that source you can then install 2.0.5-2 from Package Manger. Wow! So easy!
After installing Netatalk 2.0.5 then all of the remaining configuration steps worked for me as explained in this tutorial on Ubuntu 9.10 and connecting from Snow Leopard (I have 2 Macbooks and a Hackintosh desktop).
As Michael posted above, for Snow Leopard setting up your sparse bundle needs more than a mac address in the file name. There is a great script that you can find here that will create the bundle for you.
http://www.insanelymac.com/forum/index.php?showtopic=184462
I’ve been using this method (creating the bundle with this script) for backing up my Macbooks to my Hackintosh since Snow came out and it works great. Almost! I have however had some problems with the sparse bundles becoming corrupted after a period of time, so that is why I’ve been experimenting with this.
I’d be interested to hear if anyone else has had problems with their sparse bundles corrupting after time. Both of my Macbooks are put into sleep mode regularly and I don’t run the Hackintosh 24/7 so I suspect that problem comes from some combination of sleeping the Macbooks and turning off the Hack while Time Machine is in operation. I haven’t been able to nail down the cause and it usually take several months for it to happen, but I’ve it has now happened several times and once it does happen the sparse bundle is totally corrupted and even Disk Manger can’t repair it. My Linux box runs 24/7 so I’m hoping that backing up to it will eliminate this problem. Time Machine is one of the great things about OS X, but when your backup goes South all of a sudden for no explained reason then it doesn’t seem so great any more!
Michael, I don’t have direct experience with your latest problem with updating Netatalk 2.0.4 to 2.0.5, but I’ve been doing a lot of research on this over the last few days and think I’ve seen a solution to your problem.
Try deleting the .AppleDB file from the Ubuntu directory. You should then be able to connect from OS X. That’s what I’ve seen from some other posts anyway, but haven’t had this problem and haven’t tried this solution. Hope it helps!
I had this working great until I had an issue with my Ubuntu machine and I had to rebuild it from scratch. I have a RAID 5 (built with mdadam) on this machine for all my music, videos and pictures. After I rebuilt the sever I couldn’t access the ADM share. I would see it in finder but when I would select it I would just get a beach ball of doom forever. I deleted the .AppleDB, .AppleDesktop and .AppleDouble files and directories and all was fine after that.
Just so you know I am using netatalk 2.03 on a Ubuntu 8.04 machine with a mixture of Leopard and Snow Leopard machines.
Great!! Tanks very much.
I was also able to get AFP to work on Gentoo. I was not able to get the .sparsebundle to work; I have a brand spanking new MacBook Pro and the name of the sparsebundle was not in the form seen above. It kept trying to create it (the tmp file would show up and then be deleted after a TimeMachine error) no mater what I tried. Gentoo is still stuck with netatalk 2.0.3-r4 but I found an ebuild for 2.0.4. I modified the 2.0.4 ebuild to install 2.0.5 and everything worked fine; all I did was rename the patch from 2.0.4 -> 2.0.5 and renamed the 2.0.4 ebuild to 2.0.5. I know I know…not ideal but all works so I guess I dodged a bullet. Here is the bug report containing netatalk-2.0.4.ebuild and xfs patch. http://bugs.gentoo.org/show_bug.cgi?id=279057
Before I go spelunking with a packet sniffer, has anyone figured out what it takes to register the netatalk server with “back to my mac”? I know it involves an ipsec tunnel, and possibly kerberos on the netatalk server.
I did a manual 2.0.5 netatalk configuration on linux 9.10 with the support of this guide. I once was able to login and browse files in the home directory on the linux server. Unfortunately, I changed my config and I can’t go back to a proper config
The main problem I have is the following:
How can I enable logging so I get more information what avahi-daemon and netatalk are trying to do?
How can I check a proper service functionality using command line utilities? Both on the linux server and the mac client?
I’ve just started using UBUNTU this weekend, after coming across this tutorial last year I thought I’d get confident and give it a go. Its worked wonderfully and I can see the new machine right across my mac network – so thank you very much!
I was wondering what of the files left in the home folder were required, I’m guessing nothing. I don’t want to delete them without expert advice. These are the files/folders in question:
netatalk-2.0.4~beta2
netatalk_2.0.4~beta2-5ubuntu2_amd64.changes
netatalk_2.0.4~beta2-5ubuntu2_amd64.deb
netatalk_2.0.4~beta2-5ubuntu2.diff.gz
netatalk_2.0.4~beta2-5ubuntu2.dsc
netatalk_2.0.4~beta2.orig.tar.gz
Feedback would be gratefully received.
@adam: You can delete all these files, they are a result of compiling your own netatalk debian package but those files are no longer needed after installing said package.
BTW I can also confirm that Debian Squeeze (which contains netatalk 2.0.4-2 at the moment) supports uams_dhx2.so which means that there is no need to compile your own netatalk package in Debian Squeeze. Just replace uams_dhx.so with uams_dhx2.so in the instructions above.
Hi. Thanks for the great guide. Works perfectly apart from…
I am unable to connect by clicking on the advertised share in Finders side bar. I select it, click “connect as” and then get the “Connection Failed” message. I don’t get the opportunity to enter a user name and password.
If I press “Command + K” and type in my servers hostname I am then presented with the username and password dialogue and can mount all my shares.
Any ideas? Thanks….
Forgot to say running Leopard 10.5.8 and gentoo. Netatalk-2.0.5 & avahi-0.6.25
Hi folks and thank you Krema for this fantastig HowTo.
With my previous server’s configuration all was fine: I was running netatalk 2.0.3 and avahi on a Ubuntu 8.10 machine with Leopard 10.5.8 client.
Now I’ve upgraded both my server (Ubuntu 9.10 server) and my MacBook (Snow Leopard 10.6.2) but I can’t manage to get the avahi services discovered by both MacBook and another PC with Win Seven (I have Mt-daapd installed on my server and iTunes on PC can’t connect to my shared library).
Netatalk runs correctly because I can connect manually and transfer files correctly but I’ve tried to manage almost all avahi configs whitout fix any issue although the daemons log all appear to be fine.
Anyone has any idea?
Next step I will try to downgrade to Netatalk 2.0.4 and check if there may be some compatibility issues between Avahi and Netatalk…but I have not so much hope.
Thank you so much for putting that much love and spirit into this description. This was _exactly_ the thing I was looking for in days and weeks! It reads easily enough… my mom wouldn’t understand it, but never mind.
Thanks again for putting it up and updating it with news that becomes available. Well done.
– David
Thanks for this great howto.
Hi,
I have some upgrades: i’ve noticed that if I disable DHCP on the internet side network interface, my server’s avahi-daemon works very well. But this means that I will not connect to internet because the interface can’t get an IP address from the PPPoE server.
Unfortunately, I NEED internet access so I have to enable DHCP and mdns service becomes undiscoverable on the network.
Any ideas on how to fix this issue?
Hi there Pippa,
Got the same problem here with Avahi, running Snow Leopard 10.6.2 and Ubuntu Karmic 9.10. Ubuntu has a static IP address.
AFP is working, but I can’t get the server to show up in the Finder automatically (have to Connect to Server to get the server in Finder) or use iTunes to connect to FireFly.
Will try if running Ubuntu 8.04 instead will solve the problem.
TTiSoB, take a look at my reply no.561…maybe works also for you!
@Pippa: From Ubuntu 9.10 release notes
Avahi will always start even if a .local domain is present
The avahi-daemon package, which implements the mDNS “zeroconf” standard, formerly included a check to avoid running when a conflicting .local DNS domain is present, as it was reported that some ISPs advertise such a .local domain on their networks, leaving Ubuntu hosts unable to see names advertised on the local network (327362). In Ubuntu 9.10, avahi-daemon is started regardless.
It is possible that this may cause other problems. If your network is configured this way, you can disable mDNS using the following command:
sudo stop avahi-daemon
sudo sed -e ‘/^start/,+1s/^/#/’ /etc/init/avahi-daemon.conf
Have to try this myself if it works…
@Pippa: Bugreport on the issue
https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/327362
Solved!
There is no bugs to fix, the only thing to fix is my brain: the problem was born from firestarter. I had opened both Afpovertcp and mdns ports via GUI but to have avahi work properly it’s necessary to insert those rules in the /etc/firestarter/user-pre file:
$IPT -A INPUT -s 224.0.0.0/8 -d 0/0 -j ACCEPT
$IPT -A INPUT -s 0/0 -d 224.0.0.0/8 -j ACCEPT
$IPT -A OUTPUT -s 224.0.0.0/8 -d 0/0 -j ACCEPT
$IPT -A OUTPUT -s 0/0 -d 224.0.0.0/8 -j ACCEPT
Thank you again to all the community and to Eric Tanguy for this post: https://bugzilla.redhat.com/show_bug.cgi?id=189067
Now also Firefly works very well.
I don’t have that file.. Am I suposed to?
@Pippa.. good to hear.. less good for me.. I don’t have Firestarter installed.. running ubuntu 9.10 server edition without it.
Will try installing firestarter if that solves the problem.
After fighting with time machine on Snow Leopard, I got it to work by upgrading netatalk to version 2.0.5. Here is a howto for debian:
% wget http://ftp.de.debian.org/debian/pool/main/n/netatalk/netatalk_2.0.5-2.dsc
% wget http://ftp.de.debian.org/debian/pool/main/n/netatalk/netatalk_2.0.5.orig.tar.gz
% wget http://ftp.de.debian.org/debian/pool/main/n/netatalk/netatalk_2.0.5-2.diff.gz
% tar xvf netatalk_2.0.5.orig.tar.gz
% zcat netatalk_2.0.5-2.diff.gz | patch -p0
% cd netatalk-2.0.5
% sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot
% sudo dpkg -i ../netatalk_2.0.5-2_amd64.deb
When prompt to replace your AppleVolumes.default file, just answer No.
Edit your /etc/netatalk/AppleVolumes.default and add “,tm” to the end of your
volume options list. Mine looks like:
“/time_machine TimeMachine allow:ortal cnidscheme:cdb options:usedots,upriv,tm”
* While building the package you may encounter missing dependencies. use
apt-get install to solve them.
* It seems tht this version of netatalk is not backward compatible with the old one.
I had to delete all the content of my time machine volume for it to work.
I tried different versions of netatalk from http://ftp.de.debian.org/debian/pool/main/n/netatalk; It seemed only the 2.0.3-11+lenny1 version worked for me: compiled successfully on amd64 hardy LTS. Just a note which might help someone with netatalk compiling issues.
Thanks for this guide. I have this mostly working, my son’s MacBook can see the hfs+ partition on the USB HD shared on my Ubuntu 9.10 box. This USB drive was originall used locally on this same Mac, so it has about 15 backups on it. When I enter time machine as a share I don’t see any of these backups, when the drive is plugged in directly to the Mac they are present. What am I missing?
I’m not sure about this but I think that you have to format the partition as EXT4 because Ubuntu doesn’t manage to work HFS+ partitions.
So you have to format as EXT4, put in place all the above mentioned procedure and after it you will be able to work with your HDD.
Thanks @pippa. Once I “connect to server” that is my ubuntu machine I can navigate the directories in the share and I have write permissions. The share shows up in the “Browse Other Time Machine Disks” window, but when I navigate to it there are no backups available. When this drive is attached directly everything seems to be the same, except I can see the list of backups. I am pretty noobish, but would I have that level of access if ubuntu was having difficulties with the partition format?
Hi all,
fantastic guide!
I’m using this guide to get a WD Sharespace (4T) NAS working with my home Mac OsX 10.6 Server and other OsX 10.6 machines. The WD Sharespace is a busybox linux system, but does not support afpd out of the box. But netatalk it can be installed using the descriptions found on http://mybookworld.wikidot.com/netatalk-tutorial.
So far this NAS is giving me lots of problems to setup! I hate it… Nonetheless, after a week of trial&error, I got the user homes working (I hope! Need to test more).
Now I’m working on TimeMachine setup.
The question I have is: does one still need to specify the options:upriv,usedots in addition to the options:tm using the 2.0.5 netatalk package?
Best regards,
Stefan.
I’m in the process of setting up the WD Sharespace 4T with AFP and Bonjour and wrote a blog about it.
It heavily relies on this page (thank you!), but is – of course – different from settings things up on Ubuntu…
If of interest to you, see http://web.me.com/stefan.sunaert/WD_Sharespace_OsX/
Stefan.
Ubuntu 9.10, OSX Leopard
Could not connect to netatalk at all after reinstalling my Ubuntu box. avahi was working fine. Used all versions of netatalk described here. in /var/log/syslog I had entries like this whenever I would try to connect:
Jan 16 12:26:44 tor-desktop afpd[14272]: server_child[1] 15042 exited 1
Jan 16 12:26:44 tor-desktop afpd[15044]: ASIP session:548(5) from 192.168.1.105:59366(7)
Jan 16 12:26:44 tor-desktop afpd[14272]: server_child[1] 15044 done
These lines would show up when I clicked to connect to share, and no log lines after entering in my credentials, which told me the process was dying upon connect.
The solution was to comment out any lines in /etc/netatalk/afpd.conf and use the defaults. Work like a charm now!
BTW, stock netatalk for Ubuntu 9.10 will work with defaults.
Great tutorial/howto, Krema!
Thanks to you I have been able to set up shared documents, iTunes and iPhoto library on my Ubuntu server.
Being a Linux newbie I encountered a problem regarding permissions. I was able to figure it out, though, and perhaps someone else can make use of my experience.
Make sure that your Linux share point, e.g. /home/shared/photos, is set up belonging to the group of users (e.g. users) that you want to access the share:
sudo chgrp users /home/shared/photos
In addition to read and write permissions for the folder, make sure that all files created in that folder inherits the group setting using the “sticky bit”:
sudo chmod g+s /home/shared/photos
This way your iPhoto library is accessible for all users belonging to the group “users” in my example!
This may be kindergarden stuff for all you experienced Linux users, but maybe others in my situation can thrive on it. I have tried searching your blog for similar posts, but found none. I apologize if this is not the case…
Short question;
Is there a HOWTO for enabling all this services over VPN? Preferable pptp?
It works great over ethernet, but once connected over VPN(pptp) it stop working.
Regards Runar
The reason TM doesn’t work over pptp is because pptp doesn’t forward broadcast, which is how bonjour works, so therefore how TM locates the drive. You might be able to mount the drive manually and then start your back up that way, but I have not tried that. You could also manual mount the TM backup, and then try running the back up over you pptp tunnel, but again, I haven’t tried it so I don’t know if it would work.
I have been able to install and configure Samba to share files with my Mac (10.6.2) and it works fine; my attempts to install netatalk have failed multiple times (missing dependencies, can’t find this, or that..)
Even Time Machine works by following the steps mentioned above, I’m able to use TM to back-up to my smb share (after creating the sparse img).
The way I have it now it’s working on smb. My Ubuntu server automatically shows up on my Finder, and clicking on it takes me to my shares (I saved my login info to my keychain).
I don’t see the need to go through all this trouble and install netatalk (only one Mac at home).
So, please, excuse my ignorance – could someone please tell me WHY I should bother with netatalk if smb already works as I need it to?
Thanks.
Hi there Juan, Good question.. got the same setup here and I don’t know either why I did all above. Only guess I can make is that with netatalk/avahi the timemachine share would be automatically mounted.. something I don’t know for sure if a samba share will do.
Hi Kremalicious, maybe something to the guide:
For all running Snow Leopard and wondering why the sparsebundle you create doesn’t work with Snow Leopard…
The sparsebundle doesn’t have to be named like computername_0014e3856bd0.sparsebundle. There does have to be a file included in the sparsebundle referring to the UUID of your machine.
A guide on how to create the sparsebundle can be found at http://www.insanelymac.com/forum/index.php?showtopic=184462
I used the steps on this guide to create my sparsebundle image on my Mac, and then copied the image to my SMB TimeMachine share, and it worked fine.
Time Machine automatically mounts the share every time it needs to do its backups, and automatically dismounts it when it’s done.
I only had to manually mount the share once to have it show under the list of drives under Time Machine. After that, it’s all automatic.
The only thing that does bother me, and this has been happening for a while now even before changing the location of my TM, is that Time Machine will automatically attempt to back-up every hour – even when I’m not on the same network where the TM drive is. The TM icon “spins” for a few seconds, and then it stops, with the message “Latest Backup: Delayed”.
It will do this for as long as the Mac is not connected to my home network where I have the Ubuntu server and Time Machine backup share, but after connecting to my home network the backup proceeds as usual…
As far as I can remember, the original behavior of Time Machine wasn’t like this. I think (I could be wrong), that it detected that the current network wasn’t where the TM backup was, and it didn’t attempt to do the backup until it was back to its “TM” network.
Does anyone have a solution to this? “How to stop TM from attempting to back-up every hour when the backup disk is not connected.”
It’s not a problem (for now), but a minor nuisance I’d say.
Great guide! I have this up and running on my gentoo box, and have had it running for over a year, thanks to this guide. I just ran some upgrades and updated to netatalk 2.0.5-r1 and everything is working great after I fixed all the broke packages! Thanks for the guide and all the tips!
Can someone explain what i need to add to the applesvolume.default to get all of my media hard drives to show up on my mac?
for example i have
/media/movies “movies” allow:username cnidscheme:cdb options:upriv
doesnt seem to be working.
I had a problem using “allow:username”, even after entering my user name didn’t work.
Take out that portion and just leave it like this:
/media/movies “movies” cnidscheme:cdb options:usedots, upriv
After you change the configuration file, restart the netatalk services: sudo /etc/init.d/netatalk restart
I had some trouble at the beginning too, and this worked for me. Good luck.
great job! I’m wondering about automatising some processes – this is really useful article. thanks guys!
Awesome tutorial. Needs to be updated. With a little reading and following comments from people in the thread I was able to figure it out. But yes. Comment out all lines in afpd.conf.
This tutorial is so great in needs to be put up on a wiki. So that more devs can update it as the thread is kinda old.
Hi. Well, I’ve followed the steps in your article and have my home folder is showing up in the sidebar in Finder, but when I try connecting using Connect As…, I get:
There was an error connecting to the server. Check the server name or IP address and try again.
Any ideas? Thanks, Leo
Figured it out. Didn’t actually rebuild the package because it was missing libcups2 package. After that was installed things worked perfectly. Thx!
I’ve followed this tutorial word by word on both Ubuntu 9.10 and Debian 5. And never succeeded in getting the server to show up under shared devices in the left pane of the finder
Anyone else have the same problem?
Just thought I’d add the some netstat info from the debian box:
tcp 0 0 0.0.0.0:548 0.0.0.0:* LISTEN 2387/afpd
tcp 0 0 127.0.0.1:4700 0.0.0.0:* LISTEN 2385/cnid_metad
udp 0 0 0.0.0.0:39358 0.0.0.0:* 2091/avahi-daemon:
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2091/avahi-daemon:
udp6 0 0 :::41490 :::* 2091/avahi-daemon:
udp6 0 0 :::5353 :::* 2091/avahi-daemon:
Those are all the daemons related to this right? Anything off?
Thanks
/dan
I’m in the process of backing up my files to my Linux box and so far things are working great. I had to create the sparsebundle image as mentioned in the tutorial above.
I have a question though. Once the backup is finished, I plan to move my iTunes library from the hard drive to the USB drive that used to be my TimeMachine backup and then I want to add this drive as well to the backup. My question is, will I need to create a second sparseimage file for the USB when added?
Thanks,
Leo
Hi. The installation of ‘build-dep’ via apt-get install on Ubuntu Karmic failed, because the package doesn’t exists. But I found the dpkg-buildpackage tool in the ‘dpkg-dev’ package now. Hope it saves somebodies time
Thanks,
Axel
Hi all,
I have followed this guide to enable a TM and a shared file server on ubuntu.
I have just encountered one problem :
When i lauch the external disk on my mac, I see my customized icons (for example on movie files I insert the poster as icon).
But when i see it through the file server, i can not see the customized icons but only the default one.
I used usedots option if it can help.
This lies in the way you changed the icon. Linux and Mac OS (and windows) have different ways of “attatching” the file to the icon. The customized icon is not seen in Linux because of the way Mac OS does it. Im pretty sure you will have to re-assign custom icons in each OS.
I am having issues using this with 2 Machines on a single LAN my computer (OS X.5) sees the same share for both machines, ie connecting to “K-UBUNTU” yeild the K-Ubuntu share, but connecting to my second computer “K-FRAME” also pulls up the K-Ubuntu share. I swear I have had this set up on 3 different machines at once without any problems, only difference I can think of this that this time one of my Ubuntu machines is 9.04 and the other is 9.10.
Anyone have any ideas???
@K6Martini : in the two cases I browse the disk with mac osx. But on one side, its via direct usb, and on the second side its via network sharing (netatalk).
Does anyone know how to get rid of (or avoid creation of) these two folders: Network Trash Folder and Temporary Items.
They get created on every root shared folder that I access from my Mac via AFP. While not visible to the Mac, they are visible to Windows and through Ubuntu when using the command line.
I’ve tried deleting them, but they keep reappearing. I do not want a “Network Trash.”
Searching online hasn’t been much help.
Anyone?
Can’t you just select in ubuntu/windows *hide hidden folder*?
Tried, but the settings don’t “stick”, even though I have full rights of the folder, and I’m the owner.
As soon as I hit “apply”, the settings revert to the previous.
Been trying to set up my file server all week and an hour or so later after finding this tutorial I’m golden. First SSHFS, then HFS, which with tiger required finagling, then i find this. Great stuff. So I’m just rocking SSH and AFP and thats all i need.
This must be the most elaborate article on the subject I’ve ever seen, great work! It really helped me setting up all of this in under five minutes.
Thanks,
maze
On my Debian Squeeze server an apt-get dist-upgrade lately left my netatalk unable to be connected from Macs. In the server’s syslog I found this line:
afpd[20786]: PAM DHX2: libgcrypt versions mismatch. Need: 1745620456
Unfortunately someone forgot, that the Squeeze netatalk package needs a newer version of the package libgcrypt11 than Squeeze is offering at the moment.
So I compiled a new libgcrypt11 package (1.4.5-1):
aptitude build-dep libgcrypt11
cd /usr/local/src
wget http://ftp.de.debian.org/debian/pool/main/libg/libgcrypt11/libgcrypt11_1.4.5.orig.tar.gz
tar xvf libgcrypt11_1.4.5.orig.tar.gz
cd libgcrypt-1.4.5
wget http://ftp.de.debian.org/debian/pool/main/libg/libgcrypt11/libgcrypt11_1.4.5-1.debian.tar.gz
tar xvf libgcrypt11_1.4.5-1.debian.tar.gz
wget http://ftp.de.debian.org/debian/pool/main/libg/libgcrypt11/libgcrypt11_1.4.5-1.dsc
dpkg-buildpackage -b -uc
dpkg -i libgcrypt11_1.4.5-1_amd64.deb (system architecture may vary, insert yours instead of “amd64″)
The other packages build by dpkg-buildpackage I guess are not necessary, but I installed them all too:
dpkg -i libgcrypt11-dev_1.4.5-1_amd64.deb
dpkg -i libgcrypt11-dbg_1.4.5-1_amd64.deb
dpkg -i libgcrypt11-doc_1.4.5-1_all.deb
/etc/init.d/netatalk restart
And I was able to connect to the Server, after as usually deleting the .AppleDB directories in the root of all afp server volumes.
Hope this helps someone. Since the new libgcrypt11 package is already available in Sid (unstable), you could also install it from there if you want to mess around in your sources.list …
For those who are having trouble with Ubuntu 9.10, I found this link solved all problems with installing Netatalk 2.0.5 with apt-get
http://notepad.bobkmertz.com/2010/01/apple-time-machine-backups-to-ubuntu.html
Hi,
Great tutorial, and I see it’s still growing! I have 9.10 and by default the VNC service is broadcasted. With that the afp service is broadcasted, but with an other name.
The afpd.service file you use is perfect because I can change the name and the icon, Perfect! But the vnc service is broadcasted as “%u’s remote desktop on %h”. How can I change that? Also, how can I see all the services that avahi is broadcasting, like firefly etc…
Thank you allot.
Actually I did manage to add the vnc service by adding
_rfb._tcp
5901
on the .service file, but I want to remove the second vnc service announce.
Thank you
Great tutorial, thank you. I have afp sharing working great and avahi advertising the server.
Howerver, TimeMachine continuted to fail to create the first backup with the error 45.
Any ideas what I’m missing?? Thanks in advance. Below are the details.
ubuntu server 9.10
OSX 10.6.2
I used hdiutil to manually create a volume on my desktop. I then copied the com.apple.TimeMachine.MachineID xml file with my guiid inside into that new sparsebundle. The I copied that sparsebundle to the server.
In watching the mac’s syslog it looks like Time Machine is not using the sparsebundle I created.
For example.
1) When I create a sparsebundle named “hostname.sparsebundle” then TimeMachine fails trying to create “hostname 1.sparsebundle.”
2) When I create a sparsebundle named “hostname 1.sparsebundle” then TimeMachine fails trying to create “hostname.sparsebundle.”
Here is a snipped from my Mac’s sys log file.
23:11:37 new-host /Applications/System Preferences.app/Contents/MacOS/System Preferences[15755]: TMShowUnsupportedNetworkVolumes is set to TRUE which allows selection of unsupported Time Machine network destination volumes. Use of an unsupported network destination can result in silent data corruption and complete loss of backup data under certain circumstances!
23:11:43 new-host UnmountAssistant[15768]: Volume unmounted successfully
23:12:09 new-host com.apple.backupd[15584]: Starting standard backup
23:12:09 new-host com.apple.backupd[15584]: Network destination already mounted at: /Volumes/backup-2
23:12:09 new-host com.apple.backupd[15584]: Creating disk image /Volumes/backup-2/hostname 1.sparsebundle
23:12:10 new-host hdiejectd[15776]: running
23:12:20 new-host hdiejectd[15776]: quitCheck: calling exit(0)
23:15:57 new-host com.apple.backupd[15584]: Error 45 creating backup disk image
23:15:57 new-host com.apple.backupd[15584]: Failed to create disk image
23:16:02 new-host com.apple.backupd[15584]: Backup failed with error: 20
23:16:02 new-host com.apple.backupd[15584]: Ejected Time Machine network volume.
Hi Tod,
I’m having the same problem than you are. Did you ever get an answer or the solution?
Do you mind sharing?
Thanks.
Is there any way to change the represented icon for a Windows server to make it show as a xServe? (like step 5, but on windows server 2003)
There goes that, i went to transfer a 6 gig folder of music, 1.5 gigs in, i get an (error -36) from Tiger 10.4. now trying to connect just freezes my file manager (mac). sigh, I’m currently looking into it.
great discussion! i have installed Ubuntu some days back and was quiet unaware with how to deal with this… but your post and further discussion told me a lot… really great post.. thanks to share
Thanks for the tutorial; it was really helpful when setting up my file server. With Snow Leopard and Karmic, I was (at first) only able to get AFP sharing to work by compiling netatalk from source as you described to enable SSL.
However, after reading the comments on Debian bug #191790 and a little investigation, I discovered that the stock version distributed in the repository is now good to go without the need to re-compile. In other words, step 1 could be much simpler:
sudo aptitude install netatalkEvidently, the maintainers upstream have enabled DHX2 authentication support, but not activated it by default. Based on step 2 above, I edited /etc/netatalk/afpd.conf to use uams_dhx2.so instead of uams_dhx.so and now my 10.6 client connects just fine. (I haven’t tested with any other versions, but DHX2 support for encrypted passwords has been built-in since OS X 10.2.)
My /etc/netatalk/afpd.conf:
- -transall -uamlist uams_dhx2.so -nosavepassword -advertise_sshPerhaps in the future the package maintainers will activate DHX2 by default (rendering this one-time step unnecessary), but until then, this is a lot simpler than recompiling. Plus, this means you can now safely upgrade to new releases of netatalk without breaking your setup.
Thanks again for the excellent post.
Quick tip about “Connection Failed”.
I had to shift to another server, and moved all my storage over to another box. I used the same IP and other settings. Despite repeated netatalk setups, I kept getting “Connection Failed.” The folders would even show in a finder popup window.
Turns out that when I moved the files over, I brought over the .AppleDB directories with them. AFP doesn’t like this, per this post: http://www.gentoo-wiki.info/HOWTO_Share_Directories_via_AFP.
If you simply go in and delete those .AppleDB directories from each share, everything will be hunky dory again on your new server.
Thanks a lot for this guide! It took a little time but it was worth it: everything works greatly and the transfer rate is far better then samba.
I use Mac Os X 10.5.8.
Great tutorial. I had it all set up nicely, sharing an external drive, until I decided to swap the drive out for a larger one.
I copied everything directly across, but when trying to access it I would get an error: “The alias “XXXX” could not be opened, because the original item cannot be found”
Deleting all of the metadata files that OS X stores on the drive fixed the problem (basically delete everything in the root of the share that starts with a “.” – be careful)
Just posting in case others are having this issue.
I’ve managed to get netatalk 2.0.5 up and running from the debian packages.. but I keep getting the authentication errors that others have mentioned. Has anyone worked out a solution for this?
Awesome job! One of the best tuts ever.
Got it to work on Snow Leopard after 2 bumps, let me share:
1. Experimented with ddb, but had to change it back to the initial cdb in /etc/netatalk/AppleVolumes.default
cause it was giving:
“The operation could not be completed because the original item for ‘Time Machine’ could not be found”
2. It’s important you figure out en0′s mac address and Don’t look at the Console’s: disk image path, cause putting an image in that location doesn’t work. You really need the _.sparsebundle, and nothing else, or you’ll get an:
“Error 45″
Thank you, works perfectly for me !!!Great Job
Hi,
Thankyou so much for this guide. It was perfect for my Ubuntu server. However, I recently installed Fedora 12 x64 and wanted to share how I got everything working using the guide and just the available rpms of netatalk 2.0.4.
1) using gui installer or yum install netatalk
2) configure the xml afp service for avahi as per this article instructions. can’t remember if avahi was already configured to start but you can do chkconfig avahi on
3) yum install nss-mdns.
4) edit /etc/nsswitch.conf
#hosts: db files nisplus nis dns
hosts: files mdns4_minimal [NOTFOUND=return] dns
To test, use terminal to ping each other. e.g. ping .local and from fedora ping .local
Using Fedora remote desktop (vino), Avahi, I was able to use Apple Remote Desktop screen sharing.
hope this helps someone with fedora 12.
Jag
Hey gang…
great tut! I have followed it for 2 machines (+1 mac to view them from) and gotten mixed results.
machine 1 = Ubu 9.10, ext3 fs shared out + the resumable vnc thing, all working perfectly, except that spotlight can’t index it because it’s not hfs+. That’s a bad thing for my Work Projects folder…
machine 2 = Deb 5 Squeeze, with a dedicated hfs+ drive just for this (in the hopes of getting spotlight to work). can’t seem to write to it, only read, can’t figure out why and don’t know where to start looking.
But here’s the even bigger problem, assuming I can figure out machine 2′s permissions issue… if both machines are running netatalk, the mac confuses one for the other and shows the same shares for both machines (it shows machine 1′s shares), even though the 2 lin boxes have different shares entirely, different static IPs, different mac addresses, you name it…
so why would the Finder be showing the shares from machine1 when browsing machine2? Where do I even begin to look for clues?
Netatalk 2.0.4 and above supports encrypted authentication (which was the whole point of going through the mess of building with OpenSSL) out of the box with dhx2. If you want to get 2.0.5 installed on your Ubuntu machine, you can either wait for Ubuntu 10.04 Lucid Lynx, or do the following:
1. Add “deb http://us.archive.ubuntu.com/ubuntu/ lucid universe” to the end of “/etc/apt/sources.list” (or use the Software Sources applet)
2. sudo apt-get update
3. sudo apt-get install netatalk (This will install netatalk 2.0.5 from the Lucid universe repository)
4. Make sure that your “/etc/netatalk/afpd.conf” doesn’t override the default, so remove the last uncommented line if you followed this guide previously, or otherwise ensure that “uams_dhx2.so” is listed.
5. sudo /etc/init.d/netatalk restart
6. Finally, you need to remove any .AppleDB folders from your shares. These folders might be hidden in Nautilus, so you may need to do this from the CLI.
hey guys, gotta problem with this sparsebundle thing. i have a ubuntu 8.04 machine and a snowleopard mbp. i can access the hard drive on my linux machine but if u want to start time machine it shows me error 45. ok, i know i am not the only one here
but i just dont understand the answers…
ah damnit, maybe i missed the answer in this huge thread
i found something in this minute what i missed when i wrote the previous comment. maybe i can handle it by myselft
Okay, to install netatalk 2.0.5 on ubuntu 9.10 here’s what I did…
first add a new source in /etc/apt/sources.list
deb http://ftp.uk.debian.org/debian squeeze main
(or whatever your local version is – e.g. replace uk with de, etc)
go into synaptic and reload, the you should see netatalk 2.0.5.
Select this THEN
select libgcrypt11 (this is now the version that netatlk was compiled against)
click GO…
Set up netatalk, etc. Happy file serving
Hi Guys,
For setting it up with the latest netatalk 2.0.5, I put a procedure up on my blog here:
http://sidikahawa.blogspot.com/2010/03/setting-up-time-machine-server-on-my.html
(please don’t hate me for putting adsense on my blog, I am just trying it out for a short while).
Aleem.
Aleem,
Thank you much for this blog, it saved me a huge amount of time and worked great.
no worries, matt. glad it helped.
Hi there,
I have one Mac running TM just fine thanks to this fine tutorial, first with netatalk 2.0.3 on Debian Lenny, and then with netatalk 2.0.5 on Debian Squeeze (the latter I didn’t need to compile).
Another Mac, however, “can’t mount the volume” (Console: com.apple.backupd[2536] NetAuthConnectToServerSync failed with error: 80 for url: afp://alfredo@10.0.1.10/TimeMachine, but nothing out of the ordinary on the server side). I have tried everything and then some: Re-created everything from scratch, changed permissions around, afpd options, etc. The Mac that works worked well with 2.0.3 and is working fine with 2.0.5, no fuss; the one that does not never worked with either.
Both are running Snow Leopard, both have the latest patches, the same configuration and run on the same network.
The Mac that doesn’t work can mount the volume just fine, and I can choose it in Time Machine preferences. It just can’t use it when the time comes to mount it to do the backup.
The only difference is that the one that doesn’t work is new, while the other is about a year old.
Any ideas appreciated.
Alfredo, anything interesting in /var/log/daemon.log on the server when the mount is unsuccessful?
check for some kind of PAM_Error: Authentication failure perhaps? And tell us what it is..
Hi aleem.sidi, thanks for your comments.
Unfortunately nothing of the sort. This is what happens on the server when I tell the Mac to do a backup now:
Mar 17 18:32:33 u5 afpd[26093]: ASIP session:548(5) from 10.0.3.23:52118(7)
Mar 17 18:32:33 u5 afpd[24809]: server_child[1] 26093 done
Mar 17 18:32:34 u5 afpd[26094]: ASIP session:548(5) from 10.0.3.23:52119(7)
Mar 17 18:32:34 u5 afpd[26094]: DHX2 login: alfredo
Mar 17 18:34:09 u5 afpd[26094]: 0.56KB read, 0.42KB written
Mar 17 18:34:09 u5 afpd[24809]: server_child[1] 26094 done
I guess that, together with the fact that another Mac works flawlessly with the same server, puts the trouble firmly on the Mac side. But it’s a new Mac, and the only slightly “off-limits” configuration has been “defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1″ (which it does).
I ran out of ideas, currently scratching my head.
Hmmm… mine looks more like this:
Mar 17 15:04:57 sidi-desktop afpd[4498]: DHX2 login: aleem
Mar 17 15:04:58 sidi-desktop afpd[4498]: DHX2: logincont2 alive!
Mar 17 15:04:58 sidi-desktop afpd[4498]: PAM DHX2: PAM Success
Mar 17 15:04:58 sidi-desktop afpd[4498]: DHX2: PAM Auth OK!
…then it does a bunch of things (writes/reads etc)..long before it says server_child 4498 done.
I would compare the output with the Mac that is working. Perhaps remove and re-mount the volume in time machine to supply the correct credentials (or erase the credentials in your keychain on the new mbp)
hey folks, now its me again
i have the problem. the backup starts but after a while i get a kernel panic on my macbookpro. i have a linux machine 8.04 with esata and the partition where i want to backup my mbp has reiserfs as format. any ideas or hinds?
@Thomas
I had a kernel panic everytime i tried to browse some specific directories.
In fact, it was a problem related to the option “usedots” that i applied on the volume after the volume was created.
It leads to the Kernel Panic because the Finder was trying to access a “usedots” directory which was not in fact.
In future, for problems like this, just subscribe to the netatalk mailing list. Guys there are very friendly and it is very interesting to see problems which can occurred…
Thanks Aleem, everything went very smooth. One question though. My understanding is that clicking the arrow in Time Machine should fly you back to a spot where the folder changed. It seems that when I try this, the folder contents often appears the same. I’m assuming hidden files are changing. Is this normal? I would think TM should ignore changing .DS_Store files.
Hi Dan,
According to the apple website “Time Machine saves the hourly backups for the past 24 hours, daily backups for the past month, and weekly backups for everything older than a month.” So I guess this means pressing on the back arrow, should take you to the hour before, whether or not anything changed. This doesn’t mean any more space was used up on your backup disk, just that this was a snapshot of your machine an hour ago.
Maybe I wasn’t clear, it’s kind of hard to describe.
at 37:50 in the link below, you see him use the arrow to jump back to where the folder changed. However when I try this, it sometimes only goes back a folder or two where a hidden file such as .DS_Store changed. For example, The .DS_Store on my desktop is modified almost every time the backup is run, so the arrow only goes back one. I would assume that it should go back until it finds a VISIBLE (not hidden) difference. I don’t have an external drive to test if TM does this with a local drive. So I don’t know if this is the normal behavior of TM, or if there is a problem with networking / netatalk.
http://stream.qtv.apple.com/events/aug/wwdc_2006/m_wwdc_2006_650_ref.mov
@Dan:
I’m noticing the same behavior on my TM. Pressing the arrows sometimes takes me to the very next folder, where there are no noticeable changes (Desktop), or sometimes it skips through a series of dates.
I’m wondering if it’s a TM bug or an implementation issue with Netatalk, Ubuntu, the Apple SparseDisk image, or anything else.
This appears to be the normal functionality. I just tried it on a local partition.
Dan, I see what you mean.. Well if this is the way it works, then this is good news. So, it appears that when going back in time, it doesn’t necessarily go to the next folder where a “visible” file changed, but to a place where any file “visible or not” changed. Like the .DS_Store files for example.
Hi, Idiot here: I tried to follow the Guide on Ubuntu 9.10 (Netatalk-Section didn’t work out as described, I just did apt-get install netatalk…) and ran into a problem: I couldn’t connect from my mac, it kept saying “username or password wrong”.
I finally commented this line “- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh” in afpd.conf – and could connect again.
What does this line do? What could be the reason I couldn’t connect?
Any thoughts on how to get this to work with iMovie ’09. Apparently iMovie ’09 requires external hard drives to be formatted HFS+ to be able to use them to store events on. Seems like there’s got to be a way around this.
Any ideas?
Actually, to clarify my above question. iMovie seems to be perfectly happy if I “shortcut” to the ubuntu share from within my “Movies” folder. iMovie’s organization of its event library is pretty strange. You can really only specify physical devices. As a result, it thinks its using the system hard drive even though the event library and project library live on the Ubuntu server, accessed via the shortcuts I mentioned above.
What this means is that I can’t add event library storage to my actual system hard drive because iMovie thinks its being used. The Ubuntu network volume share shows in the list of devices but it has the little yellow exclamation mark next to it.
Pretty strange. It would seem that by using the shortcut, you can circumvent the HFS+ requirement but you basically eclipse the system hard drive in the process.
The reason I’d like to do this is to manage an archive of older events on the Ubuntu machine and more local active event library on the local faster hard drive.
Any thoughts?
Mike
Current issues: avahi not displaying AFP sharing to OS X, when I am running it together with samba on same machine, and only that service is showing in the Sidebar of Finder…I can still connect to my AFP share trough Go–>Connecto To Server
How I can fix that??
disable samba?
I am using samba too, so to turn off the service is not opton for me
For me it seemed do be enough to start avahi-daemon after netatalk. To try, restart avahi manually. To fix it permanently, adjust the order, services are started in Runlevel 2,3,4 and 5 by renaming the symlinks in /etc/rc2.d to rc 5.d from S20-avahi-daemon to something like S55-avahi-daemon (Ubuntu 9.10).
Haha, Got it going,
1. Ubuntu 9.1, apt-get install netatalk (2.04beta), avahi etc, follow instructions.
2. Apply Mac patch for TM
3. Create the sparsebundle file on desktop and move it to share. e.g._.sparsebundle
4. Simplified sharename for netatalk
Note: I found that Time Machine didn’t like my network share name “TimeMachine – iMac”, so I simplified it to “TimeMachine1″ and it worked.
What a lot of work, just to work around bad MAC software :-/ Sheesh, Thanks to tsanga and krema for your good helpful posts.
You know all that the instructions in the above post, or no longer relevant.
You just need to search for a distro that supports the netaalk 2.0.5 package. In my own case, I’ve used Debian Squeeze (testing), which contains the 2.0.5 version right into the repo’s.
There’s no need to manually compile netatalk for SSL support and time machine functionallity. Just do a apt-get install netatalk and you’re set to go.
fix for avahi and vino as the vnc server
https://bugzilla.gnome.org/show_bug.cgi?id=561123#c2
The operation can’t be completed because the original item for “________” can’t be found.
This problem is also caused if you have a folder with exisiting .AppleDB/ folder in it. For example you had the same folder shared under an existing AFPD system. (I moved my raid from opensuse to ubuntu)
Just delete the .AppleDB/ folder inside the effected folder fixed it for me.
Hello,
I have been using my Ubuntu server for over a year now. I now have a 12 drive , 16 TB media server. My biggest issue is that I can not get the individual drives to show up on my Mac. I have had to make alias folders and drag their images to the main drive. What steps do I take to get all the drives to show up on my Mac?
Thanks
Mike
I’m not sure that I understand the question.
But here is part of my setup: (Ubuntu server)
From /etc/fstab:
/dev/sda1 /NAS/xdisk1 ext3 auto,defaults 0 0
(mounts sda1 at mountpoint /NAS/xdisk1)
Directory permissions for /NAS:
drwxrwxrwx 4 root root 4096 2010-04-11 00:22 xdisk1
ie: chmod 777 /NAS/xdisk1
From /etc/netatalk/AppVolumes.default:
/NAS “NAS@xerxes” allow:user1,user2 cnidscheme:cdb options:usedots,upriv
With this setup, user1 can log into the server (in my case “xerxes”) and will see “NAS@xerxes” as an available volume on their Mac.
Hope it helps,
Michael
mlongval@gmail.com
Hi there,
My MacBook Pro is able to access and write files flawlessly to the time machine area, and seems to complete the initial backup alright.
I’m having a big issue though- every time it goes to do the next sequential backup, it over writes the first initial backup with a new initial backup.
Any ideas?
Thanks!
Wow great tutorial. This saved me a bundle since I was thinking about purchasing a Time Capsule.
Hello,
First of all – thank you for the tutorial. It is huge work and everything explained perfect.
I have Snow Leopard and it sees my volumes on Ubuntu 8 (64 bit).
The problem is:
1. I have TimeMachine folder mounted under Volumes on the Mac machine .
2. As soon as backup starts I see bob.tmp.sparsebundle (no mac address inside) created and starts growing.
3. In addition to the TimeMachine folder (under user bob and group bob) my Mac creates folder TimeMachine-1 (under Volumes) under user root.
4. On some stage when bob.tmp.sparsebundle reaches 300 Mb Mac tries to copy the file from TimeMachine to TimeMachine-1 and fails saying “Cannot create /Volumes/TimeMachine-1/bob.sparsebundle”.
- I do see the TimeMachine folder on my side bar of Finder.
- I am able to connect to server and mount the volume.
- My Mac is able to create temporary file and continue writing to it.
I just do not understand why it has to go back to some root folder while the Macintosh itself is logged under Bob.
It would be great if you could help.
Thank you.
PS. I can still copy files to the shared space performing kinda backup, but I wanted to use the Feature.
Thank you.
Andrey
WHY? You’re wasting a perfectly good and much more powerful operating system to be a backup system for a CRIPPLED OS?
How about doing it the other way around so you’re not wasting the use on something that has a lot more software and features than OS X. Have the worthless Mac hold the backups.
Or better yet, how about NOT wasting well over $1500 on a Mac and just buy an external hard disk for cheaper. You’d get more use from that hard disk than you’d ever get from a Mac.
More to the point why have an angsty rant that is only (very) tenuously related to the post’s topic?
This is useful for people who like Macs (believe it or not, there are quite a few of us) and who have a Linux server which we would like to use to back up because a TimeCapsule is a rip off.
There are other fora for you to express your opinions, this is not one of them.
I just wanted to mention, that you don’t need to do the “ShowUnsupportedVolume” anymore, at least with netatalk 2.0.5 (lucid). Just add “tm” in the options for your share in /etc/netatalk/AppleVolumes.default so you line reads like:
/Path/to/share Name options:usedots,upriv,tm
Restart the netatalk service, mount the share, go to your TimeMachine settings and your good to go!
Great Howto, thanks!
It is possible to let avahi announce its’ TimeMachine share so it behaves like a TimeCapsule with the following lines in /etc/avahi/services/afpd.service:
_adisk._tcp9
sys=waMA=XX:XX:XX:XX:XX:XX
dk2=adVF=0×83,adVN=TimeMachine,adVU=8f8e20e6-f027-4e45-9a7c-e090c89da36d
where XX:XX:…:XX is your servers MAC-address, the value for adVN the name of your share and the value for adVU a random UUID (just generate one with uuidgen -t). Save the file, restart avahi-daemon, got to time machine preferences on your mac (you don’t have to mount the share anymore!!) and select your share!!
(From http://forum.ubuntuusers.de/topic/netatalk-2-0-5-time-machine-support/2/)
If it doesn’t show up you need to create a file in the root of your share named ‘.com.apple.timemachine.supported’ (create it with ‘touch .com.apple.timemachine.supported’)
This way you even can restore your system completely from the installation disc without the need to mount your remote share anymore…
I just want to make a note for all people trying this. The MAC address put in “computername_xxxxxxxxxxxx.sparsebundle” should be the MAC address of your ethernet device, NOT your Airport (en0) device.
Even though I back up 2 MBPs over Airport, it appears that TimeMachine expects this.
Thanks for the guide Krema, it worked great. I only encountered one problem on Snow Leopard, which has been mentioned in the comments section several times: Error 45. The following guide walk me through it and worked on my first attempt, hope it helps everyone else as well:
http://www.macosxhints.com/article.php?story=20090905212640957
“More to the point why have an angsty rant that is only (very) tenuously related to the post’s topic?”
It wasn’t off-topic at all. I was pointing out exactly what a waste of a perfectly good Linux PC you got going just because you don’t have a mind to spend money on something of actual worth, like an actual PC. The one PC you have you’re wasting on a simple file server.
“This is useful for people who like Macs (believe it or not, there are quite a few of us) and who have a Linux server which we would like to use to back up because a TimeCapsule is a rip off.”
I don’t deny there are Mac users. I never did. I do deny anyone actually gets anything useful from a Mac for a reasonable cost. And again, you’ve got that overpriced a wannabe PC that doesn’t do half the crap an actual PC can do. You’ve got one of the most powerful system distributions running a file server that could probably do more as a desktop than your Mac, yet you’re wasting its potential serving file systems to a Mac. Good grief.
“There are other fora for you to express your opinions, this is not one of them.”
Uh. You know. Comment sections ARE meant for opinions. Way to miss the entire point of them.
Or did you mean “comments you don’t personally like?” That’s probably what you meant. Most Apple/Mac bloggers hate when someone actually chooses not to parrot their opinions. News flash. You don’t like peopls disagreeing with you, then don’t go public. Just because it clearly bothers you, I’ll say it again:
You’ve got a more powerful more useful operating system that does fifty million times more things than crippled old OS X. And yet you use it almost purely just to service an operating system that does little more than sit on your desktop and look pretty. Not one for practicality, are you?
I’m thinking you meant mac hater forums where you don’t have to read about someone not blindly loving Macs.
@Yaro Kasear
Hello, I’m one of those people who have a Mac and love Linux.
I do see the point of having Linux serve AFP & Time Machine just because activating it doesn’t cripple the server as a whole but it enhances it: you can still serve http, ftp, database, torrent, tor, proxy, you name it AND AFP. It is just another service running on the same machine.
And if that machine is a 100$ plug computer like pogoplug or such I think it is a perfect fit even if there are none or little more services (it costs less than a time capsule).
Just my 2 cents, but I do agree that your rant is quite off-topic.
Regards,
Riccardo
First off, thanks for putting this page together, it’s an immense help.
Second, on to my issue…
I have a shared directory being served up by Samba and Netatalk on Ubuntu 9.10.
My Windows clients can copy directories and files across no problem. My Mac clients will start a copy and then have it fail with a message akin to, ‘You do not have the proper permissions on some of these files to continue copying…’
The Mac clients can browse, open, etc.
Any help would be appreciated, thanks.
JimQ – I had this issue after going through the guide and found that if you remove upriv from your shares this error goes away. I’m not sure what the side effects of doing this are yet, as I haven’t looked too far into it. Even the man pages say to read up on it before you enable it. My guess is that Snow Leopard tries to set something on the file that Netatalk 2.0.3 doesn’t support.
just wanted to say many thanks for the clear instruction and extremely helpful work!
cheers!
FYI, for Ubuntu Lucid Lynx the netatalk package rebuild command should be:
sudo DEB_BUILD_OPTIONS=openssl dpkg-buildpackage -rfakerootHey, this was extremely useful! I got it working on my debian Lenny server and my macbook. Works like a charm for more than six months now.
However, I seem to have a problem with my mac mini running snow leopard server. I entered the “defaults write etc” code, but my time machine share on the debian server still doesn’t show up! Is this a known problem with OSX server, or does it need another trick? I haven’t got a clue…
Just upgraded to 10.4 and ran into a little glitch that I thought I’d share. When I tried to connect to my linux server where my time machine drive is located it would connect but it wouldn’t mount.
After reading through the forum the fix was a simple one…apparently with the file “.AppleDB” there is a mismatch between 9.10 and 10.4. To resolve the issue you must simply delete this file in all the directories you made available in the file “AppleVolumes.default”. If you have your time machine directory in your home folder then you must do the following:
cd ~/TimeMachine
rm -r .AppleDB
When you connect again it will recreate this file under the 10.4 format and you will be able to connect.
Hope this helps.
Note that you do not need to follow this guide if you’re on Ubuntu 10.04 LTS. It already comes with encryption support, and even Time Machine support.
I just clean installed a copy of Ubuntu 10.4 ‘Lucid’ and followed the procedure above.
I found my afpd.conf had to have the following, otherwise it would refuse to accept my password:
- -transall -uamlist uams_randnum.so,uams_dhx.so,uams_dhx2.so -savepassword -advertise_ssh
Also I’ve not set this up for TimeMachine yet but in the AppleVolumes.default configuration file for the version that come down with the Lucid package there’s a comment:
# miscellaneous options [syntax: options:option1,option2]:
# tm -> enable TimeMachine support
Oh alright, I see comment #638 … ooops!
So with 10.04 how do I get ubuntu to show up in my finder like previously?
Right now I have a clean lucid install, and I can connect via SMB, but when copying files to lucid, it stops after a while telling me I have no access.
9.04 did the same until I followed this guide and turning it into AFP.
It turns out to be pretty simple to make the netatalk package that comes with Ubuntu 10.4 work without doing anything more than installing the package and configuring AVAHI to announce the afpd service. I wrote a simple blog post on how to do it at http://blog.ibd.com/sysadmin/bonjour-avahi-netatalk-to-share-files-files-between-ubuntu-10-4-mac-os-x/
Very nice tutorial thx for it.
But I have a problem. I’m trying also share folders between Mac and I added the following line in the
/etc/netatalk/AppleVolumes.default
/home/usr1/Downloads Downloads allow:usr1 cnidscheme:cdb options:usedots,upriv
But when I’m trying to connect from my Mac I can’t it says invalid username or password
I removed the following and it works
- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh
Is there a 2.1 package for Ubuntu 10.04 yet? I can’t find one, but we really need one.
Hey, guys – Good News!
There is a netatalk 2.1-1 package for Ubuntu available!
Link: https://launchpad.net/ubuntu/+source/netatalk/2.1-1/+build/1728958
Just download the *.deb, uninstall your previous 2.0.5 Package, and install this one. You should keep your own config-files (just press “Enter” when asked, or “keep”).
Finally, we can limit the reported size of a Volume (VERY useful for TImeMachine!) and get extended attributes support.
Also, don’t forget to delete all your *.AppleDB-Files using this command:
find -H / -name .AppleD* -exec rm -rf {} \;Have fun!
@Denmaru
I set up netatalk using Sidi Kahawa’s method, http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/
Now, I tried netatalk 2.1, it breaks the AFP erver and I had to revert back to 2.05. Should I clean up the dependent packages too?
Robert J. Berger: I followed your instructions – and it works perfectly!.
Only think I kinda need now is that when I start my Mac I need it to connect to my ubuntu server automatically, so that I dont have to do it manually to keep the server “alive”.. I think this would be to automount it, but I am not sure what this is called.
That’s easy:
System preferences (“Systemeinstellungen”) –> Users (“Benutzer”) –> Login Items (“Anmeldeobjekte”).
Just drag and drop your mounted Volume into the list.
Thats it.
Does the 2.1.deb package include encryption?
Yes, it does, and it works out of the box.
Indeed i tried in a VM
volsizelimit is very very usefull option.
Hey,
Does anyone know how to handle two of those Ubuntu servers on 1 network?
My mac sees both servers but I can only connect to one at a time. Staying connected to both servers is not possible. Connecting to server A shows the content of server A, but when connecting then to server B it shows the content of server A … and vice versa the same annoying thing!
Already tried with different username, different port numbers, …
Help!
Nope, sorry. Whenever I build a server for a client, I end up shutting down mine.
Anyone else any ideas?
I compiled and installed netatalk 2.1 on ubuntu server 10.4. everyhing works, I can make my time machine backup, I can mount shares, but I always get a messege when I mount a share or the time machine on my mbp (10.6.3)
“something wrong with the volume’s DB … FIXME with a better msg”
I also should mention I use pathfinder instead of finder. in finder I can’t mount shares, but I can mount the time machine sparsebundle. but that’s fine.
I just wanted to contribute with my experience:
I was getting “Connection failed” and what I found in the console log was something like afp error 5014 mapped to EIO.
Then, from here: http://discussions.apple.com/message.jspa?messageID=11292093
I read the problem solved by deleting all “.Apple*” files in shares. So I did and then everything worked again.
I was setting up a new server the other day and followed your post to setup netatalk and avahi for sharing to my macs from the ubuntu machine. All worked great till I was using the wifi.
When I plugged in the machine to the ethernet port on my router and disabled the wireless, to my absolute surprise the avahi advertised services would just keep disappearing after 3-4 mins, unless I restarted the service.
Of course, my first solution to this was a small hack to create a cron job to restart the avahi-daemon every few minutes, but this is not ideal.
It turns out that the problem has to do with multicasting and some network card drivers may lead to this issue. The solution in my case was to turn on promiscuous mode on eth0 and voila, everything works. Its been 3 days now and I have even accessed the server through the internet. All rock solid!
In Ubuntu 10.04LTS the build command has become:
sudo DEB_BUILD_OPTIONS=openssl dpkg-buildpackage -rfakeroot
Thanks for this great documentation!
So, I too got the “Connection Failed” message. To remedy it I changed afpd.conf to allow for Allow Diffie-Hellman eXchange 2 (DHX2) for authentication. My afpd.conf now looks like this:
* There are also some other tweaks. But uams_dhx2.so is essential for my setup. My setup:
OS X 10.5.8
afpd 2.0.5
Anuj:
I have the exact same problem.. Can you please guide me to turn on promiscuous mode on eth0 ??
Hi.
I followed your tutorial but could not mount the AFP share on my macbook. The ubuntu server is running 10.04LTS and the client is a 10.6.3 “Snow Leopard”.
The server shows up in finder but it doesn’t display any folders.
If I try to mount the share on the terminal I get
“mount_afp: AFPMountURL returned error -5002, errno is -5002″
Any thoughts?
#nrsgzz
you do not need all steps for Ubuntu 10.x … netatalk luckily fixed the stuffs
so all you need to do is..
sudo apt-get install netatalk avahi-daemon libnss-mdnsthen edit mount volumes in
sudo gedit /etc/netatalk/AppleVolumes.defaultconfigure avahi in
sudo gedit /etc/avahi/services/afpd.serviceand add mdns in /etc/nsswitch.conf as explained in article.
I used the config from above, though i call the server macpro
and everything else went great
I can confirm that this article has become obsolete for the most part. Just installing Netatalk, Avahi and mdns from Ubuntu repositories is all you need. The only manuel steps are adding your share in Netatlak and configure Avahi. Setup is done in under 5 minutes. Works not only in 10.04 but also in 9.10.
Thanks for such a well written guide!
I’ve got AFP running on two Ubuntu 10.04 computers which work fine, but experience the same issues as Davy (posted May 14 2010)
My shares for the two computers:
host: mythtv
share: home-mythtv
host: seedbox
share: home-seedbox
share: seedbox1tb
if I mount a share from seedbox, the same shares are listed when I try to view the mythtv shares. So mounting from two ubuntu computers simultaneously is not possible. To get to the shares from the other host, I need to unmount the current share first.
Would really appreciate any help! Thanks.
Did some more digging and found a fix to my issue above. Posting here in case others wish to achieve something similar.
If you have multiple linux afp servers on the same network, and want to mount shares from each host at the same time, you must add this line to /etc/netatalk/afpd.conf on each server:
[code]
-signature user: | hostname
[/code]
for example, on the host “mythtv” i have
-signature user:mythtv | mythtv
and on the host “seedbox”
-signature user:seedbox | seedbox
user: must be different on each machine.
Hope this helps.
Thanks for this guide. It deserves its place at the top of the search results for linux time machine! I hit it up every time I set up a new system.
This guide is definitely still good information for Debian, which does not ship with ssl-enabled netatalk out of the box.
I had this working for 1 night, then I wake up the next morning and try to access the the server (AFP) via the finder and I get a message that states: “Your password has expired..Please contact the system admin for details.” Could you help me on this issue. I am new to linux, so I am not sure what is going on. I have already used some terminal commands in Ubuntu to ensure that my password is not set to expire!
For those who use samba along side this, adding this to /etc/samba/smb.conf makes the file content identical to what the Mac sees:
veto files = /.*/:2*/TheVolumeSettingsFolder*/TheFindByContentFolder*/Network*Trash*Folder/Temporary*Items/
what do i put under the username1 and username2 line???
i know it says “By adding the following line you will share each users home directory with the user name as the” but i dont get it
Thanks for the article!
I have 1 problem thou. I use the Puneet Madaan method.
I have 4 drives (1 1.5TB and three 300GB) in the Ubuntu box. I see all shares on my Mac but only the 1.5TB drive i can open and work with. When opening the other three drives i get a error message that the original item is not found? Can someone please get me on the right way?
Thanks!
Thanks for this great guide! I am unfortunately having a problem I can’t seem to figure out.
everything works great for my admin user on my ubuntu server, but additional users I can not get any shares besides their default home share to show up when they log onto the file server.
example:
"media/Big Disk/music" "music" allowed:admin_user,regular_user cnidscheme:cdb options:usedots,upriv
the sahre “music” shows up just fine for admin_user but not for regular_user.
any suggestions?
thanks
Jonny
Just switch to fedora after an abortive attempt to upgrade to 10.04 on a new server. Basically you follow the same process as Ubuntu 10.04 with the following changes
replace apt-get with yum
Fedora Core 13 already has avahi et al installed
Just install netatalk
yum install netatalk
the netatalk config files are in /etc/atalk with the same names.
the init.d stuff has different commands
to add netatalk etc to the start up
chkconfig atalk on
chkconfig –list | grep talk
atalk 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Had to delete the .AppleDB folder (again).
Also had to do chown -R USERNAME:GROUPID TIME_MACHINE_DIR
Since uid/gid changed from 1000 to 500 on the new machine.
I have one problem I don´t find a solution to. I have two users on the ubuntu machine (Ubuntu 10.04). Two lines of text in AppleVolumes.default. The two lines are identical exept they point to the two different users. Each user has a separate TimeMachine folder (named TimeMachineUsername).
The problem is that we can both log onto Ubuntu, but only one of the users see the TimeMachine folder. The other user only sees the home folder. What can it be?
Does anyone know how I would share an entire hard drive? I have a 1TB drive that I would like to be accessible on my mac. I am unsure what I need to put in the AppleVolumes.default file. Any suggestions?
Dear friends,
I think it worths to tell my story here. I really enjoyed reading this tutorial and comments last year when I tried to make a FreeNAS server (not a Ubuntu Server as mentioned here) with Time Machine. It didn’t work unfortunately. It was really unstable and, for it purpose it didn’t worth.
This year I decided to buy a Time Capsule and I must say that it worths its price here in Brazil. I should only warn you guys to UNDO THE TERMINAL CHANGES BEFORE YOUR FIRST BACKUP (it’s the “defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1″ command, you only need to change “1″ to “0″ (zero) back).
I had a f&#$ng headache because I forgot that I had done this last year. If you don’t change this, Time Machine WON’T BACKUP and will flood your screen with a thousand of SVN (subversion) problem/errors messages.
In my first time, I messed it up so much that I had to open (physically) my Time Capsule and erase my disk. I just start thinking that it was a problem on my Macbook after I tried to make a Time Machine on my Mac Mini and it worked flawless.
So please, remember to set the configs to default if you buy a Time Capsule.
Great article, it is super detailed! Thanks! One question, what if I don’t want to use usernames and have the shares open for everybody in the network? How can I do this?
Any ideas would be welcome.
I recently built a new Debian box to run as my home server replacing an older machine I had the same setup on. Here are some notes about things I’ve learned this time around…
- More current versions of netatalk (Anything 2.0.5 and later) no longer support masquerading symlinks as actual files/directors in order to satisfy some Apple spec. Kind of sucks. The symlinks will act just like normal symlinks would in the *nix world, as a pointer to something else, so if /media/drivename/timemachine exists on your mac, then you’re in luck. You can use a relative path for the symlink and make sure the path is valid through the AFP mount, that works fine.
- Running OSX 10.6.4 and Debian Squeeze, Time Machine didn’t barfing when a disk image wasn’t present with it’s own machine ID.
Other then that, gigabit ethernet makes the medicine go down faster.
Thanks for the awesome guide, worked like a charm on Ubuntu 10.04 amd64 jumping in at 2. Configuring.. using default packages
One little suggestion, use
options:usedots,uprivat the end of the
~/ "$u" allow:username1,username2 cnidscheme:cdbline, so it reads
~/ "$u" allow:username1,username2 cnidscheme:cdb options:usedots,uprivThis avoids (very ugly) :2eDStore files everywhere when you open you home folder over netatalk.
Thanks,
John
I have used this tutorial numerous times. However, I did manage to have this done on a FreeBSD headless box. I don’t want any X11 libraries on this box. You can do this by adding the following to /etc/make.conf:
WITHOUT_X11=yes
Hi there.
This article is great.
Thanks to you I am now running 10.04 ubuntu with netatalk and avahi. Performance is great across a 12 drive raid 6 array.
The way I’m working is creating a user on the ubuntu server when I need to create a new share for somebody. This might be messy, but it does mean I don’t have to restart netatalk each time I need to create a share.
The remaining question I have yet to find an answer to is how do I limit the number of people who can connect to an individual share concurrently?
Do you know if this possible?
I suppose I am looking for a function similar to the ‘max connections’ in samba.
If you add the following service to avahi, then you don’t have to tweek the Time Machine settings as indicated in the article.
%h (TimeMachine)
_adisk._tcp
9
Well, my previous comment didn’t look too good …
This how it should look:
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h (TimeMachine)</name>
<service>
<type>_afdisk._tcp</type>
<port>9</port>
</service>
</service-group>
Like Semmi (#650) I get
“something wrong with the volume’s DB … FIXME with a better msg”
but it seems to be the only way I can get my ubuntu box (actually running Xubuntu 10.04 LTS) to talk to my wife’s MacBook running OS X 10.5.8, or vice versa.
I’ve tried using cnidscheme:dbd and I don’t get the message but the MacBook doesn’t seem to be able to properly connect to the Linux box – it eventually appears to have connected but trying to browse files in the Finder or open Time Machine Preferences just leaves a Spinning Beachball and then the volume seems to unmount from Finder.
Going back to cnidscheme:cdb I’ve been able to back up fully using Time Machine, it all mounts properly but I get the aforementioned message popping up every now and then. And still the volume seems to spontaneously unmount when it’s been idle for a while.
I’d appreciate any advice anyone could offer. I’m considering adding the command to restart avahi to cron on the Linux box, it seems to be the only way to remind the MacBook that the shared volume is there!
Thanks for creating this. I just tried this with my 10.04 desktop and OSX 10.6.4. I followed the install instructions to the letter and did not have one problem.
Hi there!
Thanks alot for the manual – now my xbmc box drives are on network %)
I have one problem: I have a hfs+ 1Tb drive connected be ESATA to my Ubuntu 10.8 box. It is mounted to /media/TV-Shows.
When I’m adding it to AFP share I can easily see it from my mac but I can not write any files to it – finder says I have no permissions, but I’m connecting to AFP share under the root of Ubuntu system.
Anyone knows how to fix it?
Linux cannot write to HFS+. Format it using ext3, and you should be fine.
Alternatively, check your /etc/fstab.
That’s not completely correct; linux can write non-journaled Hfs+ volumes.
It is supported in the kernel, so I think no additional package must be installed, only hfsprogs if you need to format HFS+ partition in Gparted.
Can someone provide me the exact syntax to mount the TimeMachine volume, via terminal, on my Mac.
For the firewall, you have to open ports 548 and 5353 in TCP AND UDP, INPUT and OUTPUT
If, you use Iptables, add these lines :
iptables -t filter -A INPUT -p tcp –dport 548 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp –dport 548 -j ACCEPT
iptables -t filter -A INPUT -p tcp –dport 5353 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp –dport 5353 -j ACCEPT
iptables -t filter -A INPUT -p udp –dport 548 -j ACCEPT
iptables -t filter -A OUTPUT -p udp –dport 548 -j ACCEPT
iptables -t filter -A INPUT -p udp –dport 5353 -j ACCEPT
iptables -t filter -A OUTPUT -p udp –dport 5353 -j ACCEPT
Hi, I am also trying to get Time Machine to backup my iMac to my Ubuntu 8.04 computer on the same network. What you suggest as a fix, is waaaay beyond my technical ability. All I know is my Ubuntu computer is running samba, and the imac sees it that way. Time Machine won’t backup to Ubuntu. Is there any way you could make this fix easier for us “non-genuises”? Like “Click Install this program on Ubuntu” and it would fix this Time Machine problem? I would personally be willing to pay a donation for a way to fix this.
Return Privacy: one more comment. The other part of this posting that I followed is the section describing how to create a TimeShare volume on your Ubuntu machine.
It seems with my latest Ubuntu 10.04 afpd/netatalk launches after avahi-daemon which screws things up. If I do a restart of avahi-daemon, everthing looks and works correctly.
Since avahi-daemon is now an “upstart” job, I don’t see how to coordinate when it launches relative to when afpd/netatalk launch (which isn’t an upstart job).
Any wisdom on how to coordinate these two daemons?