I was writing a response to another thread and some error occurred and I can no longer find the post.
This is not a question but may be useful for anyone else who may be attempting to add a network share within an unprivileged container as a mount point and wish to gain write access permissions.
I had earlier needed to do this with CIFS, but now am using NFS needed to accomplish the same access. This should be similar for other network shares.
The issue with an unprivileged container and mount point permissions is in the nature of the unprivileged container's altered uid/gid of root which do not match up with root on the host or share.
Mounting the share with unprivileged container UID/GID will give them write permissions inside the privleged container.
Network Share Server
chown the share directory:
(May require recursive if your share is not empty)
NFS Server
edit your /etc/exports:
On PVE Datacenter, add NFS storage as usual.
CIFS/SMB
Modify /etc/fstab on each PVE node:
Remount FSTAB mounts
Container Config
edit lxc config on PVE node /etc/pve/lxc/XXX.conf; add
This is not a question but may be useful for anyone else who may be attempting to add a network share within an unprivileged container as a mount point and wish to gain write access permissions.
I had earlier needed to do this with CIFS, but now am using NFS needed to accomplish the same access. This should be similar for other network shares.
The issue with an unprivileged container and mount point permissions is in the nature of the unprivileged container's altered uid/gid of root which do not match up with root on the host or share.
Mounting the share with unprivileged container UID/GID will give them write permissions inside the privleged container.
Network Share Server
chown the share directory:
(May require recursive if your share is not empty)
chown 101001:101001 /path/to/share
NFS Server
edit your /etc/exports:
# If present: remove no_root_squash
# Include all_squash,anonuid=101001,anongid=101001
/path/to/share 10.10.0.0/24(rw,async,insecure,all_squash,anonuid=101001,anongid=101001,no_subtree_check)
On PVE Datacenter, add NFS storage as usual.
CIFS/SMB
Modify /etc/fstab on each PVE node:
# Your CIFS options may vary, include uid=101001,gid=101001
//servername/sharename /path/to/mount cifs username=USER,password=PASSWORD,uid=101001,gid=101001,iocharset=utf8,noperm 0 0
Remount FSTAB mounts
mount -a
Container Config
edit lxc config on PVE node /etc/pve/lxc/XXX.conf; add
mp0: /path/to/host/share,mp=/path/to/mount