LXC Bind mount points shared with a group rather individual users?

esologic

New Member
May 3, 2021
3
0
1
30
I'm trying to share a directory on my host with an LXC container. I found this guide: https://pve.proxmox.com/wiki/Unprivileged_LXC_containers

From what I can tell, this looks like for every user I create inside of the LXC container, I have to repeat the process to add them to read/write access for the shared directory.

This isn't ideal for my use case. Would it be possible to create a group on the host, a mapping to this group inside the container, and then create new users within that group inside of the container that would all have read/write permissions to my shared directory by virtue of being in the special group?

Thank you.
 
Yes this is actually set up in the instructions you linked. In that tutorial, the 'g's in the mapping map that gid on the host system to the guest. And appending the line to /etc/subgid allows whatever group you stated to operate under that id.
 
This idmapping did not work for me at all. At one point the whole server crashed.

What is the minimal config to have one user in a n lxc container write to a mounted disc.
I only care about the lxc id. What ever id are used on the host is fine.