pyxis: allow unprivileged user namespaces so enroot works on Ubuntu 23.10+ - #1392
Open
100milliongold wants to merge 1 commit into
Open
pyxis: allow unprivileged user namespaces so enroot works on Ubuntu 23.10+#1392100milliongold wants to merge 1 commit into
100milliongold wants to merge 1 commit into
Conversation
…3.10+ Ubuntu 23.10 and later ship with kernel.apparmor_restrict_unprivileged_userns=1. Under that default, enroot-nsenter fails when pyxis starts a container: enroot-nsenter: failed to create user namespace: Permission denied The nvidia.enroot galaxy role does not handle this, and DeepOps lists Ubuntu 24.04 LTS as a supported OS, so container jobs are broken out of the box on a supported platform. Add a sysctl task on compute nodes, gated on the presence of the knob in /proc rather than on the distribution version, so it is a no-op on kernels built without AppArmor userns restrictions. Observed on DGX OS 7.5.0 (Ubuntu-based) with Slurm 26.05.1 and pyxis 0.11.1: srun --container-image=... failed with the message above until the sysctl was set. Signed-off-by: Jea-Eok-Kim <je.kim@xiilab.com>
100milliongold
marked this pull request as ready for review
September 4, 2026 00:13
dholt
requested changes
Sep 4, 2026
dholt
left a comment
Contributor
There was a problem hiding this comment.
Please replace the unconditional host-wide sysctl change with a narrowly scoped AppArmor policy for enroot-nsenter and provide evidence from a real Pyxis/Enroot container launch on an affected supported OS. If a global sysctl fallback is still needed for unusual installations, make it an explicit, documented, default-off administrator choice rather than changing the security default whenever the kernel knob exists.
Automated triage review (agent-generated on the maintainer's behalf; a human maintainer decides merges).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Ubuntu 23.10 and later set
kernel.apparmor_restrict_unprivileged_userns=1by default. Under that default,enroot-nsenterfails as soon as pyxis starts a container:The
nvidia.enrootgalaxy role does not handle this, and DeepOps lists Ubuntu 24.04 LTS as a supported OS, so container jobs do not work out of the box on a supported platform.Observed on DGX OS 7.5.0 (Ubuntu-based), Slurm 26.05.1, pyxis 0.11.1.
Fix
Add a sysctl task in
roles/pyxisfor compute nodes. The task is gated on the presence of/proc/sys/kernel/apparmor_restrict_unprivileged_usernsrather than onansible_distribution_version, so it is a no-op on kernels built without AppArmor userns restrictions and does not need updating for future releases.Note on hardening
This relaxes a system-wide hardening default: unprivileged user namespaces are what AppArmor is restricting here. A narrower alternative is an AppArmor profile scoped to
enroot-nsenter(as packaged by some distributions for other userns consumers). If maintainers prefer that approach, I am happy to rework the patch.The sysctl is written to
/etc/sysctl.d/60-enroot-userns.confso it is visible and revertible, rather than being applied only at runtime.