Messages in this thread | | | Date | Wed, 14 Feb 2018 15:54:42 +1100 | From | Aleksa Sarai <> | Subject | Re: plan9 semantics on Linux - mount namespaces |
| |
On 2018-02-14, Enrico Weigelt <lkml@metux.net> wrote: > On 13.02.2018 22:27, Aleksa Sarai wrote: > > > You can do this by creating a new user namespace (CLONE_NEWUSER), which > > then gives you the required permissions to create other namespaces > > (CLONE_NEWNS). This is how "rootless containers" or unprivileged > > containers operate. > > hmm, unshare -U doesn't work for me (even as root). But docker works, > so user namespaces should be working. Any idea what could be wrong ?
It depends how old your kernel is and what distro you use. Arch Linux disables user namespaces entirely, Debian requires that you set a sysctl to enable unprivileged user namespaces, and RHEL requires you to set both a sysctl and a kernel boot-flag. Also check how old your kernel is (unprivileged user namespace support was added in 3.8).
Also Docker doesn't use user namespaces by default (you need to manually enable it with --userns-remap, check the docs for more details). You probably also want to be using "unshare -r" in your testing (as "unshare -U" will leave you without mapped users).
-- Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH <https://www.cyphar.com/> [unhandled content-type:application/pgp-signature] | |