If you have an unprivileged container. You must map the ID's.
https://pve.proxmox.com/wiki/Unprivileged_LXC_containers
I'm also struggling with this... I've mounted internal host drives into my LXC containers for years with a simple
pct set
command, but this is the first time I've tried to mount an external USB drive and I've encountered the
nobody:nogroup
issue. So I'm trying to map the ID's but I'm having a hard time following the documentation...
First I add the bind mount to my external drive:
pct set 1234 -mp0 /mnt/Lacie,mp=/mnt/Lacie,backup=0
But I'm scratching my head with the ID mapping part... My user inside the LXC container is
root
. When I edit my
/etc/pve/lxc/1234.conf
file, I'm not quite sure what to add there. The documentation's example is this:
lxc.idmap = u 0 100000 1005
lxc.idmap = g 0 100000 1005
And then on the host(?), adding
root:1005:1
to both
/etc/subuid
and
/etc/subgid
I've tried several permutations of IDs to try to make it work, but can't quite seem to figure it out. I know that the host adds 100000 to the container's UID/GID for separation/safety. But I guess I'm not quite grasping everything... The user on the host that owns the external drive and all files is
root
.
Any help would be appreciated! I may be crossing some safety issue here, trying to get the container to write to the drive as host's root... Many thanks in advance!
-John