Free Hosting Online for WorkStations

< Previous | Contents | Next >

5.11. UID mappings and Privileged containers


By default, LXD creates unprivileged containers. This means that root in the container is a non-root UID on the host. It is privileged against the resources owned by the container, but unprivileged with respect to the host, making root in a container roughly equivalent to an unprivileged user on the host. (The main exception is the increased attack surface exposed through the system call interface)


Briefly, in an unprivileged container, 65536 UIDs are 'shifted' into the container. For instance, UID 0 in the container may be 100000 on the host, UID 1 in the container is 100001, etc, up to 165535. The starting value for UIDs and GIDs, respectively, is determined by the 'root' entry the /etc/subuid and /etc/subgid files. (See the subuid(5) manual page42.

It is possible to request a container to run without a UID mapping by setting the security.privileged flag to true:


lxc config set c1 security.privileged true


Note however that in this case the root user in the container is the root user on the host.


Top OS Cloud Computing at OnWorks: