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
Jeff Cole says
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.
Marinus Klasen says
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.
Marinus Klasen says
Yup – the config is still the same and backups are running.
Jürgen says
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
Marinus Klasen says
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?
Dan More says
This is great, used this exact config, mounted, time machine detected the share without any additional config.
Keno says
Have you added the server in the finder? Or could you see the image directly in the time machine?
mark hardwick says
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…
Chris says
I was seeing errors in the logs like:
error probing vfs module ‘streams_xattr’: NT_STATUS_UNSUCCESSFUL
error probing vfs module ‘fruit’: NT_STATUS_UNSUCCESSFUL
I had to specifically install the VFS modules:
sudo apt install samba-vfs-modules
Konstantin says
Hi, thank you a lot for sharing this config!
I’ve just tried it on Debian 11.9 and it works.
Konstantin.