You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
extra-container destroy demo outputs Operation not permitted #4
On a NixOS 26.05 aarch64 system, I have installed extra-container using the "With flakes" installation from the README (both the overlay and non-overlay methods.)
When I try to follow the instructions in the sudo extra-container create example in the README, everything seems to be working, but when I use sudo extra-container destroy demo, I get the following output:
$ sudo extra-container destroy demo
rm: cannot remove '/var/lib/nixos-containers/demo/var/empty': Operation not permitted
umount: /var/lib/nixos-containers/demo: not mounted
rm: cannot remove '/var/lib/nixos-containers/demo/var/empty': Operation not permitted
The container no longer shows up in nixos-container list, but the empty directory /var/lib/nixos-containers/demo/var/empty/ is not removed.
root cause: clearContainerState calls chattr to clear the immutable flag on /var/empty but ignores failures; and extra-container doesn't install chattr.
I actually had a test to test the commands in README, but the test used my PATH, which masked the bug. If you don't have e2fsprogs installed (and don't have ext2/3/4 in use), you may not have chattr in your PATH in which case destroy would fail.
Nix is supposed to avoid those works-on-my-machine problems!
Fixes:
add e2fsprogrs to extra-container's PATH (and the devShell).
make the test run in a VM to get a clean path.
verify the container is fully removed after destroy
Activity
stevelr commentedon Oct 16, 2026
Thanks for the report!
root cause:
clearContainerStatecallschattrto clear the immutable flag on /var/empty but ignores failures; and extra-container doesn't installchattr.I actually had a test to test the commands in README, but the test used my PATH, which masked the bug. If you don't have e2fsprogs installed (and don't have ext2/3/4 in use), you may not have
chattrin your PATH in which case destroy would fail.Nix is supposed to avoid those works-on-my-machine problems!
Fixes:
stevelr commentedon Oct 16, 2026
btw,
nixos-container destroyhas the same bug: it would fail if e2fsprogs is not installed. I'll file an upstream PR.Update: upstream PR NixOS/nixpkgs#574683
stevelr commentedon Oct 16, 2026
Fix is in main. I'll close this after a release is tagged.
nixos-container: use chattr from e2fsprogs
nixos-container: use chattr from e2fsprogs
stevelr commentedon Nov 3, 2026
fixed in extra-container-1.0.1 (Release) and on main.
Upstream PR for nixos containers has been merged.