Timeline

2025-10-03

init


On Win11 + WSL2 Archlinux with mirrored network mode, there is a chance after reboot that WSL cannot access the network while Windows can.

environment

WSL configuration:

1
2
3
4
5
6
7
8
9
[wsl2]
dnsTunneling=true # DNS tunneling (fixes some network issues)
firewall=true # Enable firewall integration
autoProxy=true # Auto sync Windows proxy settings
networkingMode=Mirrored

[experimental]
hostAddressLoopback=true
bestEffortDnsParsing=true

Ping the Gateway

First check whether you can ping the gateway.

  • If you can ping IPs but not domain names → DNS issue
  • If you can’t even ping IPs → network forwarding / NIC / firewall issue
1
ping -c 4 8.8.8.8

DNS Issues

1
2
3
4
sudo emacs /etc/resolv.conf
# Write the following configuration
nameserver 8.8.8.8
nameserver 1.1.1.1

To prevent it from being overwritten on each reboot, disable auto-generation:

1
2
sudo bash -c "echo '[network]' > /etc/wsl.conf"
sudo bash -c "echo 'generateResolvConf = false' >> /etc/wsl.conf"

Restart WSL:

1
wsl --shutdown

Check if networking has recovered.

Firewall Issues

Open Windows Security Center’s Firewall & network protection:
Firewall & network protection
Click “Allow an app through firewall”, and add C:\Windows\System32\wsl.exe.
Check if networking has recovered again.

Other Issues

If you encounter the following error:

1
2
3
4
wsl: An internal error occurred.
Error code: CreateInstance/CreateVm/ConfigureNetworking/0x8007054f
wsl: Failed to configure network (networkingMode Mirrored), falling back to networkingMode None.
wsl: Detected localhost proxy configuration, but not mirrored to WSL. NAT mode WSL does not support localhost proxy.
  1. Try restarting:
1
wsl --shutdown
  1. Try updating WSL and retry:
1
wsl --update
  1. Or switch to NAT mode in WSL Settings, then after successfully opening WSL, switch back to Mirror mode.

  2. If DNS auto-generation was disabled, try enabling it by setting generateResolvConf = true in /etc/wsl.conf.