Cover image for WSL2 Archlinux mirrored network mode cannot access network issue

WSL2 Archlinux mirrored network mode cannot access network issue

Words 429
Views
Visitors

Timeline

Timeline

2025-10-03

init

This article describes troubleshooting methods for the issue where, under Win11 + WSL2 Archlinux Mirrored network mode, WSL cannot access the network after a restart while Windows can. First, determine whether it is a DNS issue or a network forwarding/firewall issue by pinging the gateway. If it is a DNS issue, you can disable auto-generation and restart WSL. If it is a firewall issue, you need to add wsl.exe to the Windows Firewall allowed list. In addition, you can also try restarting WSL, updating WSL, switching between NAT and Mirrored modes, or re-enabling DNS auto-generation as solutions.

Under Win11 + WSL2 Archlinux Mirrored network mode, there is a chance that after a restart, WSL cannot access the network while Windows can.

Environment
Environment

WSL configuration

123456789
[wsl2]dnsTunneling=true         	# DNS tunneling (resolves certain network issues)firewall=true            	# Enable firewall integrationautoProxy=true          	# Automatically sync Windows proxy settingsnetworkingMode=Mirrored[experimental]hostAddressLoopback=truebestEffortDnsParsing=true

Ping gateway

First, confirm whether the gateway can be pinged.

  • If you can ping the IP but cannot access domain names → it is a DNS issue
  • If you cannot even ping the IP → it is a network forwarding / network card / firewall issue
1
ping -c 4 8.8.8.8

DNS issue

1234
sudo emacs /etc/resolv.conf# Write the following configurationnameserver 8.8.8.8nameserver 1.1.1.1

To avoid being overwritten on every restart, you can disable auto-generation

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

Restart WSL

1
wsl --shutdown

Check whether the network has recovered

Firewall issue

Open Windows Security Center’s Firewall & network protection:

Firewall & network protection
Firewall & network protection

Click ‘Allow an app through firewall’ and add C:\Windows\System32\wsl.exe.
Check again whether the network has recovered.

Other

If the following error occurs:

1234
wsl: 出现了内部错误。错误代码: CreateInstance/CreateVm/ConfigureNetworking/0x8007054f wsl: 无法配置网络 (networkingMode Mirrored),回退到 networkingMode None。 wsl: 检测到 localhost 代理配置,但未镜像到 WSL。NAT 模式下的 WSL 不支持 localhost 代理。
  1. You can try restarting
1
wsl --shutdown
  1. Try updating WSL and then retry
1
wsl --update
  1. Or in WSL Settings, first switch to NAT mode, and after successfully opening WSL, switch back to Mirrored mode

  2. If DNS auto-generation was previously disabled, you can try re-enabling it, i.e.,/etc/wsl.confingenerateResolvConfset totrue

Loading comments…