Submitted by
guvnor on Fri, 01/23/2009 - 11:15
Creating an NFS share on a Windows 2008 server for unix / linux clients
Windows 2008 has the ability to "share" file resources using NFS. This guide will guide you through doing this. In this scenario we will have two machines named "WIN-NFS" which will be our Windows 2008 Server and "redcloud" which will be our Red Hat linux client.
This can also be done on Windows 2003 check here for details
Setup Windows 2003 NFS
Step 1: Install Active Directory Services on WIN-NFS Windows 2008 Server
This step is only necessary to provide unix to windows user name mappings. You may find that you don't actually need to do this step if you have another method of providing name mappings (for example Windows 2003 SFU 3.5 had a service that did this).
Choose Start -> Administrative Tools -> Server Manager

Choose Role -> Add Roles

Choose Active Directory Services.
This will run - once it as finished you need to run the DC promo tool which is a wizard for turning the server into a DC (domain controller)
Start -> Run -> dcpromo

This will begin the Active directory install wizard

Click Next, This displays the operating system compatibility screen, click next again.
Select the "Create a new domain in a new forest" radio button. Click next.
You will be presented with the Name the Forest Root Domain screen. Enter the FQDN of the forest root domain.
In my case I am going to call it "mydomain.local"

Click Next on the Forest Functional Level and Next on the Domain Functional Level.
You will also need to install a DNS server. So make sure that check box is ticked and press next.

On the Location for Database. Log files and SYSVOL you can select the default.
On the password screen enter a suitable password.
Now it is time to wait for the wizard to do its stuff

.
Restart the computer when prompted.
Step 2: Installing the NFS service on WIN-NFS Windows 2008 Server
Windows 2008 has the NFS file service along side it's other network file systems. It is native to the operating system and simply needs to be added to your servers "roles" so it can share resources to nfs clients (linux or unix boxes for example).
Choose Start -> Administrative Tools -> Server Manager

Choose Roles -> Add Roles
This will start the Add Roles Wizard. Click Next

On the Server Roles page check "File Services" then press "Next"

Click Next on the Introduction to File Services
Then on the Select Role Services screen check "Service for Network File System"

On the Confirm Installation Services press Install

This will go off and install the NFS file sharing service. It might take a minute or two.
If all goes well you should find this installs - so simply press "Close".
Step 3: Installing the Identity Management for Unix
This is a "role service" which means it is basically and extra feature of the ADS role.
To install this go to
Start->Administrative Tools-Server Manager

Start -> Administrator Tools -> Services for Network File System
Choose Roles
Scroll down to the Active Directory Domain Services

Click the "Add Role Services" link
On the the next screen "Select Role Services" Check the Indentity Management Checkbox

This will walk you through a simple wizard which will require a reboot of your machine. Reboot the server.
Step 3a Configure the NFS service to use the identify manager we just installed.
This basically tells the NFS server to use the identity managment service for ADS to map unix usernames to Windows ones
Open Services for Network File System
Start->Administrative Tools->Services for Network File System
Right click the Services for Network File System icon and choose properties
Step 4. Create a Windows User and a Windows Group on the WIN-NFS server
Now the machine is a domain controller you need to use the Active Directory Users tool.
Start->Administrative Tools->Active Directory Users and Computers

Setup a new user in my example the user is called "dave". I will give him a userid of 600. You can use any number you choose.

Now the user is setup right click on the user object in the active directory user and computer tool.
Select the Unix Attributes Tab (this tab appears because we have installed the Identify manangement for Unix)
Change the NIS Domain dropdown to the local domain in my case mydomain
Change the UID to 600
Change the Group ID to 600

Now create a group. I am calling it SFU (service for unix) but you can use any name you like of course. Once you add the group use unix attributes to set the GUID to be 600.
Step 5. Create a Linux user on the red hat server
Using an account with the appropriate permissions (root for example) create a local account. In my case dave and with the same uid I chose for my Windows "dave" account.
Step 6: Creating an NFS shared folder
Using explorer create a folder, on my system i created a folder called c:\nfsshare

Right click the folder and going to properties, then open the "nfs sharing tab"
Click Manage NFS Sharing
Check the Share this folder check box
Step 7. Mount the share from your Unix client
Connect to the unix client as root
create a suitable mount point (a folder) I am calling mine /nfs
Mount the NFS share (this command tells the linux box to mount the remote share at the server to the local mount point /nfs)
mount WIN-NFS:/nfsshare /nfs
change to the linux dave user
Change to the mount point where the resource is mounted
Create a file as a test to see if you can access the nfs file system
If all goes well you will see your file created!
drwxr-xr-x 24 root root 4096 Sep 18 17:13 ..
-rw-r--r-- 1 dave sfu 0 Sep 18 16:50 mytestfile.txt