macos

Time Machine SMB Backups to a Linux NAS on macOS 27

When a Mac that has backed up to the same NAS for years upgrades to macOS 27, the trouble starts quietly. Time Machine stops finding its disk, or the old share simply won’t mount. Nothing is wrong with the drives. The protocol the NAS was speaking is gone from the Mac.

Original content from computingforgeeks.com - post 195639

Apple dropped Apple Filing Protocol for Time Machine, so a Time Machine SMB share is now the only network target the Mac will accept. This guide builds one on a Linux box with Samba’s vfs_fruit module and adds it on the Mac. It then checks the backups with tmutil and walks through the failures we hit on the way. We tested it in November 2026 on macOS 27.2 against Samba 4.19 on Ubuntu 24.04, and re-checked the same config on Ubuntu 26.04 with Samba 4.23.

Understanding why AFP targets stop working

Apple’s own support note on backup disks you can use with Time Machine is blunt about it. It says backups over Apple Filing Protocol are not recommended and not supported in macOS 27 or later, and a third-party NAS needs to support Time Machine over SMB. The same note says AirPort Time Capsule and disks on an AirPort Extreme use AFP, so they fall out of support too. If one of those still holds your history, copy what you need off it before upgrading, or from a Mac still on an older release, because the upgraded Mac cannot mount it at all.

This is not a soft deprecation that keeps working with a warning. On our test Mac the AFP mount helper had been removed outright, while the SMB one was still in place, so there is nothing left on the client to fall back to.

ls -l /sbin/mount_afp /sbin/mount_smbfs

Only one of the two files exists:

ls: /sbin/mount_afp: No such file or directory
-r-xr-xr-x  1 root  wheel  293408 Oct 22 23:10 /sbin/mount_smbfs

Pointing tmutil at an AFP address fails with error 45 and a message that tells you exactly what Apple wants instead. Oddly, the tmutil man page on our macOS 27 host still describes setdestination as configuring “a local HFS+ or APFS volume, AFP share, or SMB share”. Do not trust it on this point, because the binary is the part that decides, and it refused every AFP URL we gave it.

The operation couldn’t be completed. Operation not supported (error 45)
The backup destination could not be added.
Disk is not compatible with this version of macOS. Network backups require a disk connected using SMB instead of AFP.

Finder refuses the address before it even tries the network. Running open afp://10.0.1.50/TimeMachine from Terminal produced the dialog below, marked AFP refused.

Finder on macOS 27 refusing an afp:// address with the message URLs with the type afp: are not supported

If your NAS vendor still ships firmware with only AFP enabled for Time Machine, switching its share to SMB in the admin panel is the whole fix. The rest of this guide is for anyone who would rather run the server on a small Linux box or an old mini PC. Our roundup of the best NAS for Mac Time Machine covers the off-the-shelf boxes that already speak SMB properly, if you’d rather buy than build.

Preparing the NAS host

Any Linux machine with a stable address and enough disk works. Ours was a small Ubuntu server called nas01, and the Mac reached it at 10.0.1.50. The host needs these in place before you start:

  • A fixed IP or DHCP reservation
  • A data disk mounted at /srv or similar
  • TCP 445 open to the Mac’s network
  • UDP 5353 open for Bonjour discovery
  • Root access through sudo

Give the address the attention it deserves. Time Machine stores the server name or IP in its destination record, so a NAS that changes address after a reboot breaks every backup until you re-add it. On Ubuntu, our guide to setting a static IP with Netplan takes care of that in a couple of minutes.

Building the Samba Time Machine share with vfs_fruit

Plain Samba will serve files to a Mac, but Time Machine wants more than files. It checks that the server speaks Apple’s SMB extensions (AAPL), honours full sync requests, and advertises itself as a backup disk. The vfs_fruit module provides all three, and avahi-daemon carries the Bonjour advert.

Everything comes from the Ubuntu archive, so there is no third-party repository to trust or keep updated. Install Avahi with Samba, because Samba hands its Bonjour record to Avahi, and without it the share is never advertised to the Mac. The avahi-utils package adds avahi-browse, which we use later to check the advert.

