I'm trying to map an unprivileged LXC user to the host and experiencing some weird behavior. Here is the directory permissions before mapping:
..and ls -n
I add the mapping to the conf file:
My subuid & subgid
I start the container and the folder permissions are now:
..ls -n
I use uid/gid 1005 in my containers to access mount points. As with the other containers, when I do I can no longer chown them to the correct owners. I get a permission denied. I have to shutdown the container, pct mount from the host and do it there, then the containers permissions are correct. Oddly enough the mount points pass through with the correct mapping. Any thoughts on what Im doing wrong here? Thanks.
Code:
drwxr-xr-x 4 app app 10 Apr 30 03:04 config
Code:
drwxr-xr-x 4 1005 1005 10 Apr 30 03:04 config
I add the mapping to the conf file:
Code:
arch: amd64
cores: 2
features: fuse=1,keyctl=1,nesting=1
hostname: docker
memory: 2048
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.68.1,hwaddr=16:DA:1B:AF:40:4F,ip=192.168.68.20/24,type=veth
ostype: ubuntu
rootfs: app:subvol-111-disk-0,size=20G
swap: 512
unprivileged: 1
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
lxc.idmap: u 0 100000 1005
lxc.idmap: g 0 100000 1005
lxc.idmap: u 1005 1005 1
lxc.idmap: g 1005 1005 1
lxc.idmap: u 1006 101006 64530
lxc.idmap: g 1006 101006 64530
My subuid & subgid
Code:
root@pve:/etc/pve/lxc# cat /etc/subuid
root:100000:65536
root:1005:1
root@pve:/etc/pve/lxc# cat /etc/subgid
root:100000:65536
root:1005:1
I start the container and the folder permissions are now:
Code:
drwxr-xr-x 4 nobody nogroup 11 Apr 30 03:14 config
Code:
drwxr-xr-x 4 65534 65534 11 Apr 30 03:14 config
I use uid/gid 1005 in my containers to access mount points. As with the other containers, when I do I can no longer chown them to the correct owners. I get a permission denied. I have to shutdown the container, pct mount from the host and do it there, then the containers permissions are correct. Oddly enough the mount points pass through with the correct mapping. Any thoughts on what Im doing wrong here? Thanks.