No Internet on WSL
Yesterday, I installed WSL with Ubuntu and it was working perfectly fine and today i tried to install few modules for python but it was stuck and then nothing so i though python pip was a problem so i tried to reinstall it but sudo apt install python3-pip was not working, tried ping google.com nothing just stuck even though i have a good internet connection.
I tied many solution from deleting the /etc/resolv.conf and then making a new add dns of google 8.8.8.8 and cloudflare 1.1.1.1 and then tried ping same problem nothing and then tried
sudo mkdir -p /etc/wsl
echo -e "[network]\ngenerateResolvConf = false" | sudo tee /etc/wsl/wsl.conf
and then tried this
dig google.com
;; communications error to 8.8.8.8#53: timed out
;; communications error to 8.8.8.8#53: timed out
;; communications error to 8.8.8.8#53: timed out
Can someone help me solve this issue
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1
The script will output the path of the log file once done.
If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here
Once completed please upload the output files to this Github issue.
Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.
Diagnostic information
Appx package is not installed
optional-components.txt not found
DNS Resolution and local deavice routing broken after WSL update
I'm experiencing the same issue on both WSL Ubuntu 22.04.5 and Ubuntu 24.04.1.
Until yesterday, everything worked correctly. This morning, WSL Ubuntu 22.04.5 failed to start and returned the following message (in Italian):
La versione della posta in arrivo del sottosistema Windows per Linux è stata disabilitata da Criteri di gruppo.
Per installare WSL dall'archivio, eseguire 'wsl.exe --update'.
L'installazione di WSL dal Microsoft Store consentirà di ottenere più rapidamente gli aggiornamenti più recenti di WSL.
Per altre informazioni, visita https://aka.ms/wslstoreinfo
I ran wsl.exe --update, rebooted the machine, and WSL started correctly again. However, now WSL is having DNS-related issues.
Observed behavior
- The /etc/resolv.conf file inside WSL correctly reflects the DNS address set by on WiFi adapter on windows.
- The Windows hosts file is no longer synchronized inside WSL.
- DNS resolution inside WSL fails when using:
- A custom DNS server (AdGuard on Raspberry Pi)
- The default modem/router IP (192.168.1.254) Yet, DNS works perfectly from Windows itself.
For example, running a basic apt install fails due to DNS resolution errors:
Temporary failure resolving 'archive.ubuntu.com'
Example: dig and telnet from WSL
~$dig google.com
;; communications error to 192.168.1.254#53: timed out
;; communications error to 192.168.1.254#53: timed out
;; communications error to 192.168.1.254#53: timed out
~$telnet 192.168.1.254 53
Trying 192.168.1.254...
telnet: Unable to connect to remote host: No route to host
Network Context
The WSL interface has a valid IP and is in the same subnet:
2: enP5383p0s0: <BROADCAST,MULTICAST,UP,LOWER_UP>
inet 192.168.1.X/24 brd 192.168.1.255 scope global
But I am in the same network/subnet and anything changed since yesterday. All devices are reachable from Windows, but not from within WSL. I rebooted the PC, modem, and Raspberry Pi — no change.
Windows Event Viewer
Windows Registry/Application **FILTER: Origin:WSL
Impossibile trovare la descrizione per l'ID evento 0 dall'origine WSL. Il componente che ha generato l'evento non è installato nel computer locale oppure l'installazione è danneggiata. È possibile installare o ripristinare il componente nel computer locale.
Se l'evento ha avuto origine in un altro computer, le informazioni per la visualizzazione sono state salvate con l'evento.
Con l'evento sono state salvate le informazioni seguenti:
Non è stato possibile configurare la rete (networkingMode Nat). Verrà eseguito il fallback alla modalità di rete VirtioProxy.
La risorsa messaggio è presente ma il messaggio non è stato trovato nella tabella dei messaggi
System information
Windows version: Windows 11 Enterprise 23H2 22631.5472
Version WSL: 2.5.9.0
Version kernel: 6.6.87.2-1
Version WSLg: 1.0.66
Version MSRDC: 1.2.6074
Version Direct3D: 1.611.1-81528511
Version DXCore: 10.0.26100.1-240331-1435.ge-release
Version di Windows: 10.0.22631.5472
Experience Pack Windows: 1000.22700.1106.0
Affected distros: Ubuntu 22.04.5 and 24.04.1
Custom DNS: yes (AdGuard, Fastgate modem on local network)
Internet access from Windows: OK
Internet access from WSL: broken if using custom DNS