Strategy: Bridge the WSL connection to use the native Windows Chrome installation via port forwarding. This avoids slow rendering inside Linux and utilizes your GPU.
Open PowerShell as Administrator for these steps.
-
Get your WSL Gateway IP (Run this inside your WSL terminal):
ip route show | grep -i default | awk '{ print $3}'
Copy this IP (e.g., 172.25.x.x). We will refer to it as
GATEWAY_IP. -
Configure Port Forwarding (Run in PowerShell Admin, replace
GATEWAY_IP):netsh interface portproxy add v4tov4 listenport=9222 listenaddress=GATEWAY_IP connectport=9222 connectaddress=127.0.0.1
-
Open Firewall (Run in PowerShell Admin):
New-NetFirewallRule -DisplayName "Chrome Remote Debug" -Direction Inbound -LocalPort 9222 -Protocol TCP -Action Allow
Configure Linux to automatically tunnel requests to Windows.
-
Install socat:
sudo apt update && sudo apt install -y socat -
Add Auto-Connect Script: Append this block to your
~/.bashrc(or~/.zshrc) file to ensure the tunnel starts every time you open the terminal:# --- Antigravity / Chrome Bridge Setup --- # 1. Get Windows Gateway IP dynamically WIN_IP=$(ip route show | grep -i default | awk '{ print $3}') # 2. Start socat in background if not already running if ! pgrep -f "socat TCP-LISTEN:9222" > /dev/null; then socat TCP-LISTEN:9222,fork,reuseaddr TCP:$WIN_IP:9222 &> /dev/null & fi
-
Apply changes:
source ~/.bashrc
Go to Antigravity Settings -> Browser Subagent.
-
Chrome Binary Path: (Use the path to your Windows Chrome executable via the
/mntmount)/mnt/c/Program Files/Google/Chrome/Application/chrome.exe -
Browser CDP Port:
9222
If automation stops working after a full PC restart, the WSL IP address might have changed.
- Get the new IP in WSL:
ip route show | grep -i default | awk '{ print $3}'
- Update the Windows Rule (PowerShell Admin):
netsh interface portproxy set v4tov4 listenport=9222 listenaddress=NEW_IP connectport=9222 connectaddress=127.0.0.1

I tried all these but none of them worked. Either one or more of the WSL extensions: Antigravity, VS Code, or the Browser Tool would stop functioning. I finally got all three to work simultaneously:
Antigravity & VS Code WSL Setup Guide
Strategy: Decoupled Bridge.
Goal: Run VS Code Remote and Antigravity Agent simultaneously without breaking either Remote-WSL extension or the Windows Network Stack (HNS).
1. Prerequisites
WSL Config: The
.wslconfigmust not havenetworkingMode=mirrored.Location:
C:\Users\bioan\.wslconfigCorrect State: Empty or just memory/processor limits.
Chrome State: Chrome must be completely closed before starting a debug session.
taskkill /F /IM chrome.exe /T2. One-Time Setup
A. Create the "Pacifier" Script (WSL)
This prevents the Agent from spawning processes and crashing memory (OOM).
Create file
~/dummy-browser.sh:Make executable:
chmod +x ~/dummy-browser.shB. Configure Antigravity Agent
In the IDE Settings:
Browser Binary Path:
/home/vin/dummy-browser.shBrowser CDP Port:
9222C. Create the Chrome Launcher (Windows)
Create
C:\Users\bioan\.antigravity\antigravity_chrome.bat:3. Launch Routine (Start a Session)
Perform these steps whenever you restart your computer or the network stack resets.
Step 1: Identify the Link IP
We need to bridge the specific IP that WSL uses to talk to Windows.
Open VS Code Terminal (WSL).
Run:
ip route show | grep -i default | awk '{ print $3}'Copy this IP (e.g.,
172.29.112.1). We call thisGATEWAY_IP.Step 2: Build the Windows Bridge (PowerShell Admin)
This forces Windows to catch traffic from WSL and hand it to Chrome.
Replace GATEWAY_IP with the IP copied above.
Step 3: Launch Chrome (Windows)
Run the batch script:
C:\Users\bioan\.antigravity\antigravity_chrome.bat.(Chrome will open empty. Do not close it).
Step 4: Start the Tunnel (WSL)
In VS Code Terminal, run socat to bridge the gap.
Replace GATEWAY_IP with the IP from Step 1.
4. Verification
Run this inside WSL. It must return JSON to confirm the chain is unbroken.
If JSON returns: You are ready. Open the Antigravity Agent and run the browser tool task.