DEV Community

Hodunov
Hodunov

Posted on

Fixed: slow internet on WSL 2 on Ubuntu 22.04 LTS on Windows 11

When upgrading from Windows 10 to Windows 11, you can certainly run into a lot of problems. One of them is the really slow internet speed in Ubuntu 22.04 LTS in WSL 2.

To solve this problem, you will need to follow a short instruction.

TL;DL: if it seems easier and faster to you - reinstall the WSL feature.

A possible solution for Windows 10 is described in the instructions here - https://townsyio.medium.com/wsl2-how-to-fix-download-speed-3edb0c348e29 .
The solution is to change the vEthernet adapter (WSL) settings.
But in my case, it was not on the list of available.
The solution from the github issue helped me:

  • Run PowerShell as administrator and run the following command, it will disable vEthernet (WSL):

Disable-NetAdapterLso -Name "vEthernet (WSL)"

  • In the WSL terminal, run the commands:

sudo echo "[network]" > /etc/wsl.conf
sudo echo "generateResolvConf = false" >> /etc/wsl.conf
sudo rm /etc/resolv.conf
sudo echo "nameserver 8.8.8.8" > /etc/resolv.conf
sudo chattr +i /etc/resolv.conf

  • And then turn off WSL in the PowerShell terminal: wsl --shutdown

Top comments (0)