sudo apt update
sudo apt install -y samba avahi-daemon avahi-utils

Confirm the Samba build you got. A couple of fruit options changed behaviour between releases, so the version decides whether one line in the config below is required or merely harmless.

smbd --version

Ubuntu 24.04 gave us the build below.

Version 4.19.5-Ubuntu

Next, create a dedicated account for the backups. It needs no shell and no home directory, only a Samba password. Keeping it separate from your own login means a leaked backup password cannot open an SSH session, and you can change it later without touching anything else on the box.

sudo useradd --system --no-create-home --shell /usr/sbin/nologin tmbackup
sudo smbpasswd -a tmbackup

The second command asks for the password twice and then confirms the account. Write that password down now, because the Mac asks for it once and then keeps it in the System keychain.

Added user tmbackup.

Now make the backup directory and hand it to that user. Mode 0750 keeps other local accounts out of everyone’s backups, which matters because a sparse bundle holds a full copy of the Mac’s home folders, browser profiles included.

sudo mkdir -p /srv/timemachine
sudo chown tmbackup:tmbackup /srv/timemachine
sudo chmod 0750 /srv/timemachine
ls -ld /srv/timemachine

The listing should show tmbackup as owner and group.

drwxr-x--- 2 tmbackup tmbackup 4096 Nov 24 22:35 /srv/timemachine

We replaced the stock config rather than editing it, because the Ubuntu default carries printer shares and comments that make the fruit settings harder to read. Move the original aside first so you can compare later.

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.orig
sudo vim /etc/samba/smb.conf

Paste the configuration below. This is the exact file our Mac backed up to, so change only the server string and the path if your disk lives elsewhere.

[global]
   workgroup = WORKGROUP
   server string = nas01
   server role = standalone server
   security = user
   map to guest = never
   log file = /var/log/samba/log.%m
   max log size = 1000
   logging = file

   # Apple SMB extensions, set globally so every share negotiates AAPL
   vfs objects = catia fruit streams_xattr
   fruit:metadata = stream
   fruit:model = MacSamba
   fruit:veto_appledouble = no
   fruit:nfs_aces = no
   fruit:wipe_intentionally_left_blank_rfork = yes
   fruit:delete_empty_adfiles = yes
   fruit:posix_rename = yes

[TimeMachine]
   comment = Time Machine backups
   path = /srv/timemachine
   valid users = tmbackup
   read only = no
   browseable = yes
   fruit:time machine = yes
   fruit:time machine max size = 100G

Three lines carry most of the weight. The vfs_fruit man page says fruit:time machine = yes advertises full sync support to the Mac and forces durable handles with kernel oplocks off, while the Bonjour record itself comes from Samba’s mDNS registration through Avahi. The page also warns that mixing shares with and without fruit can disable AAPL globally when the first connection lands on a share without it, so we load fruit in [global]. The max size line is a reporting cap. The Mac sees 100 GiB however big the disk is, which stops one laptop from eating the whole array.

Keep fruit:posix_rename = yes on any Samba older than 4.22.6. The Samba wiki notes that without it, the first backup can fail with “The backup disk image could not be created”. Later releases made the option obsolete, and our Samba 4.23 test still loaded the file without complaint. Validate the syntax before restarting anything:

sudo testparm -s

The top of the output is the part that matters. It should say the services file loaded, followed by the normalized config:

Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed by GnuTLS (e.g. NTLM as a compatibility fallback)

Server role: ROLE_STANDALONE

Restart Samba to pick up the new share, then check that it’s listening on 445:

sudo systemctl restart smbd
sudo ss -tlnp | grep -E ':445|:139'

You should see smbd bound on both IPv4 and IPv6:

LISTEN 0      50           0.0.0.0:139       0.0.0.0:*    users:(("smbd",pid=2433,fd=31))
LISTEN 0      50           0.0.0.0:445       0.0.0.0:*    users:(("smbd",pid=2433,fd=30))
LISTEN 0      50              [::]:139          [::]:*    users:(("smbd",pid=2433,fd=29))
LISTEN 0      50              [::]:445          [::]:*    users:(("smbd",pid=2433,fd=28))          

