1

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`.

UPDATE

Example of export:

/mnt/data/www 192.168.0.0/24(rw,async,no_root_squash,no_subtree_check,insecure)

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.

  • 2
    Post the details of your NFS exports along with the errors you're getting. Without that, it's impossible to say how you should manage your permissions. – Andrew Henle Feb 3 '16 at 14:53
  • I have updated the original post. I will add specific permissions issue errors later as I cannot access them at the moment from my mobile. – Craig Lowe Feb 3 '16 at 15:01
1

If you use NFS v4 you can map UIDs. Otherwise, you need to make sure that user and group IDs are consistent across all your VMs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.