Suppose you would like to set up a NFS server on your XenServer-running host for whatever reason, so that other hosts can mount a NFS share exported by the XenServer host.
A fresh installation of XenServer comes with NFS server already installed. So you do not need to install NFS server on your own, and just need to set up NFS export. In this tutorial, I will show you how to set up NFS export on XenServer. I assume that you want to export /export directory via NFS.
$ service portmap start
$ service nfs start
$ chkconfig portmap on
$ chkconfig nfs on
Now you need to perform one important last step to be able to export the XenServer host's local storage via NFS. By default, portmap on XenServer only binds to the loopback interface (by using "-l" option), so that NFS mount is only possible on loopback address, and no other external host can mount its storage via NFS. You can confirm this behavior as follows.
$ showmount -e 192.168.212.205 (which is the IP address assigned to XenServer host)
You will see that the first command will successfully show the export list for localhost, whereas the latter command will fail, due to the reason I mentioned, with the following message:
RPC: Port mapper failure - RPC: Unable to receive"
In order to remove this portmap restriction, modify /etc/sysconfig/portmap as follows.
After modification, restart NFS service.
$ service nfs restart
Check out again if the export is working okay by:
If it successfully shows the export list for the XenServer host 192.168.212.205, NFS-export is all set.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!