If you’re trying to figure out why you are getting NFS errors despite having NFS set up properly on the host machine and client VM, this may be the answer. With the VM powered off, run at the Proxmox terminal:
vzctl set [VM ID] --features "nfs:on" --save
The next time the VM is powered up NFS should be enabled and you should be able to mount shares correctly. An example:
vzctl set 104 --features "nfs:on" --save
We were asked how to set up a Fedora 20 virtual machine to access folders on an already-set-up Ubuntu Server machine using NFS. A folder has been created on the Fedora VM to mount the NFS share to (/opt/documents in this case). First we install the relevant packages on Fedora:
sudo yum install nfs-utils nfs-utils-lib
Examine the package list, and if nothing looks awry hit Y to install. Now edit your fstab and add this line to the bottom to automount the shares:
[ip.of.nfs.server]:[absolute-path-to-share] [absolute-path-to-fedora-mount-point] nfs auto 0 0
e.g., in this example:
10.1.1.3:/tank/documents /opt/documents nfs auto 0 0
To break this down: the static IP address of the NFS server is 10.1.1.3, the path on the Ubuntu machine to the share is /tank/documents, and the created directory to mount the NFS share to is /opt/documents on the Fedora VM. To mount everything in fstab, run:
Then navigate to the /opt/documents directory and check that you can read/write onto the NFS share correctly. Reboot the server to make sure everything works OK and you should be done!
Once you set up your NFS exports by adding lines to /etc/exports you need to restart your NFS server; do this with the following:
sudo /etc/init.d/nfs-kernel-server restart
You should see output along the lines of:
* Stopping NFS kernel daemon [ OK ]
* Unexporting directories for NFS kernel daemon… [ OK ]
* Exporting directories for NFS kernel daemon…
exportfs: /etc/exports : Neither ‘subtree_check’ or ‘no_subtree_check’ specified for export “10.1.1.87/24:/nfs/sharedDir”.
Assuming default behaviour (‘no_subtree_check’).
NOTE: this default has changed since nfs-utils version 1.0.x
Assuming no error messages pop up here you should now try to connect to your NFS share.