How to access NFS shares from Windows OS

This article provides step-by-step instructions on how to access NFS shares from Windows.

It includes two major steps:

  1. Add a File Services role to your Windows Server and install Services for Network File System role service.
  2. Mount your volume using Map Network Drive

 

In more details:

  1. NFS Client installation
    • Start Server Manager

      1_server_manager.png 
    • Add File Services role (if it was not added before)
      2_add_roles.png

      3_add_roles_fs.png
    • Install Services for Network File System component

      4_NFS.png

      In Windows Server 2012, this service is called "Client for NFS"
  2. Mounting volumes

    You can mount NFS volumes using regular Map Network Drive dialog. The network path to your volume will look like 
                          \\<VPSA_IP>\export\<volume_name> 

    5_mount.png 

 

3. Making mounted NFS volumes available for all users/services.

Please note, that NFS mounted drive letters are session-specific and tied to particular User's logon session. The drive letter will disappear upon user log-off. This is a standard Microsoft Windows practice and a "by design" behavior. 

In order to make the NFS mounted drive available to all users and applications on the particular server, it should be mounted under NT AUTHORITY\SYSTEM user.


There are several ways to do it. One of the simplest ones is to create a small batch file performing volume mount and run it as a Startup Task with a System user privileges.

Here is the content of the batch file. Name it like C:\mount_nfs.bat (or any other name)

echo %time% >> c:\mount_nfs_log.txt

net use N: \\<your_VPSA_IP>\export\<vol_name> >> c:\mount_nfs_log.txt 2>&1

 

This script will print the current system file into the text file, mount your NFS volume as drive N and print the output to the same log file.

 

  • Start Server Manager / Configuration / Task Scheduler
  • Create a Task with following parameters:
    1. To be executed under a SYSTEM user account
    2. Trigger: Run at System Startup
    3. Action: Run this batch file (C:\mount_nfs.bat)
    4. Conditions: Network – Start when your required interface is available
    5. Settings: If task fails - will retry the execution every 1 min for 99 times

Please remember to un-mount the drive before mounting it as a System user.

Now, you can manually execute this task.

The result is – you will see the volume mounted, but the Explore will show it as “Disconnected Drive”. It is fine and the volume is accessible, it is just displayed like that because WIndows is unable to retrieve all session/user-related info for this mount point.

 

Have more questions? Submit a request

1 Comments

Please sign in to leave a comment.