Marinus Klasen

Marinus Klasen

  • Development
  • Consultancy
  • Developer Resources
  • Blog
  • Contact

March 14, 2021

TimeMachine with samba on an Ubuntu server

Marinus Klasen

The other day I setup an Ubuntu 20.04 server that runs a couple of docker containers. Since the machine is equipped with a 1TB hard disk I also wanted to use it as a TimeMachine backup location.

Finding the right configuration took me a while, but with the settings below the disk automatically showed in the TimeMachine settings.

/etc/samba/smb.conf

[global]
    min protocol = SMB2
    vfs objects = fruit
    fruit:metadata = stream
    fruit:model = MacSamba
    fruit:posix_rename = yes
    fruit:veto_appledouble = no
    fruit:wipe_intentionally_left_blank_rfork = yes
    fruit:delete_empty_adfiles = yes
    fruit:aapl = yes
    fruit:time machine = yes
    server min protocol = SMB2
    log file = /var/log/samba/%m
    log level = 1
[TimeMachine]
    comment = TimeMachine
    guest only = Yes
    path = /home/yourusername/timemachine
    force user = yourusername
    writeable = yes

About Marinus Klasen

Marinus has been working in software/web development for more than a decade. Since 2020 his attention shifted on sharing knowledge and developing products and tools for sharing knowledge.

Marinus Klasen on Twitter

This site runs on Cloudways.
It's fast isn't it?
Cloudways offers high-quality, fast and affordable hosting.

Learn more

Need a hand? Post your project and hire me and other top notch developers on Codeable.

Hire me on Codeable

Comments

  1. Jeff Cole says

    October 16, 2021 at 1:28 pm

    Thanks for sharing this.

    I was wondering if this is still working for you as I am finding I get an error “ The backup disk image could not be created.”

    I’m on Catalina using a ZFS server on Ubuntu.

    Reply
    • Marinus Klasen says

      October 16, 2021 at 3:41 pm

      Hi Jeff – I haven’t had any issues with it so far. I’ll double check the status and config next Monday. 🙂
      Feel free to reach out per mail/Twitter, happy to help.

      Reply
    • Marinus Klasen says

      October 18, 2021 at 10:53 am

      Yup – the config is still the same and backups are running.

      Reply
  2. Jürgen says

    November 23, 2021 at 3:10 pm

    Hi,
    is there something else I need to install to make it run? In the past Avahi was needed, too.

    Thanks for your help
    Jürgen

    Reply
    • Marinus Klasen says

      November 23, 2021 at 6:30 pm

      I don’t remember installing anything else, but as Jeff also had some issues, there might be something missing in the config. What’s the issue your having?

      Reply
  3. Dan More says

    April 1, 2023 at 9:47 pm

    This is great, used this exact config, mounted, time machine detected the share without any additional config.

    Reply
    • Keno says

      April 14, 2023 at 1:27 pm

      Have you added the server in the finder? Or could you see the image directly in the time machine?

      Reply
  4. mark hardwick says

    September 8, 2023 at 7:46 am

    Thanks so much for this post.
    In case this isn’t working for someone, I have Samba 4.15.3 running on Ubuntu 20. With the config posted, Samba core dumped on my Ubuntu server. To resolve I had to remove:
    > fruit:metadata = stream

    Hope this helps…

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get in touch

Contact me using the details below

Marinus Klasen

Wilhelmina van Pruisenweg 35, 2595 AN Den Haag

[email protected]
twitter.com/marinusklasen
linkedin.com/in/marinusklasen

  • GitHub
  • LinkedIn
  • Twitter

Have you read?

  • Disable the ‘Password Changed’ Email notification in WordPress with a filterAugust 30, 2023
  • A-Frame: Change an objects color on hoverAugust 24, 2023
  • Connecting to a Cloudways application with VSCodeAugust 15, 2023
  • Force refresh PHP-FPM or Litespeed cacheAugust 4, 2023
  • Only return zip/postal codes from Google Places AutoComplete Javascript APIJuly 19, 2023

Copyright © 2023 · Marinus Klasen | Webdesign by Team Rood