Skip to content

Test via Expo go in WSL

I am developing Expo + TypeScript in WSL2 and using Expo Go on a physical Android/iPhone, I recommend setting up WSL2 Mirrored Networking.

Recommended architecture

The ideal setup is:

With WSL2 Mirrored Networking, WSL shares the Windows network stack, which makes LAN access from your phone much easier.


1. Check your WSL version

From PowerShell:

wsl --version

Also:

wsl --status


2. Enable WSL2 mirrored networking

Create/edit:

C:\Users\<your-windows-user>\.wslconfig

Put:

[wsl2]
networkingMode=mirrored
dnsTunneling=true
autoProxy=true


3. Restart WSL

From PowerShell:

wsl --shutdown

Then open your WSL terminal again.

Check:

ip addr

You should now see networking that behaves much more like the Windows host.


4. Configure the Windows firewall

This is an important part.

Open PowerShell as Administrator and run:

Set-NetFirewallHyperVVMSetting `
  -Name '{40E0AC32-46A5-438A-A0B2-2B479E8F2E90}' `
  -DefaultInboundAction Allow


5. Test the network before scanning

This is the most useful debugging step.

Suppose Expo shows:

exp://192.168.1.100:8081

From your phone’s browser, try:

http://192.168.1.100:8081

You don’t necessarily need a normal webpage response. The important thing is whether the phone can establish a connection.

If the phone cannot connect, don’t troubleshoot Expo yet.

The problem is:

Phone
  ↓
Wi-Fi
  ↓
Windows Firewall / WSL networking
  ↓
WSL