lxc PUID and PGID mappings.

HomeLabNerd

New Member
Sep 9, 2023
24
0
1
Hi, I 'm trying to understand LXC PUID and PGID mappings but I can use some help.

I want to map the PUID and PGID of an LXC container to PUID 99 and PGID 100 on my NAS.

How is that done? I did read some post but is is still difficult to understand.
 
Yes that lower part of the page.

I've read that page this morning and some forum post but I can't figure out how this works.

Also tried some thing with a LXC container but when I add rules I doesn't start so I guess I'm doing it wrong..
 
Last edited:
By default all UID/GID 0 to 65535 from the host are mapped to UID/GID 100000 to 165535 inside the LXC but shown inside the LXC as 0 to 65535 while they actually are 100000 to 165535.
So you usually want to keep most of those mappings except for the few ones where you want that host and LXC use the same UID/GID for bind-mounting.
Make sure to really map all those 65536 entries without missing one or mapping too many.

Without specific question its hard to help.
 
I have on my nas PUID 1000 and PGID 100. I want to have the right permissions so the LXC container can comunicate to the NAS without problems. I have a bind mount in place.

Code:
mp1: /mnt/pve/data_nfs,mp=/data

Code:
nobody:x:99:100:nobody:/:/bin/false



Now I need to set the right lxc.idmap but confused how it works. Hope it make a bit sense...
 
Last edited:
Did some investigation.

I use the Proxmox helper scripts and it seems that the app installed runs as root. I also checked the default install way and it installs as an unprivileged container. I'm new to Proxmox so I have to do some experimenting sometimes. I'm not sure how to handle to be honest. If it runs as root what is the best solution..
 

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!