Unprivileged LXC Mount Point Permissions

CompuTinker

New Member
Apr 8, 2017
2
0
1
124
So I read the wiki on the unprivileged container and mount points in regards to permissions but I was curious if there was an easier for my problem. In my container I just want to be able to chmod the mount point of owned files.

Essentially I have a NFS share mounted on in the VE and then a MP was created on my container.

Creating files on the mount point is no problem but once the file is on the MP, you cannot chown or chmod the file.

Is there a work around?
 
Perhaps I misunderstand your question/problem, but you could create a new group and set that as owner of the mount point and all files in it.
Give full permissions to the group and use "setgid" to make all new folders & files have the group as well, for example:
chown -R :group /nfsmount
chmod -R 2775 /nfsmount

I haven't used Unprivileged containers myself, so not sure if this will work or if there's a better way to do it.
Unfortunately I don't have an answer to why you're not able to chown or chmod the files (if you're using sudo).
 
So in the ProxMox Host setting permissions etc is no problem. Once inside the container you cannot modify any file attribute it maintains its created attributes. All the files in the mount point are 0777 but when you try and do a chmod or chgrp etc it gives you:

chmod: changing permissions of 'images/': Operation not permitted
 
Same problem here.
I mount a mergerFS.
The directories in the mergerFS mount are set to uid/gid 100000:100000 (host side).
Now I see the directories in the LXC and can write to them (as root).
But I have to change the owner in the container to 2001:2001. At the moment it's 0:0
But if I enter as root in the (container) terminal
chown -R 2001:2001 /home/data
comes the error message:
chown: changing ownership of '/home/daten': Operation not permitted
I need to change the owner in the host.
chown -R 102001:102001 mnt/home/data
The same thing happens with chmod 755 /home/data
/mnt/virt/data on host is 777
 
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!