Mount host directory into LXC container with specific UIDs/GIDs

I think that should also work, you just have to map all 65535 UIDs/GIDs without mapping a single one twice or missing to map a UID/GID.
We are just too stupid to use the correct options to tell PVE to do that.

Maybe the "host" and "LXC" is switched on that Tool-Website?

I would think it should look like this:
Code:
# map 0-32 LXC to 100000-100032 Host
lxc.idmap: u 0 100000 33
lxc.idmap: g 0 100000 33
# map 33 LXC to 1000 Host
lxc.idmap: u 33 1000 1
lxc.idmap: g 33 1000 1
# map 34-65535 LXC to 100034-165535
lxc.idmap: u 34 100034 65502
lxc.idmap: g 34 100034 65502

Sub UID/GID:
Code:
root:100000:65536
root:1000:1
Which would be the opposite what the tool is telling me to do.
 
Last edited:
I think that should also work, you just have to map all 65535 UIDs/GIDs without mapping a single one twice or missing to map a UID/GID.
We are just too stupid to use the correct options to tell PVE to do that.

Maybe the "host" and "LXC" is switched on that Tool-Website?

I would think it should look like this:
Code:
# map 0-32 LXC to 100000-100032 Host
lxc.idmap: u 0 100000 33
lxc.idmap: g 0 100000 33
# map 33 LXC to 1000 Host
lxc.idmap: u 33 1000 1
lxc.idmap: g 33 1000 1
# map 34-65535 LXC to 100034-165535
lxc.idmap: u 34 100034 65502
lxc.idmap: g 34 100034 65502

Sub UID/GID:
Code:
root:100000:65536
root:1000:1
Which would be the opposite what the tool is telling me to do.
Thanks for the idea, but I tried on a new test container, and that is not working. The container doesn't want to restart... Look like it is only working when mapping an ID to the same ID... It is sad because on LXD / LXC that was working perfectly and very simply... And I did not had to manually transform in the container FS all the originals ID (from 100033 to 33). With LXD / LXC, I only had to enter TWO command :
Code:
lxc config device add nextcloud data_nextcloud disk source=/data/data_nextcloud path=/var/data_nextcloud
lxc config set nextcloud raw.idmap "both 1000 33"
lxc restart nextcloud