
Introduction
Network File System (NFS) datastores provide a flexible and cost-effective storage solution for VMware vSphere environments. This comprehensive guide demonstrates how to create an NFS datastore in vSphere, walking you through the entire configuration process from setting up your NFS server to mounting the datastore on ESXi hosts.
Whether you’re building a home lab or managing production infrastructure, understanding NFS datastore configuration is essential for VMware administrators. This tutorial uses real-world lab scenarios to illustrate best practices and common troubleshooting steps.
What is an NFS Datastore in vSphere?
An NFS datastore is a network-based storage repository that allows ESXi hosts to store virtual machine files, templates, and ISOs on a remote NFS server. Unlike block-based storage protocols like iSCSI or Fibre Channel, NFS operates at the file level, making it simpler to configure and manage.
Benefits of Using NFS Datastores
Cost-Effective Storage: NFS eliminates the need for expensive SAN infrastructure, making it ideal for small to medium environments and home labs.
Simplified Management: File-level access means easier provisioning, snapshots, and quota management compared to block-based storage.
Flexibility: NFS datastores can be shared across multiple ESXi hosts, enabling features like vMotion and High Availability without complex storage configurations.
Scalability: Adding storage capacity is straightforward—simply expand the NFS share on your storage server.
NFS Versions Supported by vSphere
VMware vSphere supports both NFS version 3 and version 4.1. NFS v3 has been the traditional choice for VMware environments, offering broad compatibility and proven reliability. NFS v4.1 introduces enhanced security features like Kerberos authentication, improved performance through session trunking, and better handling of network failures.
For most production environments, NFS v4.1 is recommended due to its security enhancements and performance improvements. However, NFS v3 remains a solid choice for lab environments and situations where simplicity is prioritized.
Prerequisites for Creating NFS Datastore
Before configuring your NFS datastore, ensure you have the following components ready:
Infrastructure Requirements
- VMware ESXi Host: A functioning ESXi server (version 6.5 or later recommended)
- vCenter Server: For centralized management (optional but recommended)
- NFS Server: A configured NFS server with adequate storage capacity
- Network Connectivity: All components must have network connectivity on the same subnet or with proper routing
Lab Environment Specifications
This tutorial uses the following lab configuration:
- ESXi Host IP: 192.168.91.129
- vCenter Server IP: 192.168.91.130
- NFS Server: Windows Server 2022 (IP: 192.168.91.131)
- Domain: vmorecloud.com
- NFS Share Path: To be configured
Network Configuration Best Practices
For optimal performance and security, consider these networking recommendations:
Dedicated Storage Network: Use a separate VLAN or physical network for storage traffic to prevent contention with VM traffic.
Jumbo Frames: Enable jumbo frames (MTU 9000) on storage networks to improve throughput for large data transfers.
Multiple NICs: Configure multiple network adapters for redundancy and increased bandwidth using NIC teaming.
Step-by-Step Lab Tutorial
Part 1: Configure NFS Server on Windows Server 2022
Windows Server 2022 can function as an NFS server, making it convenient for lab environments. Follow these steps to set up your NFS server.
Install NFS Server Role
- Log into your Windows Server 2022 machine (192.168.91.131)
- Open Server Manager
- Click Manage → Add Roles and Features
- Click Next through the wizard until you reach Server Roles
- Expand File and Storage Services → File and iSCSI Services
- Check Server for NFS
- Click Next and complete the installation
- Restart the server if prompted
Create NFS Share
- Open File Explorer and create a new folder for your datastore (e.g.,
C:\NFSDatastore) - Right-click the folder and select Properties
- Navigate to the NFS Sharing tab
- Click Manage NFS Sharing
- Check Share this folder
- Configure the share name (e.g.,
ESXi_Datastore) - Click Permissions and add your ESXi host:
- Click Add
- Enter the ESXi host IP:
192.168.91.129 - Set Type of access to Read-Write
- Ensure Allow root access is checked
- Click OK
- Click OK to create the share
Verify NFS Service
- Open Services (services.msc)
- Locate Server for NFS service
- Ensure the service is Running and set to Automatic
- If not running, right-click and select Start
Configure NFS Server Settings
- Open Command Prompt as Administrator
- Run the following command to verify the NFS share:
showmount -e localhost
- You should see your exported share listed
Part 2: Configure ESXi Host Networking
Before adding the NFS datastore, ensure your ESXi host has proper network connectivity to the NFS server.
Verify Network Configuration
- Open a web browser and navigate to your ESXi host:
https://192.168.91.129 - Log in with your root credentials
- Click Networking in the left navigation menu
- Verify that your VMkernel adapter has connectivity to the
192.168.91.0/24network - Note the VMkernel port used for storage traffic (typically vmk0 for lab environments)
Test NFS Connectivity
- SSH into your ESXi host (enable SSH if not already enabled)
- Run the following command to test NFS connectivity:
esxcli network diag ping -H 192.168.91.131
Verify successful ping responses Test NFS mount availability:
showmount -e 192.168.91.131
Part 3: Add NFS Datastore Using vCenter
Now that your NFS server is configured and network connectivity is verified, you can add the NFS datastore through vCenter Server.
Access vCenter Server
- Open a web browser and navigate to:
https://192.168.91.130 - Log in to the vSphere Client with your administrator credentials
- From the home screen, click Hosts and Clusters or Storage
Create New NFS Datastore
- In the vSphere Client, navigate to your ESXi host (192.168.91.129)
- Click the Configure tab
- Under Storage, click Datastores
- Click the New Datastore button (or right-click in the datastore panel and select New Datastore)
Configure Datastore Settings
Follow the New Datastore wizard:
Step 1: Select Type
- Choose NFS as the datastore type
- Click Next
Step 2: Select NFS Version
- Select NFS 3 (for Windows Server 2022 compatibility)
- Click Next
Step 3: Configure NFS Settings
- Name: Enter a descriptive name (e.g.,
NFS_Datastore_01) - Folder: Enter the share path
/ESXi_Datastore(the share name created earlier) - Server: Enter the NFS server IP address:
192.168.91.131 - Access mode: Ensure Mount NFS read-write is selected
- Click Next
Step 4: Select Hosts
- Select the ESXi host(s) that should mount this datastore
- In our lab, select
192.168.91.129 - Click Next
Step 5: Review Configuration
- Review all settings carefully
- Verify the NFS server IP, share path, and datastore name
- Click Finish to create the datastore
Verify Datastore Creation
- After the task completes, the new NFS datastore should appear in the datastore list
- Click on the datastore to view its properties
- Verify the following:
- Type: Shows as NFS
- Capacity: Reflects the available space on your NFS share
- Free Space: Shows available storage
- Mounted on: Lists your ESXi host
Part 4: Verify and Test NFS Datastore
Check Datastore Accessibility
- In vSphere Client, right-click your new NFS datastore
- Select Browse Files
- The datastore browser should open, showing an empty directory
- Try creating a test folder to verify write permissions:
- Click the Create a new folder icon
- Name it
test_folder - If successful, delete the folder
Upload Test File
- Click the Upload Files button in the datastore browser
- Select a small test file from your local computer
- Monitor the upload progress
- Once complete, verify the file appears in the datastore
- You can download or delete the test file
Verify from ESXi CLI
For advanced verification, SSH into your ESXi host and run:
esxcli storage nfs list
This command displays all mounted NFS datastores, including:
- Volume name
- NFS server IP
- Share path
- Mount status
- Access mode
Performance Testing
To ensure adequate performance, create a test virtual machine on the NFS datastore:
- Right-click your ESXi host and select New Virtual Machine
- Follow the wizard, selecting your new NFS datastore for VM storage
- Deploy a lightweight operating system
- Monitor datastore I/O during VM operations
- Use vCenter performance charts to verify acceptable latency and throughput
Advanced Configuration Options
NFS v4.1 with Kerberos Authentication
For enhanced security in production environments, configure NFS v4.1 with Kerberos:
- Deploy a Key Distribution Center (KDC) in your environment
- Create service principals for ESXi hosts and NFS server
- Configure ESXi to use Kerberos for NFS authentication
- Mount NFS datastores with security type “krb5” or “krb5i”
This configuration encrypts NFS traffic and provides mutual authentication between ESXi and storage servers.
Multipathing for NFS
While NFS doesn’t support traditional multipathing like iSCSI, you can achieve similar benefits:
- Create multiple VMkernel ports on different physical NICs
- Enable NFS port binding in ESXi advanced settings
- Configure multiple IP addresses on your NFS server
- ESXi will load balance NFS traffic across available paths
Storage I/O Control for NFS
Enable Storage I/O Control (SIOC) on NFS datastores to prevent VM storage contention:
- Select your NFS datastore in vCenter
- Navigate to Configure → General
- Click Edit next to Storage I/O Control
- Enable SIOC and configure appropriate threshold settings
- Set shares for critical VMs to ensure priority during congestion
Conclusion
Creating an NFS datastore in vSphere provides a practical and economical storage solution for virtualized environments. This tutorial demonstrated the complete process, from configuring a Windows Server 2022 NFS server to mounting the datastore in vCenter and performing verification tests.
NFS datastores offer significant advantages including simplified management, cost-effectiveness, and flexibility. By following the best practices outlined in this guide—such as network segmentation, performance optimization, and proper security controls—you can deploy NFS storage that meets production requirements.
Whether you’re setting up a home lab or managing enterprise infrastructure, understanding NFS datastore configuration is a valuable skill for VMware administrators. The hands-on lab approach used in this tutorial provides practical experience that translates directly to real-world scenarios.
- Design


