The Network File System (NFS) protocol is widely used to provide shared access to files and directories in Linux/Unix environments. NFS is commonly used in virtualization environments to provision shared storage for virtual machines and to serve as a centralized backup repository. NFS is also a popular solution for sharing files across different platforms via shared network directories in mixed Windows and Linux/UNIX environments. In this article, we’ll look at how to install the NFS role, share an NFS directory on a Windows Server host, configure user mapping, and mount an NFS directory from a Linux client.
Built-in NFS server support is available in all currently supported versions of the Windows Server platform (2025, 2022, and 2019) and is implemented by the Server for NFS role. Key features include:
- The Windows Server NFS server supports all NFS protocol versions: NFSv2, NFSv3, and the latest NFSv4.
- A fixed RPC port 2049 is used to access the NFS server (NFSv4 protocol versions).
- Simplified identity mapping is implemented using a flat mapping file.
Installing the NFS Role on Windows Server
Unlike the desktop editions of Windows 10 and 11, which only include a built-in NFS client, Windows Server includes both an NFS server and an NFS client.
The Network File System (NFS) storage role on Windows Server can be installed either via the Server Manager (click Add Roles -> Server Roles -> File and Storage Services -> Server for NFS) or by using PowerShell:
Install-WindowsFeature -Name FS-NFS-Service -IncludeManagementTools
For NFSv4 clients to communicate with the NFS server, TCP/UDP port 2049 must be open on the server.
Make sure that Windows Defender Firewall rules are enabled to allow access to NFS:
Get-NetFirewallRule -DisplayName "Server for NFS*","*Portmap*"|ft
The following firewall rules must be enabled:
- Server for NFS (NFS-TCP-In) –
Microsoft-Windows-NFS-ServerCore-NfsSvc-NFS-TCP-In - Server for NFS (NFS-UDP-In) –
Microsoft-Windows-NFS-ServerCore-NfsSvc-NFS-UDP-In - Portmap for UNIX-based Software (TCP-In) – for NFSv3
- Portmap for UNIX-based Software (UDP-In) – for NFSv3
NFS v3 requires a dynamic RPC port range as well as TCP port 135 (RPC Endpoint Mapper) and TCP/UDP port 111 (Portmap for UNIX Software) to be open.
How to Create an NFS Share on Windows Server
You can create a shared NFS directory in Windows via the graphical Server Manager console:
- Expand the File and Storage Services role in Server Manager.
- Go to the Shares section, then click Tasks -> New Share -> NFS Share – Quick. The NFS Share Advanced option can only be used together with the File Server Resource Manager (FSRM) role. This mode provides granular access control, quotas, file classification, and other advanced file server options.
- Next, specify the name and local path of the directory you want to share over NFS.
- Then select the authentication type. The NFS server on Windows supports Kerberos v5 authentication. If your clients don’t support Kerberos authentication, you must enable the No server authentication (AUTH_SYS) option. This is a less secure UNIX authentication method which uses UIDs and GIDs to determine access permissions. The Enable unmapped user access option allows NFS users without a direct mapping to a Windows account to access the share. If this option is not enabled, a mapping must be configured between the user and a Windows account.
You can allow users to be identified by their UID or GID on the UNIX device (Allow unmapped user access by UID/GID) or allow anonymous access without authentication (Allow anonymous access). - Configure the permissions for the NFS share. Click Add to open the permissions configuration dialog.
- You can use this option to select which hosts or groups are permitted to connect to the NFS share. For example, you can restrict access based on the client’s IP or DNS address in the Host field. To allow access for all devices, select the All Machines option. In the language encoding settings, select ANSI and set the required access permissions: No access, Read only, or Read + Write.
- Next, configure the NTFS access permissions for the folder.NTFS permissions define the base level of access to files and folders on the server, while NFS-specific permissions, user mapping configurations, and NFS share permissions control access over NFS network connections.
- Confirm the creation of the NFS share.
You can also use PowerShell to create a shared NFS network directory:
New-NfsShare -Name NFSShare2 -Path "C:\Shared\nfsshare2" -AllowRootAccess $false -Permission ReadWrite
To view the NFS access permissions for a directory:
Get-NfsSharePermission nfsshare
Change the access permissions for an NFS share:
Grant-NfsSharePermission -Name NFSShare2 -ClientName 192.168.1.123 -ClientType host -LanguageEncoding ANSI
Configuring the NFS Server in Windows
To list the current NFS server configuration, run the following command:
Get-NfsServerConfiguration
State : Running
LogActivity : Not Configured
CharacterTranslationFile : Not Configured
DirectoryCacheSize (KB) : 128
HideFilesBeginningInDot : Disabled
EnableNFSV2 : True
EnableNFSV3 : True
EnableNFSV4 : True
EnableAuthenticationRenewal : True
AuthenticationRenewalIntervalSec : 600
NlmGracePeriodSec : 45
MountProtocol : {TCP, UDP}
NfsProtocol : {TCP, UDP}
NisProtocol : {TCP, UDP}
NlmProtocol : {TCP, UDP}
NsmProtocol : {TCP, UDP}
PortmapProtocol : {TCP, UDP}
MapServerProtocol : {TCP, UDP}
PreserveInheritance : False
NetgroupCacheTimeoutSec : 30
UnmappedUserAccount :
WorldAccount : Everyone
AlwaysOpenByName : False
GracePeriodSec : 240
LeasePeriodSec : 120
OnlineTimeoutSec : 180Use the Set-NfsServerConfiguration cmdlet to change the NFS server settings. For example, the following command disables support for the NFSv2 protocol:
Set-NfsServerConfiguration -EnableNFSV2 $false
In Windows, you can also use the Services for NFS MMC snap-in (nfsmgmt.msc) to manage the NFS server settings. This snap-in allows you to change the NFS transport protocol (TCP + UDP are used by default), enable NFS access logging, manage file locks, and monitor client active connections.
Now, let’s look at how to configure user mapping between an Active Directory user account and the corresponding Linux user’s GID and UID.
In Linux, you can get a user’s UID and GID using the command:
$ id username
The output shows the user’s UID, primary GID, and group memberships. In this example, the UID and GID are both 1000.
Configure a Windows NFS server to retrieve UNIX-to-Windows user identity mappings (UID/GID) directly from Active Directory:
Set-NfsMappingStore -EnableADLookup $true -ADDomainName "woshub.local"
To check the current identity mapping store:
Get-NfsMappingStore
Create a new mapping entry for the FS01_NFS_users group in Active Directory and assign it the Unix group ID (GID) 1000.
New-NfsMappedIdentity -MappingStore AD -GroupName FS01_NFS_users -GroupIdentifier 1000
Check the group’s mapping:
Get-NfsMappedIdentity -MappingStore AD -AccountType Group -AccountName FS01_NFS_users
Map the specific Windows user account to a Unix identifier (UID and GID):
Set-NfsMappedIdentity -MappingStore AD -UserName jsmith -UserIdentifier 1000 -GroupIdentifier 100
Get the mapping settings for the specified domain user:
Get-NfsMappedIdentity -AccountName jsmith -AccountType User
This allows you to map Linux users to local Windows or Active Directory accounts.
Mount a Windows NFS Share on a Linux Machine
You can now test the connection to the Windows Server NFS server from any client. For this example, we will use a Linux host running Debian.
Install the NFS client package on a Linux machine:
$ sudo apt-get install -y nfs-common
Create a new mount point on a Linux host:
$ sudo mkdir /mnt/nfs
Mount the NFS share from a remote server to the specified local directory:
$ sudo mount 192.168.10.174:/nfsshare /mnt/nfs
Check that you can see all the files in the NFS directory on the remote server:
To unmount the NFS share, run:
$ umount /mnt/nfs/
To automatically mount an NFS directory, you can add an entry to /etc/fstab .













