Repository navigation
WSL loses network connectivity when using Windows + K (Miracast) – Fixed by changing the Wi-Fi Direct interface metric #41069
Unanswered
Phelipe Silva Costa (ph2708)
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
WSL loses network connectivity when using Windows + K (Miracast) – Fixed by changing the Wi-Fi Direct interface metric
I ran into an issue where WSL2 lost all network connectivity whenever I connected to a wireless display using Windows + K (Miracast).
Environment
Symptoms
Windows itself continued to have full Internet access, but inside WSL every request failed.
For example:
returned:
The WSL network configuration looked completely normal:
The problem only occurred while a Miracast session was active.
Investigation
Running:
showed two default routes:
Both routes had the same interface metric (35).
The second route belongs to the Microsoft Wi-Fi Direct Virtual Adapter that Windows creates for Miracast.
Solution
Increase the interface metric of the Wi-Fi Direct adapter so it is never preferred over the normal Wi-Fi interface.
Run PowerShell as Administrator:
After that, verify:
The Wi-Fi Direct adapter should now have a much higher metric than the Wi-Fi adapter.
Example:
Result
After changing the interface metric:
Hopefully this helps someone experiencing the same issue.
All reactions