Skip to content

Instantly share code, notes, and snippets.

@matchaxnb
Created March 23, 2017 08:40
Show Gist options
  • Star 47 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save matchaxnb/4c2022c0d1a281deedba6f7539a2e3ae to your computer and use it in GitHub Desktop.
Save matchaxnb/4c2022c0d1a281deedba6f7539a2e3ae to your computer and use it in GitHub Desktop.
Samba timemachine config
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_adisk._tcp</type>
<txt-record>sys=waMa=0,adVF=0x100</txt-record>
<txt-record>dk0=adVN=Time Capsule,adVF=0x82</txt-record>
</service>
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
</service-group>
[global]
wins support = yes
workgroup = WORKGROUP
netbios name = SAMBA
vfs objects = acl_xattr fruit
map acl inherit = yes
store dos attributes = yes
security = user
valid users = @shareaccess
username map = /etc/samba/users.map
passdb backend = tdbsam:/etc/samba/passdb.tdb
guest ok = no
read only = no
# Time Machine
durable handles = yes
kernel oplocks = no
kernel share modes = no
posix locking = no
fruit:advertise_fullsync = true
smb2 leases = yes
# Security
client ipc max protocol = default
client max protocol = default
server max protocol = SMB3
client ipc min protocol = default
client min protocol = CORE
server min protocol = SMB2
[Time Capsule]
path = /tank/Backups
browseable = Yes
vfs objects = catia fruit streams_xattr
fruit:aapl = yes
read only = No
inherit acls = Yes
@warwickchapman
Copy link

Minimalist configuration below for Time Machine over SMB:

[global]
map to guest = Bad User
vfs objects = fruit
fruit:aapl = yes
fruit:time machine = yes
server min protocol = SMB2
log file = /var/log/samba/%m
log level = 1

[Time Capsule]
path = /media/ext4tba
guest only = yes
writeable = yes

@fabricecolas
Copy link

For more background, see also the (official) thread on Samba 4.8.0:

@athei
Copy link

athei commented Jun 21, 2018

If you are using ZFS and want a huge speedup (not just for time machine):

This will store resource forks directly in inodes instead of littering the place with ._ AppleDouble files.

@episage
Copy link

episage commented Sep 19, 2018

None of above works

@scruffydan
Copy link

If anyone is still having issues make sure you don't have oplocks and level 2 oplocks disabled.

Time Machine would not work with the following in my config file

level2 oplocks = no                                                                   
oplocks = no   

@reedlt
Copy link

reedlt commented Apr 5, 2020

Has anyone encountered:

Time Machine can’t connect to the backup disk. The operation couldn’t be completed. (OSStatus error 13.)

After they type their password on the time machine menu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment