-
-
Notifications
You must be signed in to change notification settings - Fork 13.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
nixos-container with user namespace enabled #57083
Comments
This is the first step for unprivileged nixos containers support. Fixes NixOS#30019. See also NixOS#18825, NixOS#57083, and NixOS#67130.
Hello, I'm a bot and I thank you in the name of the community for opening this issue. To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them. Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel. |
I'm pretty sure this is still an issue since #67332 was reverted. |
I marked this as stale due to inactivity. → More info |
still an issue |
I think the most recent effort related to this is happening here: #69414 (comment) |
I marked this as stale due to inactivity. → More info |
Issue description
When a container is created with
extraFlags = [ "-U" ]
(user namespace), nixos-container command doesn't behave correctly. In particular, it doesn't enter a container user namespace (note UID/GID):This happens due to the missing argument (-U) to nsenter command:
nixpkgs/pkgs/tools/virtualization/nixos-container/nixos-container.pl
Line 264 in 92a047a
Running nsenter manually with -U added fixes the issue:
This also afects
nixos-container login
command.machinectl shell my-container
works as expected btw.nixos-container
command among other things is used to reload containers on configuration change and I'm not sure if it will behave correctly when it doesn't use the correct user namespace.Steps to reproduce
Declare minimal container with user namespace enabled in configuration.nix:
Run
nixos-container login
ornixos-container run
commands.Technical details
The text was updated successfully, but these errors were encountered: