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.
[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