Create and Write to File System Fails using Windows NFS

Learn how to troubleshoot failures to create or write files on a file system mounted using Windows NFS.

Important

Before proceeding with troubleshooting, be sure to implement the following prerequisites for connecting to file systems from Windows instances:

Symptom: After installing Windows NFS client, you can successfully mount the file system from Windows, but any attempt to create or update a file in the file system fails.

Cause 1: Registry entries that map the AnonymousGid and AnonymousUid to the root user are missing or in the wrong place.

Access to NFS file systems requires UNIX-style user and group identities, which are not the same as Windows user and group identities. To enable users to access NFS shared resources, Windows client for NFS accesses file systems anonymously, using AnonymousGid and AnonymousUid. On brand new file systems, write permissions are only granted to the root user.

Solution: Verify that the correct registry entries are located in HKEY_LOCAL_MACHINE\Software\Microsoft\ClientForNFS\CurrentVersion\Default. If not, add the AnonymousGid and AnonymousUid registry entries to map them to the root user, and then remount the file system with the new user privileges.

Tip

You can verify the AnonymousGid and AnonymousUid are correctly set for a mounted file system by opening a Windows Command Line (CMD) window and typing the mount command without any arguments. A list of all mounted file systems and their properties is shown. The AnonymousGid (GID) and AnonymousUid (UID) values should appear as 0.

For example:

C:\>mount

Local    Remote                                 Properties
-------------------------------------------------------------------------------
X:       \\10.0.1.0\FileSystem                  UID=0, GID=0
                                                rsize=1048576, wsize=1048576
                                                mount=soft, timeout=0.8
                                                retry=1, locking=yes
                                                fileaccess=755, lang=ANSI
                                                casesensitive=no
                                                sec=sys

If they appear as -2, they have not been correctly set. Proceed to the instructions below.

To map the AnonymousGid and AnonymousUid to the root user
  1. In the Windows Command Line (CMD) window, unmount the file system by typing the following. Replace 10.x.x.x: with the local subnet IP address assigned to your mount target, fs-export-path with the export path you specified when associating the file system with the mount target, and X with the drive letter of any available drive you want to map the file system to.

    Tip

    IP address and export path information is available in the Details page of the mount target associated with your file system. See Getting a Mount Target's Details for more information.
    umount 10.x.x.x:/fs-export-path X:
  2. Open the registry editor (regedit):

    • Click Windows Search.
    • Enter regedit in the Search field and press Enter.
    • Click Yes to allow changes to your device.
  3. Click HKEY_LOCAL_MACHINE. Then, browse to: Software\Microsoft\ClientForNFS\CurrentVersion\Default.
  4. Add a new DWORD32 registry entry for AnonymousGid:

    • Click Edit, and select New DWORD (32 bit) Value.
    • In the Name field, enter AnonymousGid. Leave the value at 0.
  5. Repeat step 3 to add a second DWORD32 registry entry named AnonymousUid with a value of 0.

  6. Open Windows Command Line (CMD) and run as Administrator:

    • Go to Start and scroll down to Apps.
    • In the Windows System section, press Ctrl+Shift and click Command Prompt.
  7. In the Windows Command Line (CMD) window, restart the NFS Client by typing the following:

    nfsadmin client stop
    nfsadmin client start
  8. Close the Administrator: Windows Command Prompt (CMD) window. Open a standard Command Prompt Window:

    • Click Start, then click Command Prompt.
    Important

    NFS file systems mounted as Administrator are not available to standard users.
  9. In the standard Windows Command Line (CMD) window, mount the file system by typing the following. Replace 10.x.x.x: with the local subnet IP address assigned to your mount target, fs-export-path with the export path you specified when associating the file system with the mount target, and X with the drive letter of any available drive you want to map the file system to.

    mount 10.x.x.x:/fs-export-path X:

Cause 2: A standard user is trying to access a file system that was mounted using the Administrator: Command Prompt (CMD). When mounting file systems, it isn't necessary to run the Command Prompt as Administrator.

Solution: Unmount the file system and then remount the file system using a standard Command Prompt. (CMD)

To remount a file system with a standard Command Prompt (CMD)
  1. Open Windows Command Line (CMD) and run as Administrator:

    • Go to Start and scroll down to Apps.
    • In the Windows System section, press Ctrl+Shift and click Command Prompt.
  2. In the Administrator: Windows Command Line (CMD) window, unmount the file system by typing the following. Replace 10.x.x.x: with the local subnet IP address assigned to your mount target, fs-export-path with the export path you specified when associating the file system with the mount target, and X with the drive letter of any available drive you want to map the file system to.

    Tip

    IP address and export path information is available in the Details page of the mount target associated with your file system. See Getting a Mount Target's Details for more information.
    umount 10.x.x.x:/fs-export-path X:
  3. Close the Administrator: Windows Command Line (CMD) window.
  4. Open a standard Command Prompt Window:

    • Click Start, then click Command Prompt.
  5. In the standard Command Line (CMD) window, mount the file system by typing the following. Replace 10.x.x.x: with the local subnet IP address assigned to your mount target, fs-export-path with the export path you specified when associating the file system with the mount target, and X with the drive letter of any available drive you want to map the file system to.

mount 10.x.x.x:/fs-export-path X: