How to share a directory on a Linux machine to a Windows machine via NFS?

What are the full steps one needs to do to mount a directory from a Linux machine as a network drive on a Windows machine via NFS?


Incomplete answer:

  • Linux side:

    1. Install the NFS server and utilities (nfs-utils or your distribution's equivalent).
    2. Create the directory /srv/nfs.
    3. Create a new empty directory under /srv/nfs, e.g. files.
    4. Bind-mount the created directory to the directory containing you want to share, e.g.: sudo mount --bind /home/user/stuff/files /srv/nfs/files
    5. Create or edit /etc/exports, and add the line:

      /srv/nfs 192.168.0.0/16(rw,all_squash,no_subtree_check,anonuid=65534,anongid=65534)

      (the above assumes the Windows machine is on the same LAN as the Linux machine, with the subnet having a 192.168.0.0/16 prefix - adjust as needed).

    6. Start the NFS server (e.g. sudo systemctl start nfs-server.service).

  • Windows side:

    1. In Control Panel, open Programs and Features, there find Add/remove Windows components, and enable Services for NFS and everything under it.

    2. Open a command prompt, and type:

      mount -o anon \\192.168.0.1\srv\nfs\files Z:

      (assuming your Linux machine is at 192.168.0.1).

    3. The directory should now be available on the Z: drive. (Type start Z: at the command prompt to open it in Explorer).


The above instructions seem to be incomplete - I just get a permissions error when attempting to access the mounted drive. Adding the options insecure and anonuid/anongid had no effect.

2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like