How to Mount Ubuntu Linux NFS Shares in Windows

|

|

The post provides a detailed tutorial on how to create NFS (Network File System) shares in Ubuntu Linux and mount them in Windows. The procedure involves installing the NFS server package on Ubuntu, configuring the folder to be shared, defining its access protocol, and then enabling NFS in a Windows machine to mount the shared…

This post describes how to create NFS shares in Ubuntu Linux and mount them in Windows.

NFS or Network File System is a distributed file system that can be enabled in a client/server environment. NFS is easy to configure for those wanting to allow NFS client machines to access NFS mount points on a server using NFS protocol.

You might want to mount Ubuntu Linux NFS shares in Windows for several reasons. For example, you may have files shared between multiple systems and want to ensure that they are always up-to-date. NFS allows you to share files between systems and ensure the latest version is always available to all users.

Another reason you might want to mount Ubuntu Linux NFS shares in Windows is that it allows you to access files stored on Linux systems from Windows. This is particularly useful if you have a mixed environment where some systems run Linux, and others run Windows.

Additionally, NFS is a fast and efficient protocol for sharing files between systems. It is much faster than other protocols like SMB, which Windows uses for file sharing. So, if you need to transfer large files between systems, NFS is a good choice.

For this tutorial, we’re going to be using two systems:

  • Ubuntu Computer with IP address 10.0.2.7
  • Windows Computer with IP address 10.0.2.4

How to Install NFS on Ubuntu Linux

To get the NFS server working, you must install the server packages. To do that, run the commands below:

sudo apt-get update
sudo apt-get install nfs-kernel-server

Configure the folder you want to share when the server packages are installed. For this tutorial, we will share an already existing folder—the Home folder for users.

How to export NFS Shares in Ubuntu Linux

So, now that the NFS server package has been installed on Ubuntu open its export file by running the commands below. Then, share the /home folder with all clients on the local subnet (10.0.2.0/24).

sudo nano /etc/exports

Then, add the line below to the export file. This enables the /home folder to be shared with the local NFS client on the local subnet. You can choose to share the entire subnet or a single computer. Just make sure to specify the machine IP address in the definition file.

/home 10.0.2.0/24(rw,no_root_squash)

Save the file and exit.

The two definitions are defined as:

  • no_root_squash = Turn off root squashing. This option is mainly helpful for disk-less clients.
  • rw = Allow both read and write requests on an NFS volume.

After defining the folder you want to share, run the commands below to restart the NFS service on Ubuntu.

sudo systemctl restart nfs-server

How to enable NFS in Windows

After sharing the folder on the NFS server, open the Windows 10 machine and go to Control Panel ==> Programs ==> Programs and Features

Then click on Turn Windows features on or off, as shown in the image below

When the config pane opens, select and enable Services for NFS

Click OK and close.

That should enable Windows clients to mount NFS shares. Now that this feature is enabled on your Windows machine open the command prompt and mount the share from the NFS server.

mount 10.0.2.7:/home Z:\

You should see Windows mount the share.

You can now go to Windows File Explorer and see the mounted share.

That should do it!


Discover more from Geek Rewind

Subscribe to get the latest posts to your email.

Like this:



8 responses to “How to Mount Ubuntu Linux NFS Shares in Windows”

  1. steve Spence Avatar
    steve Spence

    The mount command in windows 10 gives returns an error without the \\ before the ip address

  2. Victor Avatar
    Victor

    Hi! Thank you for the article! Could you change from `mount 10.0.2.7/home Z:\` to `mount 10.0.2.7:/home Z:\` how on your screenshot, please.

    1. !robot Avatar
      !robot

      Done… Thanks for that

  3. carlos perez Avatar
    carlos perez

    on my W10, after mounting my share it did not appear under “This PC” I just mapped manually

    thanks

  4. kross Avatar
    kross

    Didn’t really work for my needs, not possible to edit existing files. I tried for hours to get real write permissions but it isn’t possible

  5. Mano Avatar
    Mano

    @Kross – try this to enable write permissions – refer https://graspingtech.com/mount-nfs-share-windows-10/

  6. Jay Kavanaugh Avatar
    Jay Kavanaugh

    I can see the directory but the files in the directory are not visible from windows. I have a network with a couple of linux machines and the 2nd linux box can see the files but windows cannot:

    T:\>dir
    Volume in drive T has no label.
    Volume Serial Number is 0000-0000

    Directory of T:\

    17/11/2018 01:15 ..
    17/11/2018 01:15 .
    0 File(s) 8,192 bytes
    2 Dir(s) 160,240,812,032 bytes free

    T:\>mount \\192.168.1.5\export\video T:

    fred@HTPC-A:/mnt/video$ ls -al
    total 48
    drwxrwxr-x 12 fred fred 4096 May 3 2019 .
    drwxr-xr-x 7 root root 4096 Nov 7 2018 ..
    drwxrwxr-x 2 fred fred 4096 May 8 2019 CNNs
    drwxrwxr-x 9 fred fred 4096 Mar 23 2017 GoPro
    drwxrwxr-x 13 fred fred 4096 Mar 23 2017 Music
    drwxrwxr-x 14 fred fred 4096 Mar 23 2017 TV
    fred@HTPC-A:/mnt/video$

  7. daniel Avatar
    daniel

    Really thank you I have passed my exam because of your tutorial 🙂

Leave a Reply to carlos perezCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Discover more from Geek Rewind

Subscribe now to keep reading and get access to the full archive.

Continue reading