Home > Windows Server > NFS: How to connect to NFS using Windows Server 2008 R2 without using User Mapping Server

NFS: How to connect to NFS using Windows Server 2008 R2 without using User Mapping Server


When connecting to NFS shared folder the windows credentials needs to be mapped to a equivalent unix account+ group. 

In Windows Server 2008 R2 the support for User Mapping is dropped and the same functionality can only be achived using Identity Management for Unix Components (extension schema for Active Directory).

Below describes on how you can connect to a NFS folder without using User Mapping Server.

A. Install NFS Client

Step 1. Enable File Services Role. Go to Server Management – > Add Roles -> File Services

Step 2. Install Services for Network File System. Go to File Services – > Add Role Services

 

B. Update NFS Client Registry

In this step, we are going to map the anonymous user credential to the unix account credential that you’ll be using to connect to NFS share. First you need to get the User Id and Group Id of the unix account from the unix administrator. It should be of decimal value like: UserId= 6500000 GroupId=4200. Once you have it, we can proceed.

1. Open Regedit.

2. Go to \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default.

3. Create 2 DWORD value, one for AnonymousUid with decimal value=<User Id> and another for AnonymousGid with decimal value=<GroupId>.

It should look like this:

4.  Restart the NFS Client. Go to Administrative Tools -> Services for Network File System (NFS) ->

C. Test NFS Connection

1. Open command prompt.

2. Type:  mount -u:<UserName and not UserId> -p:<Password> <SharedNFSFolder> <drive letter to mount, Ex: J:>

3. dir <drive letter:>

Copy file to this NFS folder. This is only way to confirm that the registry hacking is successfully. Because by default if the anonymous access is turned on in NFS side, you can see the files without having to supply user/password.

Note: Limitation is that, you can only connect to a single NFS share because it would use the same UserId and Group Id everytime you connect.

Advertisements
Categories: Windows Server Tags: ,
  1. hans
    January 30, 2013 at 1:32 pm

    hi randy,

    I have tried your solution an it seems to work but I see some strange behavior in windows.

    1 – in explorer the drive is marked as a disconnected network drive but I can access (r/w) the drive. (http:/ /nfs2w2008.dyndns.info/ nfs2w2008.png)
    2 – if I try to disconnect the drive I get an error ” this network connection does not exist”

    any ideas why?

    Thanks in advance.
    Regards,
    Hans

  2. January 30, 2013 at 2:58 pm
  3. Biswajit Sinha
    June 15, 2013 at 10:10 am

    Hi Randy,

    Thx a ton for your post, quite frankly I had been struggling a lot to make it work and then your post came along and it is working now though there is a small issue I am facing.
    I can create, delete files/folders etc. however I dont seem to be able to rename folders in the NFS share mounted on the Windows host as it says “Invalid Device”.

    Any thoughts???

  4. September 11, 2013 at 4:14 am

    Hi Randy

    I have configure my windows server 2008 r2 Enterprise (64-bit) as you instruct, but it seems for some reason NFS Client does not pickup the UID and GID from the registry.

    When I take a tcp dump ( Wireshark), I get an error from the UNIX NFS server:

    Error:Unknown (0xFFFFFFFF)

    Also it seems that in the mount command it uses
    UID: 0
    GID: 3

    Would much appreciate any hints … been struggling to get my NFS client to connect to UNIX NFS Server on windows2008r2. Our company does not support UNIX user mapping on AD and AD LDS seems a little of a over kill in my case.

  5. September 11, 2013 at 4:35 am

    Olli Vanne :
    Hi Randy
    I have configure my windows server 2008 r2 Enterprise (64-bit) as you instruct, but it seems for some reason NFS Client does not pickup the UID and GID from the registry.
    When I take a tcp dump ( Wireshark), I get an error from the UNIX NFS server:
    Error:Unknown (0xFFFFFFFF)
    Also it seems that in the mount command it uses
    UID: 0
    GID: 3
    Would much appreciate any hints … been struggling to get my NFS client to connect to UNIX NFS Server on windows2008r2. Our company does not support UNIX user mapping on AD and AD LDS seems a little of a over kill in my case.

    Regards Olli

  6. July 31, 2015 at 3:34 pm

    Thanks a lot brother, you are the best….

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: