Open atondwal opened 7 years ago
I guess you need to give docker somehow more privileged permissions... or perhaps it might not work at all inside another container.
The problem isn't docker; I get the same problem on bare metal . I just dockerized it to make it easy to reproduce.
On Oct 3, 2017 05:59, "Luca Bruno" notifications@github.com wrote:
I guess you need to give docker somehow more privileged permissions... or perhaps it might not work at all inside another container.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lethalman/nix-user-chroot/issues/9#issuecomment-333833723, or mute the thread https://github.com/notifications/unsubscribe-auth/AAU8COOXR1HGsZodx1qZLumWi9rrq3T1ks5soi-6gaJpZM4Pp-ZX .
@atondwal, is it possible that this issue is caused by not having a kernel with support for userspaces as described in the README.md? You can use uname -a
to show the kernel version, it should be >=3.8.0.
I'm getting the same issue on a 64-bit CentOS 7 box with kernel 3.10.0-693.
Had the same issue on arch.., It's because the arch-kernel has user namespaces disabled for security reasons (?) you might need to use a custom kernel which has said module enabled
I am seeing the same issue on RHEL 7.4. Output of commands from Nix wiki:
$ unshare --user --pid echo YES
unshare: unshare failed: Invalid argument
$ unshare --user echo YES
unshare: unshare failed: Invalid argument
$ unshare --pid echo YES
unshare: unshare failed: Operation not permitted
$ unshare echo YES
YES
$ grep CONFIG_USER_NS /boot/config-$(uname -r)
CONFIG_USER_NS=y
You cannot use usernamespaces as unprivileged user on either Archlinux, Centos, Redhat or Fedora. They don't allow it in their kernel. You will need to recompile the kernels on those machines. This issue can be closed.
This actually does work in RedHat / CentOS 7.4, but there are two steps:
user_namespace.enabled=1
# echo 15000 > /proc/sys/user/max_user_namespaces
If you do both of these things, then it'll work:
$ uname -sr
Linux 3.10.0-693.1.1.el7.x86_64
$ unshare --user --pid echo YES
YES
$ unshare --user echo YES
YES
$ unshare echo YES
YES
This can also be reproduced with docker:
(The docker image was created with:
)