Home  >  Article  >  System Tutorial  >  Solution: After WSL2 requests the network, the Windows network will automatically disconnect

Solution: After WSL2 requests the network, the Windows network will automatically disconnect

WBOY
WBOYforward
2024-02-13 08:57:26940browse

php editor Strawberry recently discovered a problem: when using WSL2, when a network request is initiated, the Windows network will automatically disconnect. This problem is very troublesome for developers who use WSL2 for development and testing. Luckily, we've found a solution so you don't lose your internet connection again. Next, we will detail how to solve this problem and make your development and testing work smoother.

The main problem is related to the network card. Since the computer is a desktop computer and does not have a wireless network card, I connect to the wifi through the mobile phone and then share the USB network with the computer. If the computer has such a network adapter, it is caused by the USB shared network. Network card used:

Solution: After WSL2 requests the network, the Windows network will automatically disconnect

Using such a network card to provide the network and requesting the network in wsl2 will trigger the pit mentioned above. Using a wired network card will not cause this problem. , most people should not use USB sharing to access the network, so this problem will not occur.

After using the wired network card, all network requests of wsl2 become normal, and windows is not disconnected.

Solution: After WSL2 requests the network, the Windows network will automatically disconnect

But if you don’t use wsl2 and only use wsl1, this problem does not exist.

To summarize, the main reason why Windows is disconnected when requesting the network in wsl2 is that the network of wsl2 comes from the usb shared network. The simple solution is not to use the network shared through usb. You can use a wired network card or I bought a USB network card instead, but I haven’t analyzed the reason why it caused the disconnection. I hope someone who knows the reason can share it in the comment area.

The above is the detailed content of Solution: After WSL2 requests the network, the Windows network will automatically disconnect. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:xpwin7.com. If there is any infringement, please contact admin@php.cn delete