Seeing the dreaded “localhost proxy configuration detected but not mirrored to WSL” warning every time you start WSL? Your Windows proxy (like Clash, V2Ray, or any local proxy on 127.0.0.1) can’t reach WSL because NAT mode isolates their localhost addresses. The fix is simple: switch WSL to mirrored networking mode.

Quick fix: Create or edit C:\Users\YourUsername\.wslconfig and add networkingMode=mirrored + autoProxy=true under [experimental]. Then run wsl --shutdown and restart. Done — your proxy now works inside WSL automatically.

If you also had the 0x80071772 error when installing WSL, check that fix first.

Why This Error Happens

Many users run certain software on Windows that requires modifying the system proxy settings, which can trigger this error in WSL. Here’s the specific reason:

Your Windows host has a local proxy set up, such as 127.0.0.1:1080, but this proxy configuration is not properly mirrored into the Linux subsystem inside WSL. Under WSL’s NAT network mode, localhost (127.0.0.1) is isolated between WSL and the Windows host.

In simpler terms:

  • The 127.0.0.1 on the Windows host is the Windows loopback address.
  • The 127.0.0.1 inside WSL2 is the internal loopback address of the WSL virtual machine — it’s not the Windows host address!
  • In NAT mode, WSL and Windows communicate through a virtual network interface, and their localhost addresses are not the same.
  • If you try to connect to 127.0.0.1:1080 from inside WSL, you’re actually connecting to WSL itself, not to the proxy service running on Windows.

That’s why the system warns you: in NAT mode (which is the default for WSL2), this configuration won’t work directly and needs additional handling.

Step-by-Step Fix

Most users today are running WSL2, so we can leverage the experimental feature of the WSL global configuration file to fix this issue.

Here’s how to do it:

In your user directory (C:\Users\YourUsername), create a .wslconfig file with the following content:

[experimental]
autoMemoryReclaim=gradual
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

After saving the file, run the following command in the terminal to shut down WSL:

wsl --shutdown

Then reopen your installed WSL distribution (e.g., Ubuntu 22.04) to restart WSL, and the warning should disappear.

If you’re curious about what each configuration item does, here’s a detailed explanation —

ConfigurationMeaningRelevance to the Issue
autoMemoryReclaim=gradualAutomatically reclaims WSL memory gradually, so WSL no longer permanently occupies a large amount of RAM.Unrelated to proxy settings, used for memory optimization.
networkingMode=mirroredNetworking mirror mode: makes WSL2 network directly “mirror” the Windows network environment, including localhost.Key point! Ensures WSL’s localhost and Windows host’s localhost point to the same network, removing isolation.
dnsTunneling=trueRoutes DNS requests through the Windows host to avoid DNS pollution and resolution errors.Auxiliary support, related to proxy behavior.
firewall=trueRoutes WSL network traffic through the Windows firewall for unified control.Security enhancement, not directly related to the warning.
autoProxy=trueAutomatically syncs Windows system proxy settings into the WSL environment.Key point! Automatically configures Windows proxy (e.g., 127.0.0.1:1080) inside WSL without manual http_proxy setup.

Troubleshooting: Mirrored Mode Not Working?

If the warning persists after applying the fix:

  1. Make sure you ran wsl --shutdown — WSL must fully restart for .wslconfig changes to take effect.
  2. Check the file location.wslconfig must be in C:\Users\YourUsername\, not inside WSL’s filesystem.
  3. Verify the file encoding — It should be plain UTF-8 or ANSI, not UTF-16.
  4. You’re on an older Windows build — Mirrored networking requires Windows 11 22H2+ or Windows 10 (Build 19045+). Run winver to check.

If you’re seeing “mirrored networking mode is not supported”, your Windows version may be too old. See our WSL mirrored networking fix guide for detailed troubleshooting.

FAQ

Q: Do I still need to set http_proxy and https_proxy in WSL after enabling autoProxy? A: No. With autoProxy=true, WSL automatically picks up the Windows system proxy. You can remove any manual export http_proxy=... lines from your .bashrc or .zshrc.

Q: Will mirrored networking break anything? A: In most cases, no. The main difference is that WSL now shares the same network stack as Windows, so localhost inside WSL points to the Windows host. Some Docker or VPN configurations may need adjustment — see the mirrored mode guide for edge cases.

Q: Can I use only networkingMode=mirrored without autoProxy=true? A: Yes, but you’d need to manually configure the proxy inside WSL. autoProxy=true is what makes it “just work” — highly recommended.

Q: What’s the difference between NAT mode and mirrored mode? A: In NAT mode (default), WSL gets its own virtual network with a different IP and isolated localhost. In mirrored mode, WSL shares Windows’ network stack — same IP, same localhost, same proxy settings. Mirrored mode is the recommended default for 2026 and beyond.