In this video from ITFreeTraining, I will look at NFS or Network File System. Windows
Server supports NFS sharing as well as a NFS client. This video will look at how to use
both on Windows Server. There is a lot to NFS and I cannot cover it all in one video.
This video will provide you with the basics of how to get it up and running on your network.
I will now change to my computer running Windows Server 2012 R2.
First of all, I will open Server Manager from the quick launch bar. Once Server Manager
has opened, I will next select the option “Add roles and features” to start the
add roles and features wizard.
Since I will be installing the role on the local server, for the first two screens I
will select the defaults. On the next screen I will select the server NYDC1 from the list
and move on.
On the next screen, the NFS Server role needs to be selected. Later on in this the video,
I will look at the client component.
On the select server roles screen, I will expand “File and Storage Services” and
“File and iSCSI services” and then select the component "Server for NFS". When this component
is selected, Windows may prompt you to install additional features. If this is the case,
press the “add features” button when prompted.
Once the component “Server for NFS” has been selected, I will press next to move on.
The next screen will ask if additional features need to be installed. In this case, there
are no additional features to be installed so I’ll press next to move on.
Now that the required roles have been selected, on the last screen of the wizard I will press
install to install the features. The role takes a minute or so to complete, so I will
pause the video and return shortly.
Once the install is complete, I will close the wizard and then open Windows Explorer.
Next I will open the d drive and create a folder called Data. This folder will be the
folder that I will share using NFS. In the folder, I will create a text document called
“Data folder on NYDC1.txt” so when I connect to it later on in the video using the client
folder, I can identify it.
Now that the folder has been created, the next step is to share it. To do this, I will
right click on the folder and select properties. To share the folder using NFS, select the
tab “NFS Sharing”.
On the NFS Sharing tab, press the button “Manage NFS Sharing” to bring up the NFS sharing
properties. To share the folder, tick the option at the top “Share this folder”.
Once the folder is shared, there are some additional options that can be configured.
It is beyond the scope of this video to go into these options. Notice at the top, there
are options for Kerberos if you want to use Kerberos for security.
In this case, I will select the option “Allow anonymous access”. This will allow the NFS
share to be connected without a username and password.
Next, I want to determine which computers will be able to connect to this NFS share.
To do this, I will press the permissions button.
By default, you can see that all machines are “allow read only access” to the share.
To add additional permissions, I will press the add button.
In this case, I will add the computer NYDC1 which is this server. Later in the video I
will connect to this share from this computer and I want to ensure that I have access when
I do.
Notice, for the type of access, I can select read-only or read-write. In this case I will
leave it on read-write and exit to the previous dialog.
Notice that if the permission “all machines” is selected, the remove button is grayed out.
This permission cannot be removed, so if you want to remove the permission, you will need
to change the access to “No Access”. Since I have added the other permissions, this essentially
means that only this server will be able to access this NFS share.
Now that the NFS share has been shared, I will now close all these Windows and go back
to Server Manager. The next step is to connect to the NFS share using Windows. To do this,
an additional feature is required. Keep in mind that currently this feature is still
available in Windows Server and earlier versions of Windows. However, in Windows 8.1 this feature
has been removed and thus with Windows 8.1 using the built in software you cannot access
an NFS share. You will need additional software for Windows 8.1 to provide this.
To add the feature, I will press “add roles and features”. Since the feature will be
installed on the local server, I will accept the default options and select this server
when prompted.
No additional roles need to be added, so I press next on this screen. On the features
screen, I will select the feature “Client for NFS”. Once selected I will complete
the wizard and start the install. The install only takes a minute or so to complete so I
will pause the video and return shortly.
Now that the install is complete, I will close the wizard and open Windows Explorer. To map
to the NFS drive, I will right click on “This PC” and select map network drive.
To map the drive, I can enter in the Windows share name of \\NYDC1\Data. This will work,
however I can also use the UNIX standard of NYDC1:/Data. Either will work fine.
Notice that when I attempt to map the drive I get an error message. The message tends
to suggest the network share could not be found. However, I know that the problem is
with the permissions. To fix this, I will go back to Windows explorer, right click on
the folder and open the properties.
I will then select the NFS sharing tab and press the button Manage NFS Sharing. From here
I will press the permissions button. Once the permission dialog has opened, I will press
the add button and this time add the IP Address of the server to the permissions list and
make sure it has read-write access.
If I now exit out of here, I can go back to Windows Explorer and this time I will be able
to map the share. This is an important point to remember with NFS. Problems can sometimes
occur when matching the computer or host name with the permissions list. As a quick fix,
you can always use the IP Address instead.
Notice that when the drive is mapped, not all files are shown. This is another permissions
problem. To fix this, I will go back to the properties of the folder and this time select
the security tab. In order to add additional permissions, I will press the edit button
and then press add. I will then add the permissions anonymous logon. The “everyone” permission
is in the permission list. However, the everyone permissions does not include anonymous logon,
which NFS has used in this case.
I will now exit out of here and go back to the Windows share. Notice that when I press
the F5 key to refresh the view, the files will appear. The only file in this folder
is the text file, but 4 other folders have appeared. These folders contain the data from
the previous version feature of Windows. Normally in Windows you will not see these folders,
but with NFS sharing, these folders appear. You can start to see why, if you connect one
Windows system to another, you would just use SMB sharing to avoid problems like these.
To prove a point, I will map another drive to the local c drive. Once the drive is mapped,
I will right click on the start menu and select the option command prompt.
Once the command prompt is open, I will run the command net use. Notice that the drive
I mapped using NFS is shown in standard Windows format. However, it is not using the Windows
SMB protocol as you can see on the far right it is shown as “NFS Network”.
In contrast to this, notice that the share above this is listed as “Microsoft Windows
Network”. This means that one share is connected using NFS while the other share is connected
using SMB.
I will now close these Windows and go back to Server Manager and next select “File
and Storage Services” on the left hand side. Once open, I will then select the option shares.
This shows all the shares that are currently configured on this server.
If I right click on the data share and select properties, this will bring up the properties
for the NFS share. Here you can configure the options for the share. The options are
the same as before but in a different interface, so I won’t go through them again. However,
I will select Share permissions.
In a moment I will look at how to mount an NFS share in Linux, so I need to add the
server’s IP Address to the permissions list. To do this, I will press add and then add
the IP Address. Once I add the IP Address and apply the changes, I will get a dialog
message reminding me that I have enabled anonymous access to the Share. This is fine for this
demonstration so I will ignore this message.
The Windows Server is now configured to allow my Linux server to mount a share from the
Windows Server using NFS. I will now change to my Linux server running Ubuntu to have
a look at how to do this.
First, I need to open a terminal to run the required commands. To do this, I will open
the start menu and select XTerm found under system tools.
First I need to create a folder that the NFS share will be mounted to. To do this, I will
run the command sudo mkdir followed by the path. In this case, I will create a folder
called data under mnt. The sudo command allows a command to be run as the root user. When
I run the command, I will be prompted for the root password.
The next step is to install the NFS software. This will allow this server to mount NFS shares
and also share folders on the network using NFS. To do this, I will run sudo again and
this time run the command apt-get. This is the package software that this distribution
of Linux uses to install and update software. In this case, I will use the install option
followed by the name of the NFS package. Once I press Y to start the install, the NFS package
will be installed and ready to be used.
With the package installed, the next step is to mount the NFS share on Windows Server
to the folder I created earlier. To do this I will run sudo followed by the mount command.
The mount command is used to mount a share to a folder. Following the mount command,
I need to enter in where the share is located. In this case it will be the IP Address followed
by colon forward slash data. Finally, I need to add the folder that the NFS share will
be mounted to.
Once the command is run, the NFS share will be mounted. I will now change to this folder
and then run a directory listing. You can see the files shown are the same as those
I could see on Windows when I mapped the drive.
That is all you need to do for the client. The next part of the video: I will configure
Linux to share a folder. First I will create a folder to share by running two make directory
commands to create the folder shared under export.
Next, I need to change the permissions of the folder that I just created. To do this,
I will run the command chmod followed by 777 which grants all access for all users on the
folder I just created.
Next I need to modify a configuration file so that the folder will be shared using NFS.
To do this, I will run Pico followed by the configuration file called exports that is
found under the etc folder.
To share the folder, I need to add the folder to the configuration file, after this who has access,
asterisk for everyone, followed by options – which in this case RW for read and write.
Once I have made the required changes, I will close and save the file.
Now that the changes have been made, the last step is to start the NFS service. To do this,
I will run the service command followed by the service name and the parameter start.
The folder is now shared using NFS. I will now change to my Windows Server to look at
how to map a drive to this NFS share.
To map the drive, I will open Windows Explorer, right click on this PC and select the option
“Map network drive”. For the path, I will enter in the IP Address of the Linux server
followed by colon and then the path of the share. Once I press finish the drive will
be mapped.
That’s it for NFS on Windows Server. I hope this video helped give you a good understanding
of how NFS works.
If you would like to see more of our videos, please check out our YouTube channel or web
page. Until the next video, thanks for watching.