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!
If you are coming to Fedora from Ubuntu you may be surprised that installing the package doesn’t automatically start the SSH daemon on boot. We can change this with the following command, run as root:
systemctl enable sshd.service
The next time you boot your SSH server should have started automatically.