Setup NFS Shares for Citrix XenServer and VMware ESXi

This post will cover a setup of a NFS shares for Citrix XenServer and VMware ESXi. The Linux distribution will be used here is CentOS 5.1 64-bit. I will not cover the installation of NFS in CentOS 5.1 64-bit because I assume you have a working NFS server. Lets begin.

1. Create two directories accessible to the clients (VMware ESXi and Citrix XenServer) using the following commands below: –

mkdir /data
mkdir /data/iso
mkdir /data/vm

2. We must “export” the directories created above to the clients. We allow read-only on /data/iso and read-write on /data/vm from the NFS server. Edit the file /etc/exports using the command below: –

vi /etc/exports

3. Next, include the following lines in the /etc/exportfs file (The no_root_squash option makes the directory only accessible as root.): –

/data/vm 192.168.1.1(rw,no_root_squash,sync) 192.168.1.2(rw,no_root_squash,sync)
/data/iso 192.168.1.0/24(ro,no_root_squash,sync)

4. Then, we can start the “nfs” and “portmap” service using the command below: –

service nfs start
service portmap start

5. We need to make sure the “nfs” and “portmap” service is started automatically for runlevels 3, 4 and 5 by using the commands below: –

chkconfig --level 345 nfs on
chkconfig --level 345 portmap on

6. We need to run the following command below whenever the /etc/exports file is changed: –

exportfs -a

7. You can print out the list of NFS exported file systems using the command below: –

exportfs

8. You will see the following output below: –

/data/vm 192.168.1.1
/data/vm 192.168.1.2
/data/iso 192.168.1.0/24

Finally, we are ready to go. I will blog about mounting a NFS shares in Citrix XenServer and VMware ESXi very soon. Please stay tuned.

If you found these helpful, please contribute to help: