It has to be something obvious, but I fail to recognize the reason for too long -- I cannot pass thru uid/gid mapping.
The setup is as follows:
PVE 6.1, single machine -- no cluster. Unprivileged container needs to access an NFS share. I mount the share on host and then bind-mount it into the container; this works like a charm. Just for completeness, this is relevant line:
Of course, I get the uid mapping problem. Suggested solution of just chown-ing the share won't work, because the share is used by other machines -- physical and virtual (but no LXC atm) as well. So, [ug]id mapping for the container -- and this is where the problem begins.
Everything I enter into container config and /etc/sub[ug]id results in container hanging; it has to be killed with -9. It complains about newgidmap:
What I am trying to achieve is: map CT uids 1000-65535 to 1000-65535 on host and map CT gid 100 to 100 on host. Other ids would be shifted by usual 100000.
Relevant config files sections:
I feel this is some kind of one-off problem, and probably something I'd be ashamed to see explained -- but I fail to recognize the reason.
The setup is as follows:
PVE 6.1, single machine -- no cluster. Unprivileged container needs to access an NFS share. I mount the share on host and then bind-mount it into the container; this works like a charm. Just for completeness, this is relevant line:
with no extra options./etc/pve/lxc/303.conf said:mp0: /mnt/bind/web,mp=/web
Of course, I get the uid mapping problem. Suggested solution of just chown-ing the share won't work, because the share is used by other machines -- physical and virtual (but no LXC atm) as well. So, [ug]id mapping for the container -- and this is where the problem begins.
Everything I enter into container config and /etc/sub[ug]id results in container hanging; it has to be killed with -9. It complains about newgidmap:
# lxc-start -F -n 303
lxc-start: 303: conf.c: lxc_map_ids: 3012 newgidmap failed to write mapping "newgidmap: write to gid_map failed: Invalid argument": newgidmap 23419 0 100000 100 100 100 1 101 100000 65434
lxc-start: 303: start.c: lxc_spawn: 1825 Failed to set up id mapping.
lxc-start: 303: start.c: lxc_abort: 1133 Function not implemented - Failed to send SIGKILL to 23419
lxc-start: 303: start.c: __lxc_start: 2080 Failed to spawn container "303"
lxc-start: 303: tools/lxc_start.c: main: 329 The container failed to start
lxc-start: 303: tools/lxc_start.c: main: 335 Additional information can be obtained by setting the --logfile and --logpriority options
What I am trying to achieve is: map CT uids 1000-65535 to 1000-65535 on host and map CT gid 100 to 100 on host. Other ids would be shifted by usual 100000.
Relevant config files sections:
/etc/pve/lxc/303.conf said:lxc.idmap: u 0 100000 1000
lxc.idmap: u 1000 1000 64535
lxc.idmap: g 0 100000 100
lxc.idmap: g 100 100 1
lxc.idmap: g 101 100000 65434
/etc/subuid said:root:100000:65536
root:1000:64536
/etc/subgid said:root:100:1
root:100000:65536
I feel this is some kind of one-off problem, and probably something I'd be ashamed to see explained -- but I fail to recognize the reason.