Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL 2 mirrored networking breaks NFS mounts (“Connection timed out”) #12508

Open
1 of 2 tasks
wpwoodjr opened this issue Jan 27, 2025 · 5 comments
Open
1 of 2 tasks

Comments

@wpwoodjr
Copy link

Windows Version

Microsoft Windows [Version 10.0.26100.2894]

WSL Version

WSL version: 2.3.26.0 Kernel version: 5.15.167.4-1 WSLg version: 1.0.65 MSRDC version: 1.2.5620 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.26100.2894

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.167.4-microsoft-standard-WSL2

Distro Version

Ubuntu 22.04.5 LTS

Other Software

When using WSL 2 mirrored networking mode, any attempt to mount an NFS share from within WSL 2 fails with errors:

$ sudo mount -v -t nfs ub-nuc:/home/wpwoodjr /home/wpwoodjr/ub-nuc
mount.nfs: timeout set for Mon Jan 27 13:45:44 2025
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.86.200,clientaddr=192.168.86.41'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.86.200,clientaddr=192.168.86.41'
mount.nfs: mount(2): Connection timed out
mount.nfs: Connection timed out

Key Observations

  • Mount works from other Linux clients on the same network (e.g., a Raspberry Pi).
  • Mount works if I revert WSL 2 to the legacy NAT networking mode.
  • Turning off Windows Firewall does not help.
  • Pinging or otherwise accessing the NFS server (e.g. rpcinfo -p serverIP) still works, but mount -t nfs … fails.

Request

  • Fix or provide guidance on how to use mirrored networking with protocols like NFS that may rely on particular port/protocol interactions.
  • Alternatively, document known limitations of mirrored networking mode for advanced protocols.

Thank you for looking into this issue!

Repro Steps

Enable mirrored networking (set networkingMode=mirrored in .wslconfig).
Install NFS client tools in WSL:

sudo apt-get update
sudo apt-get install nfs-common

Attempt to mount an exported NFS share:

sudo mount -v -t nfs serverIP:/path /mnt/test

The command eventually returns an error:

mount.nfs: mount: Connection timed out

Expected Behavior

The NFS share should mount successfully inside WSL 2, just like it does from a Raspberry Pi or other standard Linux environment on the same LAN.

Actual Behavior

The mount attempt times out.
No traffic is visibly blocked by the Windows Firewall (which I turned off for testing).
Reverting to non-mirrored networking mode in .wslconfig and restarting WSL immediately fixes the issue.
So it appears mirrored networking specifically interferes with NFS.

Diagnostic Logs

From wsl client with mirrored networking:

$ rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper

$ showmount -e ub-nuc
Export list for ub-nuc:
/home/wpwoodjr 192.168.86.0/24

$ nc -vz ub-nuc 2049
Connection to ub-nuc (192.168.86.200) 2049 port [tcp/nfs] succeeded!

$ sudo mount -v -t nfs ub-nuc:/home/wpwoodjr /home/wpwoodjr/ub-nuc
mount.nfs: timeout set for Mon Jan 27 13:45:44 2025
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.86.200,clientaddr=192.168.86.41'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.86.200,clientaddr=192.168.86.41'
mount.nfs: mount(2): Connection timed out
mount.nfs: Connection timed out

After disabling mirrored networking:

$ sudo mount -v -t nfs ub-nuc:/home/wpwoodjr /home/wpwoodjr/ub-nuc
mount.nfs: timeout set for Mon Jan 27 14:44:39 2025
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.86.200,clientaddr=172.24.87.14'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.86.200,clientaddr=172.24.87.14'

$ ls ub-nuc
Desktop    Downloads   Music     Public     Videos      linux-dev    snap             win10.log
Documents  ...
Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@wpwoodjr
Copy link
Author

Logs attached

WslLogs-2025-01-27_15-28-25.zip

Copy link

Diagnostic information
.wslconfig found
Detected appx version: 2.3.26.0

@dezerving
Copy link

Just want to confirm that I am seeing the same thing after upgrading wsl with bridged mode being deprecated.

NFS is completely broken in wsl2 with mirrored networking, works fine on my other Linux boxes.

Info:

WSL version: 2.3.26.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.2894

Logs: WslLogs-2025-01-31_18-26-08.zip

Networking Logs: WslNetworkingLogs-2025-01-31_18-28-01.zip

@ljcbaby
Copy link

ljcbaby commented Feb 1, 2025

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants