Mounting a File system On a Windows Instance Using NFS

Prerequisites

Before You Begin

The following tasks are included in this procedure, and you might want to be aware of them before you begin.

  • Installation of the Microsoft Windows NFS Client – This service must be installed on the instance from which you want to mount the file system. Installing the client often requires a restart of the instance.

  • The AnonymousGid and AnonymousUid identity values must be configured to allow write access. – Access to NFS file systems requires UNIX user and group identities, which are not the same as Microsoft Windows user and group identities. By default, file systems write permissions are only granted to the root user. To enable user access to NFS shared resources, the Microsoft Windows client for NFS accesses file systems anonymously, using AnonymousGid and AnonymousUid.

    Caution

    Updating the AnonymousGid and AnonymousUid values require registry changes to your instance.

Choose one the following methods:

Using the Microsoft Windows Command Prompt

  1. Log into your Microsoft Windows instance.

    See Connecting to an Instance.

  2. Open Microsoft Windows PowerShell and run as Administrator:

    1. Go to Start and open PowerShell.

    2. In PowerShell, type the following to run as Administrator:

      Start-Process powershell -Verb runAs
    3. In the User Account Control window, click Yes. A new Administrator: PowerShell window opens. You can close the standard PowerShell window to avoid confusing them.

  3. In Administrator: PowerShell, get the NFS client and update the registry by typing the following:

    Install-WindowsFeature -Name NFS-Client
    Set-ItemProperty HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default -Name AnonymousUid -Value 0
    Set-ItemProperty HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default -Name AnonymousGid -Value 0
    Stop-Service -Name NfsClnt
    Restart-Service -Name NfsRdr
    Start-Service -Name NfsClnt
  4. Open a standard Command Prompt Window.

    Important

    NFS file systems mounted as Administrator are not available to standard users.

  5. From the Command Prompt window, mount the file system.

    See the cautions and notes below the example.

    In the following example, replace:

    Example:

    mount 10.x.x.x:/fs-export-path X:
  6. Verify that you can access and write to the file system.

    1. Access the file system.

      In the example, replace X with the drive letter you used to mount the file system.

      X:
    2. Write a file.

      echo > myfile.txt
    3. Verify that you can view the file.

      dir

Using the Microsoft Windows File Explorer

  1. Log into your Microsoft Windows instance.

    See Connecting to an Instance.

  2. Open Microsoft Windows PowerShell and run as Administrator:

    1. Go to Start and open PowerShell.

    2. In PowerShell, type the following to run as Administrator:

      Start-Process powershell -Verb runAs
    3. In the User Account Control window, click Yes. A new Administrator: PowerShell window opens. You can close the standard PowerShell window to avoid confusing them.

  3. In Administrator: PowerShell, get the NFS client by typing the following:

    Install-WindowsFeature -Name NFS-Client
  4. If necessary, restart your system.

  5. Open the registry editor (regedit) to map the AnonymousGid and AnonymousUid to the root user.

    Caution

    User identity mapping requires changes to your system registry.

    1. Click Windows Search.

    2. Enter regedit in the Search field and press Enter.

    3. Click Yes to allow changes to your device.

    4. Click HKEY_LOCAL_MACHINE. Then, browse to: Software\Microsoft\ClientForNFS\CurrentVersion\Default.

  6. Add a new DWORD32 registry entry for AnonymousGid:

    1. Click Edit, and select New DWORD (32 bit) Value.

    2. In the Name field, enter AnonymousGid. Leave the value at 0.

  7. Repeat the previous step to add a second DWORD32 registry entry named AnonymousUid with a value of 0.

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

    1. Go to Start and scroll down to Apps.

    2. In the Windows System section, press CTRL+Shift and click Command Prompt.

  9. In the Microsoft Windows Command Line (CMD) window, restart the NFS Client by typing the following:

    nfsadmin client stop
    nfsadmin client start
  10. Open File Explorer and select This PC. In the Computer tab, select Map network drive.

  11. Select the Drive letter that you want to assign to the file system.

  12. In the Folder field, enter the following line, replacing:

    Line:

    \\10.x.x.x\fs-export-path
                            
  13. Click Finish.