I recently changed my home server setup from a basic Ubuntu Server installation running everything to a virtualised environment. I am currently running ProxMox type 1 hypervisor, with several VM's. Most of my services are run in Linux Containers (LXC), some of these services need access to a shared dataset. In order to provide access to the shared data set, I passed the data HDD through to a VM and then setup NFS exports. The LXC's then mount the NFS shares. However I am constantly coming across user permissions errors from different services. How can I easily manage these permissions across multiple LXC's without just setting everything to 777`.
Example of export:
Example of mount in fstab:
192.168.0.254:/mnt/data/www /mnt/www nfs auto,x-systemd.automount,soft,rsize=16384,wsize=16384,timeo=14,intr 0 0
The errors are in the form of permissions denied, as one LXC may create a file under the user www-data, but another LXC cannot access the file as it shows up as being owned by MySQL, I understand this is because of mismatching UID's, but I can't figure out how to solve the problem.