If ufw is active on the NAS, open Samba to your LAN. Ubuntu’s default before.rules already accepts mDNS multicast, so the second rule is only a safety net for a ruleset someone has trimmed.

sudo ufw allow from 10.0.1.0/24 to any app Samba
sudo ufw allow from 10.0.1.0/24 to any port 5353 proto udp

Finally, confirm Avahi is advertising the share as a Time Machine disk. This is the record the Mac’s picker looks for:

avahi-browse -rpt _adisk._tcp

The dk0 field names the share, and adVF=0x82 flags it as a backup volume. The address shown is the NAS’s own interface on our lab network, since both machines ran as VMs on one Apple Silicon host and the Mac reached the NAS at 10.0.1.50 through a port forward:

=;enp0s1;IPv4;NAS01;Apple TimeMachine;local;nas01.local;192.168.64.8;0;"sys=adVF=0x100" "dk0=adVN=TimeMachine,adVF=0x82"

No line means Avahi isn’t running or Samba was built without mDNS support, and you’ll have to add the disk by address on the Mac. Hardening the rest of the box is worth an hour too; our Ubuntu server hardening checklist covers SSH, updates and auditing on a host like this.

Adding the destination on the Mac

The usual route is System Settings, General, Time Machine, then the + button, where the share appears when Bonjour can see it. Pick it, enter tmbackup and its password, and Time Machine starts the first backup on its own.

Our picker stayed empty because mDNS didn’t cross the lab network, which is common on segmented home networks and guest VLANs too. The command line doesn’t care about Bonjour. Before using it, give Terminal Full Disk Access under System Settings > Privacy & Security > Full Disk Access, because setdestination, enable and removedestination all need it on top of root.

The -a flag adds the share alongside any existing destinations. Put the backup user’s password in place of <password>, or drop it from the URL and add -p to get a non-echoing prompt, which keeps it out of your shell history and out of ps:

sudo tmutil setdestination -a "smb://tmbackup:<password>@10.0.1.50/TimeMachine"

Once the command returns without output, read the destination back:

tmutil destinationinfo

The ID is worth copying somewhere, because removing or replacing this destination later takes it. The URL also shows which address the Mac will dial on every run, so a typo here shows up now rather than as a failed backup tonight.

====================================================
Name          : TimeMachine
Kind          : Network
URL           : smb://[email protected]/TimeMachine
ID            : D4457353-10D7-4EF4-87D9-F6F7B5A65EEE

One result caught us out. A destination added from the command line doesn’t switch on automatic backups. Time Machine settings showed the disk, but under it read Manual only, “When triggered manually”, so the Mac would never have backed up on its own.

Time Machine settings on macOS 27 after tmutil setdestination showing Next backup When triggered manually

Turn on the hourly schedule explicitly, then start the first backup instead of waiting an hour for it:

sudo tmutil enable
tmutil startbackup --auto

Check that the setting stuck. A value of 1 means hourly backups are on, and the settings pane changes to “Automatic (hourly)” at the same time:

defaults read /Library/Preferences/com.apple.TimeMachine AutoBackup

Ours returned the value we wanted:

1

Back in System Settings, the same destination now reads “Next backup: Automatic (hourly)” under the share name. We took this capture once the first run had finished, which is why it already lists a completed backup.

Time Machine settings on macOS 27 after sudo tmutil enable showing the SMB share with Next backup Automatic (hourly)

While a backup runs, the settings pane shows the share as the SMB destination with about 104 GB available, which is the 100 GiB fruit cap rather than the real disk, and a Progress line underneath. That line reports the same byte counts as tmutil status, and the progress screenshot below comes from a later run, taken after the first backup had completed.

Time Machine settings on macOS 27 backing up to the Samba share TimeMachine at 10.0.1.50 with the progress bar at 57.6 percent
  1. 1SMB destination
  2. 2Progress

The first backup is the slow one, since it copies the whole Data volume into a new sparse bundle on the NAS. Later runs only send what changed, so an hourly schedule costs little once the seed is done. Start the first run when the Mac can stay awake on mains power, because our small test Mac took about three minutes over a fast virtual link, and a full laptop over Wi-Fi will need hours.

