yet another lxc bind mount dump question

proxman4

Member
Mar 23, 2020
23
2
23
25
Hi friends hope you're doing well.

After reading this very usefull (not enough for my dumb person) explanation on bind mounts for unprivileged containers on proxmox ( + this ) i got this silly question.

i always need a real life example.

Hope some cool person will kindly give me a hint.

I got a zfs dataset on host:

Code:
opyhdd/nextcloud_data                       1.49T  2.90T     1.49T  /mnt/pve/nfs/opyhdd/nextcloud_data

it is used as a nfs server to share to some vm guests. It has those permissions in the host www-data =uid 33 :

Code:
drwxrwx---  6 www-data www-data  8 Sep 13  2022 nextcloud_data

and those in the guest vm (not lxc) www-data =uid 33 :

Code:
rwxrwx---  6 www-data www-data    8 sept. 13  2022 nextcloud-data

I need to share this dataset with an unprivileged lxc container .

let's say i have administrator user with uid/gid : 1000 in the unprivileged lxc :

Code:
useradd -u 1000 -m -s /usr/bin/bash administrator

if i understand correctly i need to change the permissions on the host :

Code:
chown -R 101000:101000 mnt/pve/nfs/opyhdd/nextcloud_data

that look fun and all but is it risky at some point to break the nfs server and the permissions on the guest vm ?

i'm too lazy to mount some lab to try this out and figured that someone got a really quick and dirty answer for me.

Thank you and have a nice day.
 
Last edited:
Hi friends hope you're doing well.

After reading this very usefull (not enough for my dumb person) explanation on bind mounts for unprivileged containers on proxmox ( + this ) i got this silly question.

i always need a real life example.

Hope some cool person will kindly give me a hint.

I got a zfs dataset on host:

Code:
opyhdd/nextcloud_data                       1.49T  2.90T     1.49T  /mnt/pve/nfs/opyhdd/nextcloud_data

it is used as a nfs server to share to some vm guests. It has those permissions in the host www-data =uid 33 :

Code:
drwxrwx---  6 www-data www-data  8 Sep 13  2022 nextcloud_data

and those in the guest vm (not lxc) www-data =uid 33 :

Code:
rwxrwx---  6 www-data www-data    8 sept. 13  2022 nextcloud-data

I need to share this dataset with an unprivileged lxc container .

let's say i have administrator user with uid/gid : 1000 in the unprivileged lxc :

Code:
useradd -u 1000 -m -s /usr/bin/bash administrator

if i understand correctly i need to change the permissions on the host :

Code:
chown -R 101000:101000 mnt/pve/nfs/opyhdd/nextcloud_data

that look fun and all but is it risky at some point to break the nfs server and the permissions on the guest vm ?

i'm too lazy to mount some lab to try this out and figured that someone got a really quick and dirty answer for me.

Thank you and have a nice day.
i put this question in wrong categorie. If some @mod would be kind enough to fix this. Thanks
 
i put this question in wrong categorie. If some @mod would be kind enough to fix this. Thanks
gladly done!

As for your question - If you want to use a share both inside a unprivileged container as well as on your host (or privileged container, or with a local user on your nfs-server) - mapping the particular UID/GID the files are stored with - with lxc.idmap entries and the fitting entries in /etc/subuid, /etc/subgid - as explained in https://pve.proxmox.com/wiki/Unprivileged_LXC_containers
might be a good starting point.
 
Thank you for this . Sorry for the other time dimension delay. I'll dig this a little more to get a fonctionnal setup.
 

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!