Mount an NFS Share on Windows
Last updated on
By default, the Windows NFS client uses very high UID and GID values (such as 65534) for anonymous
access. Because these values have no write permissions on the NFS server, you can mount a STACKIT
File Storage share successfully but cannot create or modify files.
Prerequisites
Section titled “Prerequisites”- The Client for NFS Windows feature is enabled. You can enable it via Control Panel → Programs → Turn Windows features on or off → Services for NFS → Client for NFS.
- Your Windows machine is a VM running inside the STACKIT Network Area (SNA) of the project where the File Storage is activated. Accessing the share from a local machine over VPN is not supported.
- The NFS Share has a Share Export Policy attached that grants the IP of your VM read-write access. See Create Share Export Policies for details.
Fix write access for Windows NFS mounts
Section titled “Fix write access for Windows NFS mounts”-
Open Registry Editor.
Press
Win + R, typeregedit, and press Enter. Confirm the UAC prompt. -
Navigate to the NFS client default settings.
In the left panel, expand the tree to the following path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default -
Create the
AnonymousUidvalue.Right-click inside the right panel, choose New → DWORD (32-bit) Value, and name it
AnonymousUid. Double-click the new entry and set its value to0(Base: Decimal). -
Create the
AnonymousGidvalue.Repeat the previous step for a second new DWORD value named
AnonymousGid, also set to0. -
Restart the NFS client service.
Open an elevated Command Prompt and run:
Terminal window nfsadmin client stopnfsadmin client start -
Mount the share and verify write access.
The STACKIT Portal displays the mount path in NFS format, for example
10.2.1.1:/rp_VKL20Ub/my-share. The Windowsmountcommand requires this in UNC format: replace the colon with nothing and all forward slashes with backslashes.Terminal window mount -o fileaccess=777 \\10.2.1.1\rp_VKL20Ub\my-share Z:Then verify that you can create a file on the mounted drive:
Terminal window echo test > Z:\write-test.txtIf the command completes without error, write access is working correctly.