Open vindicatorr opened 10 months ago
it only does this if the root inode of your rootfs is not owned by root of the container. If the root fs is properly owned nspawn won't recursively chown. It also doesn't do it if if can use idmapped mounts (which is only available for overlayfs in very recent kernels).
hence: either fix your root fs, or live with the recursive chowning, or use a very recent kernel?
Sorry, but I'm not quite following here as to what I need to be doing... Kernel: 6.5.0-dirty //should be available ("5.12"*https://lwn.net/Articles/896255/)? util-linux: 2.39.3
Root of the container should still be UID==0, and that would pair with my host root UID==0 as well. You're specifically mentioning "inode" which is making me think I'm missing something in my checks here...
$ ls -laid /
3 drwxr-xr-x 18 root root 4096 Dec 28 22:57 /
$ ls -laid ./deleteThis/testRoot
149607445 drwxr-xr-x 1 root root 122 Jan 2 10:32 ./deleteThis/testRoot
$ ls -laid ./deleteThis/testUpper
149607451 drwxr-xr-x 1 root root 0 Jan 2 10:31 ./deleteThis/testUpper
If it's a lack of understanding of the topic on my part, I'm open to being pointed to a man/link where I can learn more about it.
systemd version the issue has been seen with
255
Used distribution
Arch Linux
Linux kernel version used
6.5.0-dirty
CPU architectures issue was seen on
x86_64
Component
machinectl
Expected behaviour you didn't see
File and directory ownership remains as-it-was.
Unexpected behaviour you saw
File and directory ownership changed as if
--private-users
was being used.Steps to reproduce the problem
Init:
Scenarios: Fail - Overlay Mount - Machinectl:
Success - Overlay Mount - Systemd-Nspawn:
Success - Mount - Machinectl:
Cleanup:
As awesome as the idea is, I've already been seeing how messy/problematic overlays can be (mainly with nspawn) which is why I opted to manually make them, in addition to idmapping simply not working with them for some reason (noted in other open issues here).
Additional program output to the terminal or log subsystem illustrating the issue
EDIT0: I just noticed machinectl runs
systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-veth -U --settings=override --machine=testMount
, and I'm seeing the-U
is apparently default (which would explain the chowning since it can't map an overlay).