NFS client under WSL - mount.nfs: No such device

Viewed 26929

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?

4 Answers

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!

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

Related