17

I am getting the following error trying to mount a nfs export.

sudo mount 192.168.1.175:/mnt/nas /mnt/c/nas
mount.nfs: No such device

Any ideas on how to fix this?

Ziffusion
  • 8,779
  • 4
  • 29
  • 57
  • This might be useful, you can actually mount NFS in Windows 10 natively https://mapr.com/docs/51/DevelopmentGuide/c-mounting-nfs-on-a-windows-client.html – Brian Leishman Mar 17 '19 at 21:17

4 Answers4

3

As of October 2020: You can mount nfs with wsl2, but wsl2 itself requires a hardware virtualization available. See here: https://github.com/microsoft/WSL/issues/5838

Ashark
  • 643
  • 7
  • 16
2

If like me you are stuck on WSL1 you can work around this issue by mapping the drive in windows. Use the Map Network Drive feature and create a drive letter for your nfs mount e.g. G:

Now in WSL you can mount that drive letter:

sudo mkdir /mnt/g
sudo mount -t drvfs G: /mnt/g

from: How to Mount Windows Network Drives in WSL

I have not tested the access speed to a drive mapped through to WSL like this but I would expect it to be slow!

Martin
  • 2,316
  • 1
  • 28
  • 33
1

The error indicates the nfs kernel modules are not loaded correctly and also verify the exported path "/mnt/nas" exists on sever "192.168.1.175" or not.

-1

first of all,we understand nfs is one of tctp/ip protocol, so one client and one server are needed, So our purpose is sharing a dir on windows or wsl to a another linux, that means the windows or wsl is a server, all you guys are right about wsl nfs, it doesnt work if we use the wsl nfs inside, we can make a another nfs server on windows instead of wsl, and configure the share dirs right which we can find the dirs on wsl, e.g. /mnt/d/WORK/tftpserverDir, after that we can mount successfully. those are tips of me:

  1. make a nfs server on windows I dowwnload from this:

    https://www.hanewin.net/nfs-e.htm

  2. configure the shared dir in exports file

    D:\WORK\tftpserverDir -name:nfsroot -umask:000 -public -mapall:0

  3. mount the share dirs on your dst linux

mount -t nfs -o nolock -o tcp -o rsize=32768,wsize=32768 172.10.10.80:/nfsroot /sdcard/mnt

ChuckiePan
  • 19
  • 5