Skip to content
Advertisement

Windows host can’t receive UDP packets from WSL-2 guest

I’m trying to have a simple UDP echo client/server communicate with each other. The client program (which runs in the host Windows) sends packets to the server (which runs in WSL-2), and the server receives them, but the server’s reply is never reaches the client.

JavaScript

The output on Windows:

JavaScript

The output on Linux:

JavaScript

And now I’m stumped. TCP connections work ok so it must only be a UDP thing, but I don’t know what to try next.

Running Windows 10 Home edition and hosting Ubuntu-20.04 in WSL 2.

Advertisement

Answer

This sounds like this Github issue, where UDP packets smaller than 12 bytes don’t make it from WSL2 to the host Windows interface.

If so, then a reported workaround is to turn off transmission checksumming in WSL2 via:

JavaScript

It sounds like this may be a Hyper-V networking issue that can be reproduced outside of WSL2, and the Microsoft team says it is under investigation.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement