LXC Group Mapping

548901239

Member
Jan 16, 2022
3
0
6
45
Hi, I'm having trouble configuring group mapping for zfs mount access in my unprivileged LXC.

I have a directory /zpool/media/ on the host which I passed to the container with a mount point at /mnt/media.

On the host:
  • The directory is owned by user root (uid=0) and group media (gid=1000).
  • Permissions are 770 on the directory
  • I have created user jellyfin (uid=1100) which is a member of the "media" group
On the LXC guest:
  • I am using the root user.
  • uid 0 (root) is mapped to uid 1100 on the host (jellyfin user)
  • I have created a group media here as well with gid=1000 and added the root LXC user to it
  • gid 1000 (media) is mapped to gid 1000 on the host (media group)
With all of this configured, I can see the mount point inside the LXC with the correct group permission. However I am unable to enter the directory. Am I missing anything else? I created a test directory inside the LXC with the same permissions and I can enter that one.

rich text editor image

My uid/gid mapping in the lxc config:

lxc.idmap: u 0 1100 1
lxc.idmap: u 1 100000 65535
lxc.idmap: g 0 100000 1000
lxc.idmap: g 1000 1000 1
lxc.idmap: g 1001 101001 64534
If I map the root group (gid=0) in LXC to media group on the host it works. However I would like to get this working from the media group inside the LXC.