Verifying backups with tmutil

A green tick in System Settings tells you a backup finished, not that you can get files back. We check from both ends: tmutil on the Mac for what it thinks it wrote, and the NAS for what actually landed. Start with the live status during the first run:

tmutil status

Ninety seconds in, our run was in the Copying phase at about 15.7 percent of 11.8 GB and 306,344 files, with roughly six minutes left. FirstBackup = 1 confirms it’s building a fresh bundle rather than appending:

Backup session status:
{
    BackupPhase = Copying;
    ClientID = "com.apple.backupd";
    DateOfStateChange = "2026-11-24 22:44:30 +0000";
    DestinationID = "D4457353-10D7-4EF4-87D9-F6F7B5A65EEE";
    DestinationMountPoint = "/Volumes/Backups of Managed\U2019s Virtual Machine";
    FirstBackup = 1;
    FractionOfProgressBar = 1;
    Progress =     {
        Percent = "0.1568694862356561";
        TimeRemaining = "346.3657483896843";
        "_raw_Percent" = "0.1568694862356561";
        "_raw_totalBytes" = 11813539840;
        bytes = 1192755200;
        files = 65182;
        totalBytes = 11813539840;
        totalFiles = 306344;
    };
    Running = 1;
    attemptOptions = 1;
}

Once it finished, we listed the completed snapshots. Each line is one restorable point in time, named by its UTC timestamp:

tmutil listbackups -t

Two runs, about four minutes apart. The second one, an incremental, copied only 31.45 MB:

2026-11-24-224617
2026-11-24-225056

Condensed from our session into one image, the destination record, the incremental run and the snapshot list are the three facts worth checking after any change to the NAS.

tmutil destinationinfo, startbackup and listbackups on macOS 27 against the Samba SMB destination

Then compare the stored data against the checksums Time Machine recorded during the backup. This is the closest thing to a scrub you get from the Mac side, and it’s silent when everything matches:

sudo tmutil verifychecksums "$(tmutil latestbackup)"
echo $?

No output and an exit code of 0 is a pass. A mismatch prints the file with a ! in front of it. Run this one right after a backup, while the snapshot is still mounted; the troubleshooting section covers why the path disappears later.

To confirm the Mac really negotiated Apple’s extensions, we mounted the share by hand and asked smbutil what it got. OS_X_SERVER TRUE means AAPL is active, which is what fruit is there for:

mkdir -p ~/tmshare
mount_smbfs //[email protected]/TimeMachine ~/tmshare
smbutil statshares -m ~/tmshare | grep -E "SMB_VERSION|OS_X_SERVER|SIGN_ALGORITHM|FILE_LEASING"

The session ran over SMB 3.1.1 with AES-GMAC signing:

                              SMB_VERSION                   SMB_3.1.1
                              SMB_SIGN_ALGORITHMS           AES_128_CMAC_ENABLED
                              SMB_SIGN_ALGORITHMS           AES_128_GMAC_ENABLED
                              SMB_CURR_SIGN_ALGORITHM       AES_128_GMAC
                              OS_X_SERVER                   TRUE
                              FILE_LEASING_SUPPORTED        TRUE

Unmount it with umount ~/tmshare when you’re done. On the NAS, the backup is a single sparse bundle named after the Mac, plus a small I/O test file Time Machine writes to probe the share:

sudo ls -la /srv/timemachine
sudo du -sh /srv/timemachine

After two backups, the whole bundle took 2.5 GB on the NAS disk:

total 12
drwxr-x--- 3 tmbackup tmbackup 4096 Nov 24 22:51 .
drwxr-xr-x 3 root     root     4096 Nov 24 22:35 ..
-rwxr--r-- 1 tmbackup tmbackup    0 Nov 24 22:51 .com.apple.TimeMachine.iotest.5530F7FC-5310-4096-BAE1-33BE5927034F
drwxr-xr-x 4 tmbackup tmbackup 4096 Nov 24 22:51 Managed’s Virtual Machine.sparsebundle
2.5G	/srv/timemachine

