Use Ubuntu 24.04 server as a Time Machine backup host for MacOS computers.
In the past I set up netatalk on our Linux servers to provide Apple Talk shares on the network. However, I discovered Stefan Johner's post on usig Samba with the vfs_fruit module. The Samba package provides SMB compatible file sharing which means it works with a variety of operating systems and devices, including Windows and MacOS. The vfs_fruit module allows it to offer up those shares as Time Machine compatible destinations.
- Install Samba
# Install
sudo apt update
sudo apt install samba
- Edit Configuration File
# Edit smb.conf
sudo nano /etc/samba/smb.conf
First, add the vfs_fruit configs under Global:
[global]
# Fruit global config
fruit:aapl = yes
fruit:nfs_aces = no
fruit:copyfile = no
fruit:model = MacSamba
Next, select the folders you want to share and configure them for Fruit. Make sure you update the lines to match your setup, specifically the "valid users" and "path". The header (e.g. [timemachine]) is how the share will appear on your network (Apple Finder).
#======================= Share Definitions =======================
[timemachine]
# Load in modules (order is critical!)
vfs objects = catia fruit streams_xattr
fruit:time machine = yes
fruit:time machine max size = 300G
comment = Time Machine Backup
path = /mnt/timemachine
available = yes
valid users = timemachine
browseable = yes
guest ok = no
writable = yes
Some posts or guides have you continue on to set up avahi but in my experience, that is not necessary for Ubuntu 24.04.
- Create Folders
Make sure you create the paths that you mention above and make sure the valid users have access to it:
# Make directory
sudo mkdir /mnt/timemachine
# Onwership
sudo chown -R timemachine:timemachine /mnt/timemachine
sudo chmod -R ug+rw /mnt/timemachine
- Restart
# Restart Service
sudo service smbd restart
# Allow Firewall if Active
sudo ufw allow samba
- On MacOS
In your Time Machine settings, add a disk and you should see the timemachine share appear: