Hi,
after some trial and error I found a way to get Samba running in an unprivileged Container.
This isn´t a "copy paste tutorial" but some hints to the more obscure knobs you have to turn.
Our Setup consists of a Proxmox ZFS Backend and a SAMBA Based AD-Domain (hosted on a different Server)
I found several Posts/Articles stating, that it won´t work due to the "security Namespace" and then I stumbled over this Mail from the samba mailing list. It addresses the same issue but from the Samba Domain Controller point of view.
Probably some of the options/configurations can be omitted, but this way it worked for me
after some trial and error I found a way to get Samba running in an unprivileged Container.
This isn´t a "copy paste tutorial" but some hints to the more obscure knobs you have to turn.
Our Setup consists of a Proxmox ZFS Backend and a SAMBA Based AD-Domain (hosted on a different Server)
I found several Posts/Articles stating, that it won´t work due to the "security Namespace" and then I stumbled over this Mail from the samba mailing list. It addresses the same issue but from the Samba Domain Controller point of view.
Preparation on the host
Bash:
# not sure if necessary
zfs set aclmode=passthrough aclinherit=passthrough acltype=nfsv4 our/dataset
Bash:
cat /etc/pve/lxc/100.conf
[...]
# We map Domain Users via rid-Mapping to UID 1000000-1999999 on both systems, so the UIDs should stay the same.
lxc.idmap: u 0 100000 100000 #0 100k 100k Map user 0 to 99999 in container to 100k to 199999 on Host
lxc.idmap: g 0 100000 100000 #0 100k 100k
lxc.idmap: u 1000000 1000000 1000000 #1m 1m 1m keep the same UIDs for the Users from 1m to 1999999
lxc.idmap: g 1000000 1000000 1000000 #1m 1m 1m
[...]
# And we need to bind-mount our Data into the Container
mp0: /our/data/we/want/to/share/,mp=/srv/testshare,mountoptions=nodev;noexec;nosuid
Samba Config in the Container
Bash:
cat /etc/samba/smb.conf
[global]
[...]
idmap config MYDOM : backend = rid
idmap config MYDOM : range = 1000000-1999999
[...]
[testshare]
path = /srv/testshare/
vfs objects = posixacl nfs4acl_xattr acl_xattr
nfs4acl_xattr:xattr_name = user.nfs4_acl #the trick: if security.nfs4_acl namespace is prohibited, just don´t use it
nfs4acl_xattr:encoding = nfs
nfs4acl_xattr:version = 41
nfs4acl_xattr:default acl style = windows
[...]
Probably some of the options/configurations can be omitted, but this way it worked for me