Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: HOWTO Use Ubuntu As A Mac OS X Time Capsule

  1. #1
    Join Date
    Aug 2008
    Location
    Arizona State
    Beans
    419
    Distro
    Ubuntu

    HOWTO Use Ubuntu As A Mac OS X Time Capsule

    Preface:

    In past versions of Mac OS X, the built in backup tool, Time Machine was a lot less picky about where you back up your files to. You could even back up to a Samba file share if you enabled the "unsupported volumes" hack.

    Code:
     defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
    But that ended with Snow Leopard. Starting with the release of OSX 10.7 Lion, Apple started cinching down on where you could back up your system to, ostensibly for security reasons. Now, with Mac OS X 10.8 "Mountain Lion", it's gotten to the point where essentially the only places you can back up your system using Time Machine are either on another Mac OS X File Server or on an Apple Time Capsule. My assumption is that their intent is merely to bolster their hardware sales.

    I don't know too many people who stay exclusively within the "walled garden" for all their computing needs. Certainly people with a lot more money to burn than me. But for a much more economical approach than shelling out around $300 for an over-glorified USB drive, you could just follow this guide to set up your Ubuntu file server to look and behave exactly like Time Machine would expect a real Time Capsule or Mac to.

    Step 1: Install Netatalk

    installing Netatalk, the open source Apple Filing Protocol (AFP) implementation is easy! The packages are already in the repos, which makes me wonder why it's not enabled by default.

    Install the following packages:

    Code:
    sudo apt-get install netatalk libc6-dev avahi-daemon libnss-mdns
    Step 2: Configure /etc/nsswitch.conf

    Once those packages are installed, there are actually 4 configuration files that need to be edited in order for the Macs on your network to access your AFP shares properly.

    Code:
    sudo nano /etc/nsswitch.conf
    locate the line that reads

    Code:
    hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
    and add 'mdns' to it so it now reads

    Code:
    hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
    press ctrl+o to save and ctrl+x to exit.

    Step 3: /etc/avahi/services/afpd.service

    Code:
    sudo nano /etc/avahi/services/afpd.service
    paste the following code

    Code:
    <?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=TimeCapsule</txt-record>
        </service>
    </service-group>
    NOTE: Just for fun you can change the string "<txt-record>model=TimeCapsule</txt-record>" to the following devices to change how they appear in Finder on OSX:

    • MacBook
    • Laptop
    • MacBook4,1,Black
    • MacBookPro
    • MacBookAir
    • MacPro
    • iMac
    • Macmini
    • AppleTV
    • iPhone
    • iPodTouch
    • iPad
    • Xserve
    • RackMac
    • TimeCapsule
    • PowerBook
    • PowerMac
    • AppleTV1
    • AppleTV2
    • AirPort

    Type them exactly as I have typed them. They are case sensitive. If you type the model name in wrong, your AFP share will show up as a Cinema Display in Finder. There are actually dozens more. Too many to list actually, but if you're interested you can find the name strings in /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist

    Step 4: /etc/netatalk/AppleVolumes.default

    This is where you actually declare your shared file.

    Code:
    sudo nano /etc/netatalk/AppleVolumes.default
    scroll down to the bottom and find the section that reads
    Code:
    # The line below sets some DEFAULT, starting with Netatalk 2.1.
    :DEFAULT: options:upriv,usedots
    
    # By default all users have access to their home directories.
    ~/                      "Home Directory"
    
    # End of File
    change the path "~/" (which points to /home/username) to the directory you want to share. For me I created a separate partition mounted at /TimeCapsule.

    IMPORTANT!!! You would be able to access the share from a Mac, but if you plan to use this share for Time Machine backup, you need to add 'tm' to options:upriv,usedots
    like this:

    Code:
    # The line below sets some DEFAULT, starting with Netatalk 2.1.
    :DEFAULT: cnidscheme:dbd options:upriv,usedots,tm
    
    # By default all users have access to their home directories.
    /TimeCapsule                       "Time Capsule"
    
    # End of File
    press ctrl+o to save and ctrl+x to exit.

    Step 5: /etc/default/netatalk

    this is the last file that you need to edit. Edit with

    Code:
    sudo nano /etc/default/netatalk

    find the section that looks like this

    Code:
    #### Set which legacy daemons to run.
    #### If you need AppleTalk, run atalkd.
    #### papd, timelord and a2boot are dependent upon atalkd.
    ATALKD_RUN=no
    PAPD_RUN=no
    TIMELORD_RUN=no
    A2BOOT_RUN=no
    and edit it so it looks like this:
    Code:
    #### Set which legacy daemons to run.
    #### If you need AppleTalk, run atalkd.
    #### papd, timelord and a2boot are dependent upon atalkd.
    ATALKD_RUN=no
    PAPD_RUN=no
    CNID_METAD_RUN=yes
    AFPD_RUN=yes
    TIMELORD_RUN=no
    A2BOOT_RUN=no
    That is all. Now you can enjoy making incremental backups with Time Machine without the hassle of manually mounting disks. I actually did this on my Windows 8 HTPC/Mediaserver using a very stripped down headless Debian virtualbox installation that runs at boot as a background service and uses only 64MB of RAM and paravirtualized bridged ethernet.




    Screenshot of my Mac backing up to the Debian virtual machine on my Windows 8 box.
    Last edited by N00b-un-2; January 20th, 2013 at 05:51 AM.

  2. #2
    Join Date
    Aug 2008
    Location
    Arizona State
    Beans
    419
    Distro
    Ubuntu

    Re: HOWTO Use Ubuntu As A Mac OS X Time Capsule

    Just in case anyone is interested, here is the complete list of icons and how to make your Ubuntu AFP shares take on that image. On OSX 10.7 and 10.8, there are only 8 monochromatic icons used (Laptop, Macmini, MacPro, iTouch, iPhone, iPad, iMac and Time Capsule) but if you use a hack like "Side Effects" on Lion or Mountain Lion, or if you are still on Snow Leopard or before, any of these icons will work for you. It's probably safe to assume that on Tiger or Leopard which are already past EOL there probably isn't support for a lot of the newer icons.



    Apple Cinema Display = Any invalid or blank string

    Airport Express = AirPort4 AirPort4,102 AirPort4,107

    Airport Extreme = AirPort Airpor5 AirPort5,104 AirPort5,105 AirPort5,108 AirPort5,114 AirPort5,117

    AppleTV = AppleTV AppleTV1,1

    eMac = PowerMac4,4 PowerMac6,4

    iBook G4 = PowerBook6,3 PowerBook6,5 PowerBook6,7

    Aluminum 20" iMac = iMac7,1 iMac8,1

    Aluminum 24" iMac = iMac9,1

    "Flower Pot" G4 iMac 15" = PowerMac4,2

    "Flower Pot" G4 iMac 17" = PowerMac4,5 PowerMac6,1

    "Flower Pot" G4 iMac 20" = PowerMac6,3

    Unibody G5 iMac 17" = PowerMac8,1 PowerMac8,2

    Unibody G5 iMac 17" w/ iSight = PowerMac12,1

    iMac 24" = iMac4,1 iMac4,2

    Unibody iMac 21" = iMac11,2 iMac12,1

    Unibody iMac 27" = iMac10,1 iMac11,1 iMac11,3 iMac12,2

    iPad = iPad iPad1,1

    iPhone = M68AP iPhone1,1

    iPhone3G = N82AP iPhone1,2

    iPhone4 = N90AP iPhone iPhone3,1

    iPodTouch = N45AP iPod1,1

    iPod Touch 2 = N72AP iPod2,1

    iPod Touch 4 = N81AP iPod4,1

    Black MacBook = MacBook1,1,Black MacBook2,1,Black MacBook3,1,Black MacBook4,1,Black

    White Unibody MacBook = MacBook6,1 MacBook7,1

    Aluminum Unibody MacBook = MacBook5,1

    White MacBook = MacBook1,1 Macbook2,1 MacBook3,1 MacBook4,1 MacBook5,2 MacBook1,1,White MacBook2,1,White MacBook3,1,White MacBook4,1,White

    MacBook Air = MacBookAir1,1 MacBookAir2,1

    MacBook Air Unibody 11" = MacBookAir3,1 MacBookAir4,1 MacBookAir5,1

    MacBook Air Unibody 13" = MacBookAir3,2 MacBookAir4,2 MacBookAir5,2

    MacBook Pro 13" = MacBookPro5,5 MacBookPro7,1 MacBookPro8,1 MacBookPro9,1

    Retina MacBook Pro 15" = MacBookPro

    Unibody MacBook Pro 15" = MacBookPro5,1 MacBookPro5,3 MacBookPro5,4 MacBookPro6,2 MacBookPro8,2 MacBookPro9,2

    Unibody Macbook Pro 17" = MacBookPro5,2 MacBookPro6,1 MacBookPro8,3

    Silver MacBook Pro = Laptop

    Mac Mini w/o Disk Drive = Macmini Macmini5,1 Macmini5,2 Macmini5,3

    Mac Mini w/ Disk Drive = Macmini4,1

    Old Mac Mini = PowerMac10,1 PowerMac10,2

    MacPro = MacPro MacPro1,1 MacPro2,1 MacPro3,1 MacPro4,1 MacPro5,1

    PowerBook G4 12" = PowerBook6,1 PowerBook6,2 PowerBook6,4 PowerBook6,8

    PowerBook G4 15" = PowerBook5,2 PowerBook5,4 PowerBook5,6 PowerBook5,8

    PowerBook G4 17" = PowerBook5,1 PowerBook5,3 PowerBook5,5 PowerBook5,7 PowerBook5,9

    Titanium PowerBook = PowerBook3,2 PowerBook3,3 PowerBook3,4 PowerBook3,5

    Graphite G4 PowerMac = PowerMac

    Quicksilver G4 PowerMac = PowerMac3,5

    Time Capsule = AirPort6 AirPort6,106 TimeCapsule TimeCapsule6 TimeCapsule6,106 TimeCapsule6,109 TimeCapsule6,113 TimeCapsule6,116

    XServe = RackMac RackMac1,1 RackMac1,2 RackMac3,1 Xserve Xserve1,1 Xserve2,1 Xserve3,1
    Last edited by N00b-un-2; January 17th, 2013 at 09:39 PM.

  3. #3
    Join Date
    Nov 2006
    Location
    Vienna, Austria
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: HOWTO Use Ubuntu As A Mac OS X Time Capsule

    For anyone interested in this How To, I can confirm that it is working on Ubuntu Server 14.04 LTS.
    Recommended Resources: Ubuntu Linux Resources

  4. #4
    Join Date
    Mar 2013
    Beans
    1

    Re: HOWTO Use Ubuntu As A Mac OS X Time Capsule

    I've used this how-to before on a different machine and it worked fine, but I'm now doing it on a new machine, but with the same disk that contained the backup file from the old machine.

    after following the instructions, I tried to reboot my computer and it hung on the xubuntu splash screen indefinitely - would not boot

    I booted into a live cd and (on a hunch) tried renaming the file
    /etc/avahi/services/afpd.service

    to afpd.service.old.

    I was then able to boot, and saw "Time Capsule" from my mac, but when I tried connecting, I got this error "Unable to connect" (link to screenshot): https://www.dropbox.com/s/9yjpsniuhp...46.04.png?dl=0

    and an error showed up on my Xubuntu box as well, "System program problem detected" and it wanted to submit a bug report.

    I'll continue working on it and post updates. Of course, I'll welcome any insight or help of any kind

  5. #5
    Join Date
    Feb 2006
    Location
    Edinburgh, Scotland
    Beans
    166
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO Use Ubuntu As A Mac OS X Time Capsule

    Thanks for the guide!

    I followed the steps exactly but although I can see the server in Finder I can't see it as a disk option in Time Machine (Yosemite, and Ubuntu Server 14.04). Any thoughts why this is? I also have Samba set up through Webmin, if that makes any difference.

  6. #6
    Join Date
    Feb 2006
    Location
    Edinburgh, Scotland
    Beans
    166
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO Use Ubuntu As A Mac OS X Time Capsule

    Quote Originally Posted by melat0nin View Post
    Thanks for the guide!

    I followed the steps exactly but although I can see the server in Finder I can't see it as a disk option in Time Machine (Yosemite, and Ubuntu Server 14.04). Any thoughts why this is? I also have Samba set up through Webmin, if that makes any difference.
    I managed to get it working using the guide here: http://d43.me/blog/1660/concisest-gu...-server-12-04/

    The main difference is the share definition in /etc/netatalk/AppleVolumes.default, and using a separate user account with its own home folder to contain the Time Capsule files.

  7. #7
    Join Date
    Mar 2007
    Beans
    133

    Re: HOWTO Use Ubuntu As A Mac OS X Time Capsule

    Quote Originally Posted by melat0nin View Post
    I managed to get it working using the guide here: http://d43.me/blog/1660/concisest-gu...-server-12-04/

    The main difference is the share definition in /etc/netatalk/AppleVolumes.default, and using a separate user account with its own home folder to contain the Time Capsule files.
    Thanks for that, great post. Worked fine for me.

  8. #8
    Join Date
    Jun 2015
    Beans
    2

    Re: HOWTO Use Ubuntu As A Mac OS X Time Capsule

    Hello Everybody,
    First, sorry for my english, i come frome France (Marseille).....
    I'm a beginner in ubuntu. I think is awesome! I've got a question:
    I have a fresh install of ubuntu 14.10. I installed netatalk and avahi packages for afp sharing. The home directory is shared. It working great.But:
    I would to share a folder who are on another disk, identified by /dev/sdb1/film
    So, what is the command line in the /etc/netatalk/AppleVolumes.default
    You said:

    # The line below sets some DEFAULT, starting with Netatalk 2.1.
    EFAULT: options:upriv,usedots
    # By default all users have access to their home directories.
    ~/ "Home Directory"
    # End of File

    That working great but i would like to replace "Home Directory" by /dev/sdb1/film. ( I tryed but not worked).

    Thanks a lot and I send at every body heat of southern France

  9. #9
    Join Date
    Aug 2008
    Location
    Arizona State
    Beans
    419
    Distro
    Ubuntu

    Re: HOWTO Use Ubuntu As A Mac OS X Time Capsule

    the solution is simple. /dev/sdb1 needs to be mounted at boot. You can add a permanent mount point by creating a folder somewhere (/mnt/ or /media/ are good choices, ex; /mnt/data) and then add /dev/sdb1 to /etc/fstab. eg


    /dev/sdb1 /mnt/data ext4 0 0

    reboot your computer and your should now see the contents of /dev/sdb1 mounted to /mnt/data

    Then edit AppleVolumes.default to share /mnt/data/film

  10. #10
    Join Date
    Jun 2015
    Beans
    2

    Re: HOWTO Use Ubuntu As A Mac OS X Time Capsule

    Thank you N00b-un-2!

    You give a good idea.

    This Is what i whrote in etc/netatalk/ApplesVolumes.default

    /media/pierre/dd2/film "film"

    IT WORK!

    Thx

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •