Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2810

WSL2 internet connectivity is very unstable

$
0
0

I have a WSL2 instance running Ubuntu 22.04, and I'm having trouble connecting to the internet. I'm aware similar questions have been asked in the past, however none of the answers I have found have solved my issue.

My issue specifically seems to be that I have connectivity sometimes, but not all the time. Take for example a request to nslookup www.google.co.uk. As can be seen, the first two attempts to query the DNS server at 8.8.8.8 fail, and then the third works.

myuser@mycomputer:~$ nslookup www.google.co.uk;; communications error to 8.8.8.8#53: timed out;; communications error to 8.8.8.8#53: timed outServer:         8.8.8.8Address:        8.8.8.8#53Non-authoritative answer:Name:   www.google.co.ukAddress: 142.250.180.3Name:   www.google.co.ukAddress: 2a00:1450:4009:81e::2003

So things like apt-get update sometimes work, but even then I can see connection errors throughout the process.

Note that I have no issues on my Windows 10 machine - it is only WSL that is problematic.

What else can I try in order to resolve this issue?


Things I've tried

WSL2 connectivity to the internet seems to be a common issue, so I've tried several things.

Update the nameserver

Stop WSL autogenerating /etc/resolv.conf.

sudo tee /etc/wsl.conf << EOF[network]generateResolvConf = falseEOF

Then add the Google DNS server to /etc/resolv.conf.

sudo tee /etc/resolv.conf << EOFnameserver 8.8.8.8EOF

Add primary DNS suffix

Some sources suggest adding the primary DNS suffix to /etc/resolv.conf.

sudo tee /etc/resolv.conf << EOFsearch my.dns.suffixnameserver 8.8.8.8EOF

Disable IPv6

I've disables the IPv6 protocol on the vEthernet (WSL) network adapter.

Disable large send offload v2

I've disabled the Large Send Offload Version to for both IPv4 and IPv6


Viewing all articles
Browse latest Browse all 2810

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>