Table of Contents
Network File System (NFS) is a protocol that allows you to share files and directories over a network. While NFS is commonly used on Linux, Windows 11 also supports creating NFS shares. Setting up an NFS share allows Linux and other NFS-compatible clients to access files on your Windows machine seamlessly.
STEP 1: Install NFS Server Feature
Windows 11 requires the Services for NFS feature to host NFS shares. Installing this feature enables NFS server capabilities on your system.
Install-WindowsFeature NFS-Services
Check if the service is installed:
Get-WindowsFeature | Where-Object {$_.Name -like "*NFS*"}
STEP 2: Create a Folder to Share
Before configuring the NFS share on Windows 11, you need to create a folder that clients will access. Setting proper permissions ensures secure and smooth file sharing across the network.
# Create a folder for NFS sharing
New-Item -Path "C:\NFS\Shared" -ItemType Directory
# Set permissions (Full Control for Everyone)
icacls "C:\NFS\Shared" /grant Everyone:(F)
STEP 3: Configure NFS Share
After creating the folder, you need to configure it as an NFS share so that clients can access it over the network. Proper configuration ensures reliable access and correct permissions for connected systems.
# Create an NFS share
New-NfsShare -Name "SharedFolder" -Path "C:\NFS\Shared" -AllowRootAccess $true -Permission ReadWrite
# Check existing NFS shares
Get-NfsShare
STEP 4: Configure Permissions for Clients
# Grant read/write permission to a specific subnet
Grant-NfsSharePermission -Name "SharedFolder" -ClientName "192.168.1.0/24" -Permission ReadWrite
STEP 5: Enable NFS Services
For the NFS share to function correctly, the necessary NFS services must be running and set to start automatically. Enabling these services ensures that the share is always available to clients.
# Start NFS services
Start-Service NfsServer
Start-Service NfsClnt
# Enable services to start automatically at boot
Set-Service NfsServer -StartupType Automatic
Set-Service NfsClnt -StartupType Automatic
STEP 6: Mount NFS Share on Client
Once the NFS share is configured on Windows 11, clients need to mount it to access the files. Mounting connects the shared folder to the client system, allowing seamless read and write operations over the network.
# Create a mount point on Linux client
sudo mkdir -p /mnt/windows_nfs
# Mount the NFS share
sudo mount -t nfs 192.168.1.10:/SharedFolder /mnt/windows_nfs
To mount automatically at boot, add the following line to /etc/fstab:
192.168.1.10:/SharedFolder /mnt/windows_nfs nfs defaults 0 0
STEP 7: Test NFS Share
After mounting the NFS share on the client, it’s important to verify that the connection works correctly. Testing ensures that files can be created, read, and modified without any permission or connectivity issues.
cd /mnt/windows_nfs
touch testfile
ls -l