How To Mount An NFS Share In Windows Server 2016

Here we’re going to show you how to mount an NFS file share in Windows Server 2016 both temporarily and persistently so that it will automatically mount after a reboot.

There are a couple of different ways this can be done, including mapping a network drive or adding a network location, which we’ll discuss here.

Our NFS Server: In this example we already have an NFS server setup on a CentOS 7 Linux system which is available at 192.168.1.14 and we have exported the /root/nfs directory with NFS. See our guide on creating an NFS server in Linux here if you need information on how to do this.

Install NFS Client

Before we can mount any NFS shares on our Windows server, we must first install the NFS client feature. This can be done through the graphical user interface (GUI) using server manager, however that takes a lot longer so we’ll use some PowerShell.

First we’ll use the Get-WindowsFeature cmdlet to search for available features that contain the string ‘NFS*’ in the Name field.

PS C:\> Get-WindowsFeature -Name NFS*

Get-WindowsFeature Find NFS-Client Windows Server 2016

As we can see NFS-Client is available for install but not currently installed.

Next we use the Install-WindowsFeature cmdlet to install the NFS-Client feature, as shown below.

PS C:\>  Install-WindowsFeature -Name NFS-Client

Install-WindowsFeature NFS-Client Windows Server 2016

Once complete we should see that the installation has completed successfully, no reboot is required for this feature, we can begin using it straight away.

Mount NFS Temporarily

We can use the mount command in command prompt to quickly mount our NFS share and confirm that it’s working. Note that the mount command used here is in command prompt rather than PowerShell, using it in PowerShell will fail as it is a different command.

C:\Users\Administrators> mount \\192.168.1.14\root\nfs X:
X: is now successfully connected to \\192.168.1.14\root\nfs

The command completed successfully.

Command Prompt Mount NFS Windows Server 2016

At this point we can browse to “This PC” and we should see the NFS share mounted under Network Locations.

There is an issue with this however, this mount is not persistent meaning that if we perform a restart of the Windows server it will not be there afterwards. Luckily there are a few ways we can permanently map to the NFS file share.

Mount NFS Persistently

Most of the time we will want our NFS mount to survive a system reboot and mount automatically after boot so that we don’t have to manually mount it every time.

There are a couple of different ways that we can achieve this task:

Map Network Drive

I personally prefer this method, as we can see the space remaining much more easily.

  1. First open up “This PC” and select Computer from the menu at the top. From here click on Map network drive, as shown below.

    Map network drive

  2. The Map Network Drive window will open, select the drive letter that you want to assign to the NFS share, followed by the IP address or hostname of the NFS server as well as the path to the exported NFS directory. Click the Finish button when complete.

    Map network drive

    You may see a pop up window showing that the connection is being attempted. Once complete the shared NFS folder will open up.

  3. When you view “This PC” you will see the mapped network drive under Network location. This method is better than adding the network location as we’ll discuss next as it clearly shows how much disk space on the NFS share is in use and how much is still available.

    Map network drive



Add A Network Location

This will basically create a shortcut to the mounted NFS directory for you to access at any time, it will also be available after restart just like the map network drive method above.

  1. First open up “This PC” and right click in the white space area and select “Add a network location”.

    Add network location

  2. On the welcome screen click Next to proceed.

    Add network location

  3. Select that you want to choose a custom network location, followed by the Next button.

    Add network location

  4. Enter in two back slashes, followed by the IP address or hostname of your NFS server, followed by the path that is being exported by the NFS server. Click Next once you’ve filled this in.

    Add network location

  5. You can now select a custom name for the network location, click Next once you’ve set one.

    Add network location

  6. To complete the process, simply click the Finish button on the completion screen.

    Add network location

  7. We can optionally open the NFS mount now, or we can browse to “This PC” and see the folder shortcut listed under the “Network locations” setting as shown below.

    Add network location

    As mentioned note that this does not show the disk space in use like the network drive mapping option.

Summary

We have shown you how to install the NFS client feature in Windows Server 2016, and then mount an NFS share from a Linux server both temporarily through command prompt with the mount command, and persistently so that the NFS share is mounted automatically after the server has been restarted.

By doing this we can easily access files from a Unix or Linux based operating system over NFS from Windows.

Leave a comment ?

18 Comments.

  1. What version of NFS does the Windows client support in 2016?

  2. FWIW the above paths did not work for my NFS share (on a Synology), but this did:

    mount machine_name:/volume1/Folder Z:

  3. To mount persistently using mount is also possible, just add /persistent:yes to the command and you’re done. :)

  4. Lifesaver! Mount at login is not good enough, login sucks the life (ram) out of windows.

  5. Hi, I triying to add network location in win server 2016 (http://intranet.org/xfolder/xxx/) to connect via VSCode but I have this error(The folder you entered does not appear to be valid)… I do the same thing in other server an work fine. Can you help me

  6. Any idea what the functional differences are between this and simply mounting a SMB share?

  7. Can someone redirect me to Windows 2016 NFS client documentation for Identity Mapping. I am trying to understand if something has been changed. I have this link for Windows 2012 – https://blogs.technet.microsoft.com/filecab/2012/10/09/nfs-identity-mapping-in-windows-server-2012/

  8. Can some direct me to Microsoft documentation on Windows 2016 NFS Client Identity Mapping. I am trying to understand if something has changed/improved since Windows 2012 NFS Client – https://blogs.technet.microsoft.com/filecab/2012/10/09/nfs-identity-mapping-in-windows-server-2012/

  9. Christian Ciancarella

    hi,

    just a help. trying to execute mount command on WS2016 i get network error – 53

    with my net support check that ping or telnet is working

  10. Hello,
    successfully created a nfs client and mounted the network share from a linux server. The size is a concern. It is only showing the size of 40 GiB, but the requirement is for 20 TiB, and actually should see over 800 TiB. Any ideas about adjusting the size?

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>