ventura time machine with ubuntu server

Time machine is very helpful, but as far as I understand, it's sort of useless if you want to backup data from your laptop on an external drive. First, it needs to be automatic and second, you do not want to attach a tail to your laptop to do it. The most useful way is to have a server and let your backups happen every day/hour, etc.

So I tried to setup TM on my new Macbook Air with Ventura 13.4 using Ubuntu 18.04 server. Using various sources here is what I did on my Ubuntu:

Installed samba and netatalk.

Modified the following files:

/etc/samba/smb.conf

[global]

client max protocol = default

client min protocol = SMB2_02

server max protocol = SMB3

server min protocol = SMB2_02

....

[timemachine]

valid users = alex

comment = Time Machine

path = /media/alex/Passport2T/

browseable = yes

read only = no

spotlight = yes

vfs objects = catia fruit streams_xattr

fruit:time machine = yes


/etc/avahi/services/samba

service

<?xml version="1.0" standalone='no'?>

<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<service-group>

  <name replace-wildcards="yes">%h</name>

  <service>

    <type>_smb._tcp</type>

    <port>445</port>

  </service>

  <service>

    <type>_device-info._tcp</type>

    <port>0</port>

    <txt-record>model=TimeCapsule8,119</txt-record>

  </service>

  <service>

    <type>_adisk._tcp</type>

    <txt-record>dk0=adVN=timemachine,adVF=0x82</txt-record>

    <txt-record>sys=waMa=0,adVF=0x100</txt-record>

  </service>

</service-group>

Now from Macbook I can access my drive from Finder both as Passport2T and timemachine, but when I try to use it in Timemachine, it fails. On "Add Backup Disk" I see "timemachine", but when I click on "Set Up Disk" and enter my password, it just keeps popping up the same dialog, seemingly not accepting my login.

Can anyone tell me if it is possible to do and how to to do it?

MacBook Air 13″, macOS 13.4

Posted on Jun 21, 2023 6:00 PM

Reply

Similar questions

14 replies

Jun 23, 2023 1:27 PM in response to MrHoffman

Ok, "older recipe" worked. I resumed to the original samba config (it supports Time Machine just fine) and removed my changes to avahi. Two caveats:

  1. netatalk config file is not /etc/netatalk/afp.conf, but /etc/netatalk/afpd.conf in my case (Ubuntu 18.04).
  2. On Mac the suggested server name is [Time.local which looks strange and I have no clue where it picked up this name.

Anyway, the backup looks fine.

Jun 24, 2023 11:08 AM in response to alexbootman

alexbootman wrote:

Does it mean that TM officially does not support network servers? Or there are some "official" ways to connect?


Apple does not support implementations of the spec. That support is up to the implementors.


Time Machine works with Synology NAS. Which supports the Apple Time Machine specifications.


Time Machine also works with TrueNAS too, per their doc and various reports. That might work here, too.


For comparison with this Linux server zfs setup from a few years ago, here is the Synology setup.


Requesting assistance for setting up and troubleshooting Linux features including Time Machine server or the Server Message Block (SMB) server or Bonjour/mDNS/Zeroconf networking over in a Ubuntu Linux forum might get you to an answer more quickly than around here too, as the Apple macOS 13 forum isn’t the usual spot for in-depth Ubuntu configuration and troubleshooting questions.


PS: Here is the Time Machine Over SMB Specification provided by Apple, and the Time Machine network interface Introduction.





Jun 24, 2023 9:44 AM in response to alexbootman

Interesting. Does it mean that TM officially does not support network servers? Or there are some "official" ways to connect?

Via SMB, from another Mac, or from a NAS that supports the Time Machine over SMB specification.

Netatalk is pseudo-AFP, not SMB. AFP was Apple's proprietary network protocol—they never licensed it, hence Netatalk. Time Machine was supported to work with AFP, but only from a Time Capsule or from another Mac serving out a network share.

Technically, your configuration is not supported in any way. See MrHoffman's link on Backup Disks you can use with Time Machine. Your setup would be similar to a NAS, but it would need to support the Time Machine over SMB specification.


If you are connected over SMB rather than AFP, then it is working similar to a supported NAS configuration. If you get failures where it states it must complete another full backup, then it likely does not support that specification, or you are using Netatalk protocol which is also inconsistent.

Jun 21, 2023 6:20 PM in response to alexbootman

Your server needs to support the Time Machine over SMB specification. The Samba implementation would have to support that. Since it supports SMB3, it most likely does support Time Machine over SMB.

I don't know what the smb.conf should look like, but this tutorial has it slightly different: https://blog.jhnr.ch/2023/01/09/setup-apple-time-machine-network-drive-with-samba-on-ubuntu-22.04/

Jun 22, 2023 3:14 PM in response to alexbootman

alexbootman wrote:

Not sure what you mean by "storage server must support Time Machine".


Apple Time Machine requires features beyond those of SMB.


Apple calls that Time Machine over SMB, and which is variously referred to as Time Machine Server:


Some details: Backup disks you can use with Time Machine - Apple Support



The wording there is confusing, unfortunately.


Here is another thread in this: Which SMB protocol is used by Time Machin… - Apple Community


And one more: https://www.vanwerkhoven.org/blog/2021/timemachine-to-linux-server/

Jun 22, 2023 1:51 PM in response to alexbootman

Your storage server must support Time Machine. SMB alone is insufficient.


TrueNAS supports Time Machine and other storage access services, as do some other packages. As do Synology NAS servers.


One (Fedora!) recipe that might work: https://carlhillit.github.io/blog/2021-12-17-LinuxServerTimeMachineBackup/


Older recipe for Ubuntu: https://www.grizzly-hills.com/index.php/2019/11/02/ubuntu-19-10-setting-up-time-machine/

Jun 25, 2023 7:55 AM in response to alexbootman

alexbootman wrote:

Interesting. Does it mean that TM officially does not support network servers? Or there are some "official" ways to connect?

No. You keep referencing netatalk. The 1990's are over. Any files corrupted by netatalk have been long since deleted. Time Machines uses SMB.


However, even your Ubuntu version if 5 years old. Mine works fine with Ubuntu 20.04.

Jun 21, 2023 6:20 PM in response to Barney-15E

Frankly I do not know much about time machine and its specifications. I am just following the directions I got from the Web. Specifically, I have no clue what you mean by 'disguise it as a TimeCapsule'.

Again, I am only trying to backup my Macbook data using my Ubuntu machine with external HDD.

'server needs to support the Time Machine over SMB specification' - isn't it what is done in /etc/samba/smb.conf, [timemachine] section?

I believe that this is quite standard and popular setup and should be described somewhere in detail.

Jun 22, 2023 1:39 PM in response to alexbootman

After reading https://unix.stackexchange.com/questions/562745/unable-to-connect-to-samba-share-running-in-linux-server-from-macos

I created /media/alex/Passport2T/tmbackup directory:

drwxrwxrwx 1 alex alex 131072 Jun 22 16:26 tmbackup/

and changed in [timemachine] section:

path = /media/alex/Passport2T/tmbackup

This time when I try to setup TM disk, I get:

You do not have the necessary read. write and append privileges on the selected network backup volume.

Still no good and not clear.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

ventura time machine with ubuntu server

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.