odarriba/docker-timemachine

How to set permissions on /timemachine/user1 directory?

Closed this issue · 3 comments

Hi there,

Thanks for what looks like a fabulous docker image!

I have got it up and running, and I've added two users user1 and user2 with the docker exec timemachine add-account command. The user1 and user2 directories get created under the /timemachine directory. So far so good.

I do command-K on the Mac to mount the Time Machine VM. Works. If I create a test directory in the /timemachine/user1 directory from the VM, this test directory immediately shows up on the Mac Finder window.

However... Time Machine won't show me my timemachine VM when I go to select disk. And if I try to create a folder from the Mac, it prompts me for username/password, and fails (even though I provide the correct u/p).

The user1 and user2 folders are showing as drwxr-xr-x 2 root root

Any idea what I'm missing?

My docker /timemachine is mapped to /mnt/timemachine on the VM, which in turn is a mounted CIFS share. I have read/write permissions as I can create and delete stuff no problem (as root on the VM).

I hope that all makes sense and you can give an easy answer!

Thanks again!

Never mind, this is related to how the CIFS share is mounted. I don't think Netatalk is even compatible with CIFS shares (permissions? long/weird file names? extended attributes? who knows).

Hi!

The iage actually tries to set permissions on user creation, so if they aren't se, it culd be due to:

  • a file system incompatibility (as you said)
  • a external process (including the host machine or even another container sharing the same volume) has changed the permissions.

Hope it helps!

Regards

Thanks very much for taking the time to reply. After several hours of troubleshooting, I found how to fix it, and I'm putting it here in case someone else wonders how to do it.

Add the following line into /etc/fstab (all one line):

//yourserver.fqdn/sharename /mnt/timemachine cifs credentials=/root/.cifscredentials,file_mode=0664,dir_mode=0774,noperm

Then create a file /root/.cifscredentials that contains (replacing for the actual values):

username=yourcifsusername
password=yourcifspassword

Then do:

chmod 600 /root/.smbcredentials

And that should all work. You can test it by typing:

mount -a

And if you reboot, the mount should still be there.

I found that the key for TimeMachine to work was to have these 3 options on the mount command:

file_mode=0664,dir_mode=0774,noperm