This will be about getting Antigravity up and running in WSL. It will be very short, I promise!
Context: The What and Why of WSL
For years, engineers had to pick a lane. You either stuck with Windows for the rich ecosystem, the productivity tools, and — let’s be honest — the gaming. Or, you went full Linux because that is the native language of the Cloud.
But here’s the reality: we need our projects to be portable. When we write setup scripts or build automation, we need absolute confidence that what runs on our local machine will run exactly the same way when we deploy it to, say, Google Cloud. So our projects must be scripted for Linux compatibility.
Enter Windows Subsystem for Linux (WSL). It stops us from having to compromise. We get a full, native Linux kernel to run our bash scripts and containers exactly as they would in production, without giving up our Windows rig.
I can write cloud-native code by day and jump into a game by night, without archaic dual-booting or wrestling with clunky VMs. WSL Ubuntu has been my preferred development environment for years!
Getting Started with Antigravity
Antigravity (pronounced “An-tee”, not “Ant-I”) is Google’s new game-changing agent-first development environment.
I won’t bother with more of an introduction. You probably already know what it is. But if you haven’t installed it and run it yet, I’d strongly recommend reading Romin Irani’s tutorial: Getting Started with Google Antigravity.
Using Antigravity with WSL
My favourite code editor is (was?) VS Code. And WSL works flawlessly with VS Code. I was worried there might be some friction with Antigravity.
But here’s the good news: setting up Antigravity to work with WSL is trivial to do. But there is some stuff you need to know. So here I’ll walk you through the setup.
Note: most of what I’m talking about here will be done in the Antigravity Editor window, not the Agent Manager. For those familiar with VS Code, this view will seem very familiar. And that’s not overly surprising. Much of the underlying code for the Editor components of Antigravity is based on Code OSS, i.e. the open source core of VS Code itself. So if you use VS Code, you’ll feel right at home!
Let’s assume you’ve installed Antigravity on Windows, and you’ve opened a project workspace in Antigravity:
The Problem
This workspace happens to contain Linux commands and scripts. If you try to get the agent to run them, it will fail.
For example, here I ask the agent to run my create_year.sh script with a natural language prompt “Run the create_year script with 2025”. The agent first prompts for permission to run the script:
But when we accept the request, we get this error:
The error message was:
Invalid command line argument: -c Please use 'wsl.exe --help' to get a list of supported arguments.t
The agent will then get imaginative and try various approaches to run the script. But none of them will work. The Antigravity Editor window might even prompt you to install the WSL Extension. But the standard Microsoft WSL extension doesn’t appear to be available. I.e. you won’t find this:
The Solution
Here’s the good news: you don’t need to install an extension! All you need to do is switch your workspace so that it’s connected to WSL.
Press Ctrl-Shift-P , type “wsl”, and you’ll see this:
Select “ Remote-WSL: Connect to WSL”. Antigravity will immediately setup the new WSL-connected workspace. You’ll probably now see two workspaces for the same project shown together, like this:
Careful here! The workspace that’s connected to WSL is the one that includes [WSL: Ubuntu] and which has a path relative to your Linux home directory. NOT the path that starts \\wsl.localhost because this is the path that Windows uses to access files you’re storing in your Linux OS. So let’s click on the bottom one.
Now you’ll see a couple of obvious indicators that you’re in the WSL environment:
Aside: Installing Extensions
At this point, you might want to install a bunch of extensions into Antigravity, in the WSL section. Because this editor is based on Code OSS, you’ll find that most VS Code extensions will work in Antigravity without any trouble.
For example, I went ahead and installed Gemini CLI Companion, Git Graph, and Ruff extensions.
Back to Running Linux Commands
Let’s try to run our script again. I give the agent the same natural language prompt:
Fingers crossed…
It works. Hurrah!
Running Antigravity from the WSL Command Line
If you try and launch antigravity from your WSL command line, you’ll find it starts Antigravity in Windows, not in Linux.
To address this issue, we can follow the guidance here:
First, create a symlink in Linux to launch antigravity when we run agy:
ln -sf "/mnt/c/Users/<USER>/AppData/Local/Programs/Antigravity/bin/antigravity" \ ~/.local/bin/agy
Second, fix Antigravity to use the correct WSL extension, such that when we open agy from a particular folder, this is connected to the WSL workspace. We do this by editing %USERPROFILE%\AppData\Local\Programs\Antigravity\bin\antigravity and then change the WSL_EXT_ID to google.antigravity-remote-wsl like this:
Last, we need to copy in the WSL helper scripts that the WSL extension expects. So copy the scripts from %USERPROFILE%\.vscode\extensions\ms-vscode-remote.remote-wsl-<whatever>\scripts\ to %USERPROFILE%\AppData\Local\Programs\Antigravity\resources\app\extensions\antigravity-remote-wsl\scripts\
Now we can launch from our WSL terminal, and Antigravity will connect the current folder to WSL:
agy .
Thanks to FUKUDA_Yutaro for providing this guidance. With any luck, Google will fix the installation of Antigravity so that this is configured properly out-of-the-box. But for now, you know the workaround!
One More Thing: Does the Browser Subagent Work in WSL?
The browser subagent is what allows Antigravity to interact with webpages, based on natural language prompts. A few folks have asked me if the browser subagent works within WSL. Initially I thought it was working without any effort. But then I realised I’d been testing the subagent from the Antigravity Playground, which was running outside of WSL.
But if you’re running the browser subagent from a workspace that’s connected to WSL, it won’t necessarily work out-of-the-box. This is because the browser subagent is being launched by Antigravity inside of WSL. The subagent tries to connect to Chrome running on 127.0.0.1:9222, but inside WSL this IP address is to the WSL host, not to your Windows localhost.
The easiest fix for this is to enable the newer mirrored networking mode of WSL. It’s easy to setup. See here for the instructions. TL;DR, you can open %userprofile%\.wslconfig and add an entry like this:
[wsl2]
networkingMode=mirrored
With that done and your WSL restarted, you should find the browser subagent is working.
If, for whatever reason, you can’t setup the mirrored solution, then you can instead follow the guidance described here. There you will see how to set up port forwarding such that WSL can use the native Windows Chrome installation. It takes about 2 minutes to setup, and it works!
These were the settings I used in Antigravity itself, at the end of that guide:
But I did come across one issue: when the subagent then launches from Antigravity, it tries to install the subagent in the Chrome profile, but then fails with an error like this:
To resolve this, I manually opened the extension page to install the Antigravity extension in Chrome. After doing this, Antigravity was able to run the browser subagent from WSL. Woop!
Here’s a quick demo of it working. I said to Antigravity:
“Open the Advent of Code website. Navigate to the 2018 event. Save this interaction as a video.”
Antigravity launches the website, navigates to the correct page, and saves the entire interaction as a video. So cool!
That’s It
I haven’t had much opportunity to play with it, but now Antigravity is working in my WSL, I’m probably going to be using it by default. If I have any more useful tips, I’ll share them with you. Until next time!
You Know What To Do!
- Please share this with anyone that you think will be interested. It might help them, and it really helps me!
- Please give me claps! (Just hold down the clap button.)
- Feel free to leave a comment 💬.
- Follow and subscribe, so you don’t miss my content.
Useful Links and References
- Google Antigravity
- Tutorial: Getting Started with Google Antigravity
- WSL
- WSL Mirrored Networking
- Fixing Antigravity launcher from WSL command line
- Fixing Antigravity browser subagent from WSL














Top comments (0)