[ad_1]
A problem that sometimes experienced by Windows Subsystem for Linux users is that these components cannot be connected to the internet, which of course without this makes the capabilities of WSL very limited, especially when users want to download or update something in it.
If you encounter this problem, as an initial diagnosis, first make sure that your Windows 10/11 is connected to the Internet, you can open a browser or open Windows Terminal / CMD to do a Ping from there.
However, if by chance the Windows that hosts the WSL can connect while the WSL cannot, you can take several corrective steps using the following commands in Windows Powershell.
Step 1. First, please open Windows Powershell as Administrator
Step 2. Next, please enter the following commands in sequence:
wsl --shutdown netsh winsock reset netsh int ip reset all netsh winhttp reset proxy ipconfig /flushdns netsh winsock reset shutdown /r
This command will turn off WSL and reset network settings along with cleaning DNS, and if everything is done, you can open WSL again and make sure you find that the internet connection on WSL is running normally.
In the case that I have experienced, the steps above have succeeded in overcoming the problem of the Windows Subsystem for Linux not being able to connect to the Internet, but if it turns out that the steps above cannot solve the problem, it’s a good idea to reset the WSL that you are using or try downloading another distro as a backup. WSL on your system, if the second distribution runs normally, then you can simply reset the old WSL using the steps written on the following page How to Reset WSL Linux Distro on Windows 10.
So, please try it guys, I hope this article is useful.
[ad_2]
Source link