To totally unlock this section you need to Log-in
Login
Setting up the server as the base operating system for the NFS server, we used a virtual machine with 2 vCPUs with 16GB of RAM running on a ESXi 6.5 host running Windows Server 2012 R2 Essentials.
After logging into Windows Server 2012 as Administrator, launch Windows Server Manager by typing "ServerManager.exe" in the Run command window. We then click the Manage tab and clicked Add Roles and Features.
Once in the Roles and Features Wizard, we clicked Next, selected Role-based or feature-based installation, clicked Next, clicked Next again, expanded the File and Storage Services, expanded File and iSCSI Services, checked the Server for NFS checkbox, and clicked Next.
When the "Add features that are required for Server for NFS?" dialog box appeared, we clicked Add Features, then Next, and lastly Install. It took about one minute for the NFS feature to finish installing, including a required reboot.
After Windows Server 2012 restarted, we logged back in and added an NFS share.
First we created a new folder on my desktop called "NFS01", right-clicked the NFS01 folder, clicked Properties, selected the NFS Sharing tab, clicked the Manage NFS Sharing button, checked the Share this folder check box, clicked the Permissions button, checked Allow root access, clicked OK, then Apply, and finally OK .
Connecting a Linux System
After we set up the NFS server, Iwe initially tested it by connecting to it from a Linux system (Ubuntu 14.04) by doing the following: we first became the root user, then created a mount point, mounted the NFS filesystem on the mount point, listed the NFS filesystem, created a new file, listed the file, changed back to my home directory, unmounted the NFS filesystem, listed the file directory (which was now empty), remounted the NFS filesystem and listed the file again.
We completed these steps using the commands shown in following figure. If you want to have the NFS filesystem mounted every time that you boot the server, you can put an entry in the /etc/fstab file on the Linux server/client.
Usually the quick sequence to enable and check an NFS share will be the following:
- Log onto a Linux server or desktop.
- Open a terminal window, if you are in a Desktop version of the operating system.
- Create a new directory to mount the Windows NFS share.
mkdir /postprod
Mount the NFS share to the new directory:
mount.nfs slfileserver01:/postprod /postprod
If the client has read/write access, test the share by creating a new file:
touch file01.txt
Connecting an ESXi Host
Since we had an NFS share mounted, we decided to try and attach it to an ESXi server.
Note: VMware does not endorse, recommend or support using Windows 2012 NFS as a datastore on ESXi, and it's not on their Hardware Compatibility List (HCL). The instructions here are to show that it can be done, not that it should be done.
We mounted the NFS filesystem on our ESXi 6.5 host from a vCenter 6.5 Web Client without any problems by opening the vSphere Web Client, from where we selected Storage, right-clicked the Datacenter, then selected Storage > New Datastore.
From the New Datastore Wizard, we clicked Next, selected NFS, clicked Next, selected NFS 4.1, clicked Next, supplied the name of the NFS filesystem and the IP address of the NFS server, clicked Next, clicked Next again, selected the ESXi hosts that would have access to the NFS filesystem, clicked Next, and clicked Finished (the steps are shown in 6).
The NFS share then appeared in our vSphere Web Client.
In total, it took less than 5 minutes to create an NFS server on our Windows 2012 R2 Essentials server. We could mount its NFS share to a Linux system and use it as an archive repository for vRealize Log Insight (vLRI). We were even able to mount it to our ESXi host without any issues, although VMware does not officially support using it as a datastore.