Windows & BSOD · medium

How to fix WSL2 network not working after sleep/wake

Error code: WSL2-NETWORK-BROKEN

What this error means

After the PC wakes from sleep, WSL2 has no internet connectivity. DNS fails and ping fails inside the subsystem.

Updated

Before you begin

Save open work and back up important files. Use instructions for your exact device and software version. If Windows cannot start, see the startup guide.

Work through these checks

0 of 3 complete
01Restart WSL: wsl --shutdown followed by wsl
  1. Restart WSL: wsl --shutdown followed by wsl
What to expect

Check whether the original symptom still occurs.

If it does not help

Continue only if this check applies to your device. Consult its manufacturer if you are unsure.

Browse related errors
02Run inside WSL: echo 'nameserver 8.8.8.8' > /etc/resolv.conf
  1. Run inside WSL: echo 'nameserver 8.8.8.8' > /etc/resolv.conf
What to expect

Check whether the original symptom still occurs.

If it does not help

Continue only if this check applies to your device. Consult its manufacturer if you are unsure.

Browse related errors
03Check Windows Firewall for 'vEthernet (WSL)' adapter rules
  1. Check Windows Firewall for 'vEthernet (WSL)' adapter rules
What to expect

Check whether the original symptom still occurs.

If it does not help

Continue only if this check applies to your device. Consult its manufacturer if you are unsure.

Browse related errors

Possible causes

  • Hyper-V virtual switch does not properly recover after sleep
  • WSL2 DNS server address gets stale
  • Windows Firewall rule blocks WSL2 adapter