Setup NFS Server On Non-Server Windows 10, 7

Share:
Let's start with the basic. So, what is a NFS server ?
Network File System (NFS) is a protocol developed by Sun Microsystems, which enables a user to access files on a different system as if the file is locally available over the network. It lets user to modify/copy files resided on a remote system. So its basically a protocol for a network drive. The create NFS server then can be accessed via another Windows or a Linux system.

As you might have already known that NFS server feature is not available on non-server versions of Windows and that's the main reason you are here. But with the help of right tools we should be able to setup NFS server on non-server Windows.

We will be creating a NFS server on a Windows system using a free tool and accessing the server from a Linux system. I will be using Windows 10 Pro and a Arch Linux (Xfce) system in this article.

Read also: Fix Requested NFS version or transport protocol is not supported

So, without any further ado let's jump into it.

Setuping NFS Server On Non-Server Windows System

First of all head to the below link and download winNFSd, our free NFS server program.

winNFSd GithHub (Source code if you need)

winNFSd (Binary)

Extract the downloaded WinNFSd.exe on C:/nfs (or where ever you like).
Now we will create two files namely paths.txt and start_server.bat within the winnfsd executable folder.


Contents of paths.txt
Open paths.txt using any text editor and write down any path that you want to share one per line, including an alias.
For example, my paths.txt looks like this.
C:\Users > /c
D:\ > /d
In the first line C:\Users would be the path that i want to share and /c would be the alias for it, so i can access the path using alias from Linux system.

Contents of start_server.bat
This file is optional, but its really handy. We will run this bat file to run our winNFSd executable with all the needed parametersWe wont need to write that long arguments every time we run it. Below is what it looks like in my start_service.bat.
c:\nfs\WinNFSd.exe -addr 192.168.1.64 -pathFile "c:\nfs\paths.txt"
Where,
in place of 192.168.1.64, put your own local IP address. You can get your local IP address using cmd by entering ipconfig command.
And you know about the paths.txt file.

Now create a shortcut of start_service.bat (if you want) on your desktop. You are ready to run your NFS server on your non-server Windows system.

After running the start_server.bat, you should get a window like below.
Now we have a working NFS server running from a non server Windows. You can connect to this server via any NFS client that supports NFS v2 or v3.


winNFSd doesn't support NFS v4.

Mount NFS Drive on Linux Using Terminal (nfs-utils)

We have already setup NFS server on non server Windows now lets mount the remote drive and access the files from our Linux system. I am using Arch Linux with Xfce desktop environment but it should apply to any distribution out there.

First of all we will need the nfs-utils package, install it if not already.
To install the package on Arch Linux issue the following command as root, if any other Linux distro, search on respective sites.
sudo pacman -S nfs-utils
After that we will need to edit nfsmount.conf  file.
By default it will try to connect using nfs v4 protocol. We will set the default version to 3 because as i have already told you, WinNFSd does not support nfs v4.

Use your favourite text editor to edit the file, i am using nano here.
sudo nano /etc/nfsmount.conf
Find the line with #Defaultvers=4 and instead of 4 or anything else write 3 and also remove the # to uncomment the line and save the file. Control + S will save the file on nano.


Lets create a folder on our root directory where we will mount our network drive. I have create a folder named mountc on my root dir ie: /mountc. To create the dir,
cd /
sudo mkdir mountc
Now that we are all set, lets mount the nfs drive. Issue the following command,
sudo mount -t nfs 192.168.1.64:/c /mountc -v
Where,
Put the nfs server IP instead of 192.168.1.64 and instead of /c put your own alias that you have assigned on your paths.txt file. And /mountc  is the path where /c  will be mounted.

Now you can access the nfs drive by navigating to /mountc  from your file manager.

After you have issued the following command you will get something like below.

On NFS server terminal,


On NFS client terminal,


To unmount the mounted drive issue the following command,
sudo umount /mountc -lf
Where /mountc is the mount point. And i am using -f just to force the unmounting.

Note: I am not using any kind of firewall. You might need to disable or create rules on your firewall. Good luck.

And this is how you setup nfs server on non-server windows 10, 7 and mount it on a Linux system.

If you faced any issue or want to appreciate just comment below. I will try to be helpful.

No comments