-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
containers: reload fails with user namespace enabled #57087
Comments
Further tests shows that adding
The reason for these errors, I think, I that /nix has owner Here is the code that bind mounts nix store inside the container: nixpkgs/nixos/modules/virtualisation/containers.nix Lines 123 to 132 in 37694c8
|
Considering that systemd-nspawn |
had issues with enabling user namespaces when working on my own take on Basically the way we mount nix store and gcroots doesn't work well with user namespaces So I came to the same conclusion that unpriveleged NixOS containers isn't possible |
@arianvp thanks for the input! It's unfortunate that this is the case. During my tests so far everything works correctly as long as you stop and start containers when configuration changes instead of reloading them. So I'm considering if that's an acceptable compromise for me to get containers with user namespace :) |
If you're not interested in nix commands working inside the container, and only are interested in declarative containers , then unpriveleged containers should work I think |
Yes, that's my use case exactly -- fully declarative containers, so read-only store should be enough. I checked the module you linked and it looks pretty good, are you planning to create a PR to push it upstream at some point? :) As far as I can tell, it's much easier to customize it (e.g. add or remove bind mounts and change other parameters of nspawn) than in the current containers module. |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
Issue description
Reloading of containers fails with:
I think it's connected to #57083 because adding
-U
to nsenter command seem to fix an error (not 100% sure yet).Steps to reproduce
configuration.nix:
Technical details
The text was updated successfully, but these errors were encountered: