This article provides step-by-step instructions on how to access NFS shares from Windows.
It includes two major steps:
- Add a File Services role to your Windows Server and install Services for Network File System role service.
- Mount your volume using Map Network Drive
In more details:
- NFS Client installation
- Start Server Manager
- Add File Services role (if it was not added before)
- Install Services for Network File System component
In Windows Server 2012, this service is called "Client for NFS"
You can mount NFS volumes using regular Map Network Drive dialog. The network path to your volume will look like
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:
- To be executed under a SYSTEM user account
- Trigger: Run at System Startup
- Action: Run this batch file (C:\mount_nfs.bat)
- Conditions: Network – Start when your required interface is available
- 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.