unprivileged container questions - uid range on host

hxdai

Member
Oct 3, 2019
4
1
8
Hi,
I have a question regarding UID/GID mapping for unprivileged containers after reading the wiki page(https://pve.proxmox.com/wiki/Unprivileged_LXC_containers):

1: Document says for a lxc, its uid/gid is mapped to host uid/gid starting at 100000. If I create 2 containers(call them ct0 and ct1), would ct1's uid/gid also map to host uid/gid starting at 100000? or would it follow ct0's range? i.e. is the following table correct?
containercontainer uid/gidhost uid/gid
ct00 - 65535100000 - 165535
ct10 - 65535165536 - 231071
 
I see. Is it possible to map container's root(uid 0) to a normal user(uid 1000) in host? I tried that using lxc.idmap, container starts, but I wasn't able to login to container as root for some reason...
 
I see. Is it possible to map container's root(uid 0) to a normal user(uid 1000) in host? I tried that using lxc.idmap, container starts, but I wasn't able to login to container as root for some reason...
That should work the same way like its done in the linked wiki article (just with other numbers).