Disable idmapped mount of the container rootfs

I am trying to make use of the kernel overlayfs inside of an unprivileged container.
The rootfs of the container is an idmapped mount but that prevents overlayfs from working.
overlayfs: idmapped layers are currently not supported

I am aware that will be allowed in kernel 5.19 but for now, I would like to make this container chown the rootfs.

Is there any setting that can be used to disable idmapped mount for the rootfs (force Remapping container filesystem (chown) on idmap capable storage like btrfs).

5.18.3-arch1-1
lxd 5.2

There is an environment variable that can be passed to LXD by adding an override in its systemd unit. LXD_IDMAPPED_MOUNTS_DISABLE=1

Alternatively, if it’s just for one path, say /var/lib/docker, you can create a storage volume using lxc storage volume create and then attach that to /var/lib/docker.
That volume will not be using idmap shifting unless you set security.shifted=true on it.

2 Likes