NFS mount inside an unprivileged container

Oct 3, 2019
18
0
6
33
Hello,

I have an NFS share mounted to proxmox host and I want to mount that share from host to an unprivileged container.
So I added a line "mp0: /location/on/host,mp=/location/on/container"
In privileged mode everything works and permissions are ok.
When I switch to unprivileged mode permissions become "nobody:nogroup".

Should I manually add mapping to the config?
I tried adding mapping like it's explained here: https://pve.proxmox.com/wiki/Unprivileged_LXC_containers
Code:
lxc.idmap = u 0 100000 65536
lxc.idmap = g 0 100000 65536

But it didn't change anything.

Am I doing something wrong and is it even possible to mount NFS inside an unprivileged container with normal uid/gid mappings?


Thank you for all the suggestions in advance
 
hi,

you have to change the owners of the files, so that the unprivileged mapped uid/gid can access it.
 
hi,

you have to change the owners of the files, so that the unprivileged mapped uid/gid can access it.

Hello oguz!
Thank you very much for the reply!

So that would mean I won't be able to use that shared directory from the host itself, right?
Is there a way I can use it on both proxmox host (where uid/gid would be from 0 to 65536) and inside the containers (where uid/gid would be from 100000 to 165536)?