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?

1

4 Answers 4

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

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!

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.

3
-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

Not the answer you're looking for? Browse other questions tagged or ask your own question.