2

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
  • 1
    samba (SMB / CIFS) != NFS. Feel free to create a similar question for Samba, though, I think it would be a good resource. Also, not sure which search result that query you intended to refer me to - the first result is 5 pages long, which highlights the usefulness of a terse guide like the above (except working, unlike the above!). Commented Oct 2, 2018 at 2:10
  • 1
    Back to the matter at hand - I did get it working, but now I'm not sure what I changed to get it to work... I may try again with a clean slate and figure it out later. Commented Oct 2, 2018 at 2:11

0

You must log in to answer this question.

Browse other questions tagged .