UID/GID mapping mostly working, still need some help

ptthstr

Member
Apr 4, 2021
2
0
6
44
Hi everyone,

So I've been following various tutorials and forum/Reddit posts regarding UID/GID mapping (including Proxmox's support page). I got it mostly working but there are still some things that don't work exactly as I would want.

I'll recap what I've done. On my host, I added the following to /etc/subgid:
root:1005:1

I also created the group lxc-user with GID 1005 and added root to it.

I created directory /rpool/media/data and ran the following:
Code:
chgrp 1005 /rpool/media/data
chmod -R g+rw /rpool/media/data
chmod g+s /rpool/media/data

In the settings of my LXC, I've added the following from the Proxmox help:
Code:
mp0: /rpool/media/data,mp=/mnt/media
lxc.idmap: g 0 100000 1005
lxc.idmap: g 1005 1005 1
lxc.idmap: g 1006 101006 64530

Within the LXC itself, I created group lxc-user with GID 1005 and added root to it.

Now if I create a a file called test.txt from the host, in the LXC if I do ls -l this is what I see:
Code:
-rw-r--r-- 1 nobody   lxc-user 6 May  2 07:24 test.txt

If I try to edit the file from the LXC, it tells me that it is unwritable. However, I am able to delete it.

If I create a file in the folder FROM the LXC, another LXC with the same bind mount will be able to edit it.

Any idea what I'm doing wrong here?

Thanks for your help!
 
Last edited:
You are only mapping the group (and not the user also) and the group has no write permission on that file (only the owner/user, which is not mapped hence the nobody).

Thank you for your help! Will make some adjustments tonight and report.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!