On the Samba side, smbstatus -b shows the backup user’s session on SMB3_11 with signing, and the bundle holds the bands and plists Time Machine manages. The session address is our lab forwarder, not the Mac itself.

smbstatus on the Ubuntu NAS showing the tmbackup SMB3_11 session and the Time Machine sparsebundle contents

We also checked that the 100 GiB cap is only reporting. On a 20 GB Ubuntu 26.04 disk, smbclient still reported 104,857,600 one-kilobyte blocks for the share. The cap counts every sparse bundle in the share, so several Macs on one share split it, and you’d give each Mac its own share for a per-Mac limit. The man page also says a capped share must not hold anything else. Watch the real free space with df on the NAS, because the Mac can’t see it.

Fixing Time Machine backup failed errors on the SMB share

Every failure below happened during this build. The error text is what macOS or Samba printed, so you can search the page for the message on your screen. When a failure doesn’t show in the GUI, log show is where you’ll find it:

log show --style compact --predicate 'subsystem == "com.apple.TimeMachine"' --last 10m

Look for lines marked E from backupd. The final one usually names the failure code, so read the log from the bottom up and match that code to the headings below.

“Network backups require a disk connected using SMB instead of AFP” (error 45)

The destination URL starts with afp://, or the NAS only exports the share over AFP. Enable SMB for the share on the NAS, remove the old destination with sudo tmutil removedestination <ID>, and add it again with an smb:// URL. If the old sparse bundle is still on the share, sudo tmutil inheritbackup on that bundle lets the Mac claim it; otherwise expect a new full backup and plan for the space it takes on the NAS.

This is how the refusal looked in our terminal when we pointed tmutil at the same share over AFP, a few minutes after the SMB destination had been added without complaint.

tmutil setdestination on macOS 27 refusing an afp URL with error 45, network backups require a disk connected using SMB instead of AFP

The last line is the useful one. It names SMB as the only network option, so there is no hidden setting that brings AFP back.

“No Available Time Machine Destinations”

The + sheet in System Settings lists only what Bonjour finds. When the advert doesn’t reach the Mac, you get the Empty picker below even though the share works fine.

Time Machine Add Backup Disk sheet on macOS 27 showing No Available Time Machine Destinations when Bonjour cannot reach the NAS

Check avahi-browse -rpt _adisk._tcp on the NAS first. If the record is there, the problem is the network between the two machines: UDP 5353 blocked, a different VLAN, or a mesh router that drops multicast. Either fix that or skip discovery with tmutil setdestination and the IP, as shown above.

“Failed to open session. (error 60)”

Error 60 is a timeout, which means the Mac never reached TCP 445 on the address you gave. Ours came from a network that blocked traffic between the two machines, so nothing in Samba’s config could have fixed it. Test with nc -vz 10.0.1.50 445 from the Mac, then check the NAS firewall and ss -tlnp before you start editing smb.conf.

BACKUP_FAILED_AUTHENTICATION_ERROR (29)

The destination was added, but every backup failed within seconds. The log showed this pair of lines:

Authentication error (80) - the correct user or password info may not exist in the System.keychain or the server may no longer allow access for this user.
Backup failed: BACKUP_FAILED_AUTHENTICATION_ERROR (29)

Time Machine reads the password from the System keychain, not your login keychain. In our case the URL carried a custom port while the saved keychain item had port 0, so the lookup never matched. Changed passwords cause the same error. Remove the destination, then add it again on the standard port with the current password.

BACKUP_FAILED_NO_SPACE_FOR_LOCAL_SNAPSHOT (50)

This one blames the Mac, not the NAS. Every backup starts from a local APFS snapshot, and with 6.9 GiB free on the Data volume macOS purged that snapshot mid-run. tmutil startbackup --block reported “Total copied: 0.00 MB”. Free a few gigabytes of caches, old downloads or Homebrew leftovers (brew cleanup) and run it again. At 7.8 GiB free the retry went through, so the margin is smaller than it looks, but a Mac that lives near full will keep hitting this every few days. Leave it more headroom than we did.

testparm prints “Error loading services.”

