NFS Setup Guide
Overview
NFS (Network File System) is a distributed file system protocol that allows a user on a client computer to access files over a network much like local storage is accessed. NFS enables file sharing across different operating systems, enhancing interoperability in a mixed OS environment. This guide outlines the process of configuring NFS on Windows Server, Rocky Linux, and Ubuntu, as well as mounting these shares across the various platforms.
Environment Information
Below is the environment setup used for this configuration, including the server types and their respective IP addresses for reference:
- Windows NFS Server — Windows Server 2022 →
44.101.0.131
- Rocky Linux NFS Server — Rocky Linux 9.x →
44.101.2.131
- Ubuntu NFS Server — Ubuntu 24.04 →
44.101.4.131
1. Create NFS Shares
1.1 Create NFS Share on Windows Server
- Open Server Manager
- Click Manage → Add Roles and Features.
- Select File and iSCSI Services → Server for NFS.
- Click Add Features, then Next.
- Select Client for NFS, click Next → Install → Close.
Create NFS Folder
- Open File Explorer → Local Disk (C:) → Right-click → New Folder → Name it
var
. - Right-click
var
→ New Folder → Name itnfs
.
Create NFS Share
- Open Server Manager → File and Storage Services → Shares.
- Click Tasks → New Share… → Select NFS Share - Quick → Next.
- Choose a custom path:
/var/nfs
. - Set the share name to
windowsnfs
. - Enable Unmapped User Access.
- Add client IP addresses with Read/Write permissions:
44.101.2.131
44.101.4.131
- Click Next → Next → Create → Close.
1.2 Create NFS Share on Rocky Linux
Install NFS package:
sudo dnf install nfs-utils
Create NFS directory:
sudo mkdir -p /var/nfs sudo chown nobody /var/nfs
Export NFS Share:
sudo vim /etc/exports
Press
i
to enter insert mode.Add the following lines:
/var/nfs 44.101.0.131(rw,sync,no_subtree_check,insecure,all_squash) /var/nfs 44.101.4.131(rw,sync,no_subtree_check)
Press
esc
→:wq
to save and quit.
Allow NFS through the firewall:
sudo firewall-cmd --permanent --add-service=nfs sudo firewall-cmd --permanent --add-service=mountd sudo firewall-cmd --permanent --add-service=rpc-bind sudo firewall-cmd --reload
Enable and start NFS service:
sudo systemctl enable nfs-server sudo systemctl start nfs-server
1.3 Create NFS Share on Ubuntu
Install NFS package:
sudo apt install nfs-kernel-server
Create NFS directory:
sudo mkdir -p /var/nfs sudo chown nobody:nogroup /var/nfs
Export NFS Share:
sudo vim /etc/exports
Press
i
to enter insert mode.Add the following lines:
/var/nfs 44.101.0.131(rw,sync,no_subtree_check,insecure,all_squash) /var/nfs 44.101.2.131(rw,sync,no_subtree_check)
Press
esc
→:wq
to save and quit.
Enable and restart the NFS service:
sudo systemctl restart nfs-kernel-server
2. Mount NFS Shares
2.3 Mount NFS Shares to Windows
Press Windows Key → Type
cmd
→ Open Command PromptEnter the following commands:
mount 44.101.2.131:/var/nfs R: mount 44.101.4.131:/var/nfs U:
2.2 Mount NFS Shares on Rocky Linux
Install NFS package:
sudo dnf install nfs-utils
Mount Windows NFS share:
sudo mkdir -p /mnt/windowsnfs sudo mount 44.101.0.131:/windowsnfs /mnt/windowsnfs
Mount Ubuntu NFS share:
sudo mkdir -p /mnt/ubtnfs sudo mount 44.101.4.131:/var/nfs /mnt/ubtnfs
2.3 Mount NFS Shares on Ubuntu
Install NFS package:
sudo apt install nfs-common
Mount Windows NFS share:
sudo mkdir -p /mnt/windowsnfs sudo mount 44.101.0.131:/windowsnfs /mnt/windowsnfs
Mount Rocky NFS share:
sudo mkdir -p /mnt/rockynfs sudo mount 44.101.2.131:/var/nfs /mnt/rockynfs
3. Verification
To verify that the NFS mounts are mapped on Windows:
- Press Windows Key
- Type
File Explorer
- Click This PC
You should see the newly mapped drives representing the NFS shares.
Run the following commands to verify that the NFS shares are mounted on Linux:
showmount -e 44.101.0.131
showmount -e 44.101.2.131
showmount -e 44.101.4.131