Hi, I´m currently struggling to get a domain joined samba fileserver up and running with lxc.
The issue seems to be the id mapping. The container won´t recognize IDs above 65534 (while the Samba-Mapping is set to 1M-2M)
/etc/pve/lxc/102.conf
so I do expect that Container-IDs
0<=x<=100k get mapped on 100k+x
1m<=y<=2m get mapped on y (Host and Container are Domain-Joined, so I should use the same IDs)
/etc/subuid and subgid on PVE Host
tests with otherusers in the 2m+ range weren´t successfull either
starting the container in debug mode outputs
In container:
what am I missing?
The issue seems to be the id mapping. The container won´t recognize IDs above 65534 (while the Samba-Mapping is set to 1M-2M)
/etc/pve/lxc/102.conf
Code:
arch: amd64
cores: 8
features: nesting=1
hostname: sambatest
memory: 8096
mp0: /datapool/testpool1,mp=/srv/,acl=1,backup=1,mountoptions=nodev;noexec;nosuid,replicate=0
net0: name=eth0,bridge=vmbr10,firewall=1,...
ostype: debian
rootfs: production_vms:subvol-102-disk-0,size=8G
swap: 8096
unprivileged: 1
lxc.idmap: u 0 100000 100000 #100k
lxc.idmap: g 0 100000 100000
lxc.idmap: u 1000000 1000000 1000000 #1m
lxc.idmap: g 1000000 1000000 1000000
0<=x<=100k get mapped on 100k+x
1m<=y<=2m get mapped on y (Host and Container are Domain-Joined, so I should use the same IDs)
/etc/subuid and subgid on PVE Host
Code:
root:100000:2000000
otheruser1:165536:65536
otheruser2:231072:65536
otheruser3:296608:65536
starting the container in debug mode outputs
Code:
lxc-start 102 20230117132017.935 INFO confile - ../src/lxc/confile.c:set_config_idmaps:2267 - Read uid map: type u nsid 0 hostid 100000 range 100000
lxc-start 102 20230117132017.935 INFO confile - ../src/lxc/confile.c:set_config_idmaps:2267 - Read uid map: type g nsid 0 hostid 100000 range 100000
lxc-start 102 20230117132017.935 INFO confile - ../src/lxc/confile.c:set_config_idmaps:2267 - Read uid map: type u nsid 1000000 hostid 1000000 range 1000000
lxc-start 102 20230117132017.935 INFO confile - ../src/lxc/confile.c:set_config_idmaps:2267 - Read uid map: type g nsid 1000000 hostid 1000000 range 1000000
In container:
Bash:
root@sambatest:~# chown 10000 /srv/test
root@sambatest:~# ls -l /srv/test
-rw-r--r-- 1 10000 root 0 Jan 16 13:44 /srv/test
root@sambatest:~# chown 100000 /srv/test
chown: changing ownership of '/srv/test': Invalid argument
root@sambatest:~# ls -l /srv/test
-rw-r--r-- 1 10000 root 0 Jan 16 13:44 /srv/test
root@sambatest:~#
what am I missing?