On Ubuntu 26.04, running testparm as a normal user against an smb.conf with mode 0600 printed only this error. The config was fine, but the user could not read it, so the message points at the wrong problem. Run sudo testparm -s, or set the file back to 0644 as Ubuntu ships it. The same file loaded cleanly as root on both Ubuntu releases we tried.

Running a restore drill

A backup you’ve never restored from is a guess. We dropped a test file into Documents before the second backup and pulled it back from the NAS from the command line, which is also how you would recover over SSH on a Mac that will not open Finder. The drill has a few traps, and the steps below are the path that worked for us:

  1. Find the backup volume’s device
  2. List its APFS snapshots
  3. Mount one snapshot read-only
  4. Restore the file with tmutil restore

Skip straight to tmutil restore on an old path and it fails with a missing file error, so the first two steps are not optional.

The latestbackup path only exists while backupd has the snapshot mounted, and ours was gone a few minutes after the run. The backup volume itself stays mounted, so find its device first:

mount | grep "Backups of"

Ours was /dev/disk7s1; yours will likely differ:

/dev/disk7s1 on /Volumes/Backups of Managed’s Virtual Machine (apfs, local, nodev, nosuid, journaled, nobrowse)

List the snapshots on that device. Each backup is one APFS snapshot:

diskutil apfs listSnapshots disk7s1

The names match the timestamps from listbackups:

Snapshots for disk7s1 (2 found)
|
+-- BCD1BD3B-031C-4608-9201-CC452D936080
|   Name:        com.apple.TimeMachine.2026-11-24-224617.backup
|   XID:         124
|   Purgeable:   Yes
|
+-- 3CCC4482-908E-4FA6-A912-5DCAB4897286
    Name:        com.apple.TimeMachine.2026-11-24-225056.backup
    XID:         185
    Purgeable:   Yes
    NOTE:        This snapshot limits the minimum size of APFS Container disk7

Mount the newest one read-only and restore the file. Swap in your own snapshot timestamp from the list above and your own username for admin. Inside the snapshot the volume is called plain Data, not the longer name Finder shows, and using the Finder name got us “No such file or directory (error 2)” on the first try:

sudo mkdir -p /private/tmp/tmsnap
sudo mount_apfs -o rdonly -s com.apple.TimeMachine.2026-11-24-225056.backup /dev/disk7s1 /private/tmp/tmsnap
sudo tmutil restore -v /private/tmp/tmsnap/2026-11-24-225056.backup/Data/Users/admin/Documents/restore-test.txt ~/Documents/

One item copied, and cat on the restored file printed the line we’d saved before the backup, “quarterly figures v1”:

Copying file . ...
21 bytes for .
Total copied: 0.00 MB (21 bytes)
Items copied: 1

Unmount the snapshot with sudo umount /private/tmp/tmsnap when you’re finished. The Mac terminal commands cheat sheet keeps diskutil and tmutil close at hand if you’d rather not remember these.

We’d repeat this drill every few months, and after every Samba or macOS upgrade. Between drills, the one log to watch on the NAS is /var/log/samba/log.<client>, plus free space on the data disk, since the 100 GiB cap hides a full array from the Mac. If you also serve Windows machines from the same box, the Samba share setup for Windows clients and the Samba guide for Fedora show how ordinary shares fit next to this one, as long as fruit stays in [global].

Keep reading

Install Samba on Debian 13 / 12 and Create a File Share Debian Install Samba on Debian 13 / 12 and Create a File Share Backup and Restore Linux Systems with Timeshift Debian Backup and Restore Linux Systems with Timeshift Best NAS Hard Drives for 2026: WD Red vs IronWolf, Price per TB Storage Best NAS Hard Drives for 2026: WD Red vs IronWolf, Price per TB XNULinux: Run macOS 27 on Linux on Apple Silicon, Tested macos XNULinux: Run macOS 27 on Linux on Apple Silicon, Tested How to Clean Install macOS 27 or Tahoe from Recovery macos How to Clean Install macOS 27 or Tahoe from Recovery Ext4 vs XFS vs Btrfs vs ZFS: Linux Filesystem Benchmarks Storage Ext4 vs XFS vs Btrfs vs ZFS: Linux Filesystem Benchmarks

Leave a Comment

Press ESC to close