-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Set Up Private Mount Namespace #2404
Comments
I think there are a few different points that can disable user namespaces even when Linux was compiled with their support. You can try one of these to see if they help (as root):
or
or
|
You probably don't use it given the recent drama around it, but grsecurity also disables unprivileged user namespaces by default. |
Setting |
I am having this error on RHEL 7.4, where I am not root and cannot request root rights. I installed |
You should be able to turn off sandboxing. Because you’re already in proot it should give you an okay sandbox already. |
Could you explain how I can turn off sandboxing? Also, ideally, I would prefer to avoid having to use |
To turn off sandboxing you should just need to pass this to the nix-build command:
You can also put that option in the ~/.config/nix/nix.conf like this:
User namespaces are the best option for this case. If you aren't able to do that, I think proot is the only real alternative. It's a hack but works in lots of cases. You can also try setting NIX_STORE_DIR=$HOME/nix when you build nix. I'm not sure if that still works, but that could at least avoid some of the issues. The issue with doing this is you can't use the official binary cache and will need to rebuild everything. |
@Pastafarianist provided that you can update your kernel boot parameters, you can get nix sandboxes working just fine in RHEL 7.4. You do not need to modify or recompile anything on the system. See here for details: lucabrunox/nix-user-chroot#9 (comment) Of course, someone with root will need to update the system to enable this, which might be a non-starter for you. Though it's worth mentioning once they do so, a completely unprivileged user can use the nix sandboxes without any special setup. |
@bhipple thank you! Unfortunately, my priorities have shifted now and I am no longer trying to get nix to work on the server that I mentioned. If I ever get around to this again, I will look into getting root access, changing kernel parameters and rebooting (that last one is the hardest, actually). |
I'm trying to execute the following command from the Nix Installation Guide, but it is producing an error:
error: setting up a private mount namespace: Operation not permitted
.This is likely due to the call to
unshare
here. It seems that something as simple asunshare -r whoami
is failing withunshare: unshare failed: Operation not permitted
.The system is Arch Linux on kernel 4.18.5, and
zgrep CONFIG_USER_NS /proc/config.gz
returnsCONFIG_USER_NS=y
, indicating user namespace support.Nix Version: 2.0.4
The text was updated successfully, but these errors were encountered: