Step 1: Install WSL2
If you haven't already, open PowerShell as Administrator and run:
Restart your computer. This will install Ubuntu by default.
Step 2: The "Secret" Download Link
Antigravity's Windows installer is technically a Linux binary wrapped in Electron. Do not download the `.exe` (it's buggy). Instead:
- Open your Ubuntu terminal.
- Download the Linux `.deb` package.
- Run `sudo dpkg -i antigravity_latest_amd64.deb`
Step 3: Fixing Graphics (GPU Acceleration)
This is where most users get stuck. If the UI is blurry or lagging, you need to export the display variable. Add this to your `~/.bashrc`:
export GDK_DPI_SCALE=1.25
The "Browser Subagent" Fix
Antigravity's coolest feature is the Browser Agent. But in WSL2, it tries to connect to `127.0.0.1:9222`, which fails because the Linux localhost is isolated from Windows.
The Fix: You need to forward the port. Run this in PowerShell (Admin):
Troubleshooting
"agy command not found"
The Linux installer sometimes forgets to symlink the CLI tool. Fix it manually:
"File Permission Denied"
DO NOT store your project files in `/mnt/c/Users/...`. This effectively kills filesystem performance because of the NTFS translation layer.
Instead, clone your git repos directly into `~/projects` inside the Linux filesystem.
Advanced WSL2 Configuration
Memory and CPU Optimization
By default, WSL2 can consume up to 80% of your system memory. For Antigravity, which is memory-intensive due to its AI features, you'll want to optimize WSL2's resource allocation. Create a `.wslconfig` file in your Windows user directory:
[wsl2]
memory=12GB
processors=6
localhostForwarding=true
kernelCommandLine=vsyscall=emulate
swap=4GB
swapFile=C:\\Users\\<YourUsername>\\AppData\\Local\\Temp\\swap.vhdx
The `localhostForwarding=true` setting is crucial for Antigravity's browser integration. The `vsyscall=emulate` kernel parameter fixes compatibility issues with certain AI model libraries that Antigravity uses internally.
After creating this file, restart WSL2 by running `wsl --shutdown` in PowerShell, then reopening your Ubuntu terminal.
Network Configuration for AI API Access
Antigravity needs reliable access to various AI APIs (Gemini, Claude, GPT). Corporate firewalls and VPNs can interfere with this. Here's how to configure proper DNS and proxy settings in WSL2:
sudo nano /etc/wsl.conf
# Add these lines:
[network]
hostname=antigravity-dev
generateHosts=false
generateResolvConf=false
[boot]
systemd=true
Then configure custom DNS resolution for AI services:
sudo rm /etc/resolv.conf
sudo bash -c 'echo "nameserver 1.1.1.1" > /etc/resolv.conf'
sudo bash -c 'echo "nameserver 8.8.8.8" >> /etc/resolv.conf'
sudo chattr +i /etc/resolv.conf
File System Performance Tuning
The biggest performance killer in WSL2 is cross-filesystem access. Here's the optimal directory structure for maximum performance:
~/projects/ # All your code projects (Linux filesystem)
~/downloads/ # Temporary files from Windows
/mnt/c/sync/ # Only for file exchange with Windows
# Install Node.js, Python, etc. in Linux, not Windows
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install node
nvm use node
For projects that need to be accessible from Windows (for backup or external tools), use a sync script instead of direct access:
# sync-to-windows.sh
rsync -avz --delete ~/projects/ /mnt/c/dev-backup/
echo "Projects synced to C:\dev-backup"
GPU Acceleration and Hardware Integration
NVIDIA GPU Support for AI Acceleration
If you have an NVIDIA GPU (GTX 1660 or newer), you can enable GPU acceleration for Antigravity's AI features. This significantly speeds up code analysis and generation:
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker
Then configure Antigravity to use GPU acceleration:
{ "ai": { "accelerationType": "cuda", "gpuMemoryLimit": "8GB", "enableLocalInference": true } }
Display and Audio Configuration
For a truly native experience, you'll want proper display scaling and audio support. Install an X11 server on Windows:
# Configure in Ubuntu:
echo 'export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk "{print $2}"):0.0' >> ~/.bashrc
echo 'export LIBGL_ALWAYS_INDIRECT=1' >> ~/.bashrc
source ~/.bashrc
For audio support (if using Antigravity's voice features):
echo 'export PULSE_RUNTIME_PATH=/mnt/wslg/PulseServer' >> ~/.bashrc
Development Environment Setup
Installing Essential Development Tools
Antigravity works best when your development environment is properly configured. Here's the complete setup for major programming languages:
sudo apt update && sudo apt upgrade -y
# Essential build tools
sudo apt install -y build-essential git curl wget vim
# Python development
sudo apt install -y python3 python3-pip python3-venv
pip3 install --user virtualenv pipenv poetry
# Node.js (using NodeSource repository)
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
# Rust (if you do Rust development)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# Docker (for containerized development)
sudo apt-get install -y docker.io
sudo usermod -aG docker $USER
After installation, restart your WSL2 session to ensure all PATH changes take effect.
Git Configuration and SSH Keys
Configure Git properly to avoid authentication issues when Antigravity needs to access your repositories:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git config --global init.defaultBranch main
# Generate SSH key
ssh-keygen -t ed25519 -C "your.email@example.com"
# Start SSH agent and add key
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# Add to shell profile for persistence
echo 'eval "$(ssh-agent -s)"' >> ~/.bashrc
echo 'ssh-add ~/.ssh/id_ed25519' >> ~/.bashrc
Copy your public key (`cat ~/.ssh/id_ed25519.pub`) and add it to GitHub/GitLab/Bitbucket. This allows Antigravity to seamlessly access private repositories for code analysis.
Performance Optimization and Monitoring
Memory Usage Optimization
Antigravity can be memory-hungry, especially with large codebases. Here's how to optimize memory usage in WSL2:
htop # Interactive system monitor
# Create swap file if needed
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# Make swap permanent
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Configure Antigravity for optimal memory usage:
{ "performance": { "maxMemoryUsage": "8GB", "indexingBatchSize": 100, "aiContextWindow": 100000, "cacheStrategy": "aggressive" } }
Real-time Performance Monitoring
Set up monitoring to track Antigravity's performance and system resource usage:
sudo apt install -y htop iotop nethogs ncdu
# Create performance monitoring script
cat > ~/monitor-antigravity.sh << 'EOF'
#!/bin/bash
echo "=== Antigravity Performance Monitor ==="
echo "Memory Usage:"
ps aux | grep antigravity | grep -v grep | awk '{print $6/1024 " MB - " $11}'
echo
echo "CPU Usage:"
ps aux | grep antigravity | grep -v grep | awk '{print $3 "% - " $11}'
echo
echo "Disk I/O:"
iotop -b -n1 -p $(pgrep antigravity) 2>/dev/null | tail -n +4
EOF
chmod +x ~/monitor-antigravity.sh
Troubleshooting Common Issues
Debugging Connection Problems
When Antigravity can't connect to AI services, it's usually a network configuration issue. Here's a systematic approach to debugging:
ping 8.8.8.8
nslookup api.openai.com
curl -I https://api.anthropic.com
# Test from WSL2 to Windows
curl -I http://$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):3000
# Check port forwarding
netstat -tlnp | grep :9222
ss -tlnp | grep :9222
If you're behind a corporate firewall, you might need to configure proxy settings:
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=http://proxy.company.com:8080
export NO_PROXY=localhost,127.0.0.1,.company.com
# Make permanent
echo 'export HTTP_PROXY=http://proxy.company.com:8080' >> ~/.bashrc
echo 'export HTTPS_PROXY=http://proxy.company.com:8080' >> ~/.bashrc
echo 'export NO_PROXY=localhost,127.0.0.1,.company.com' >> ~/.bashrc
File Synchronization Issues
Sometimes files created in Windows don't appear immediately in WSL2, or vice versa. This is usually a caching issue:
sync
# Clear file system cache
sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
# Restart file system watcher
sudo systemctl restart systemd-resolved
# For persistent issues, restart WSL2
# (Run in Windows PowerShell)
# wsl --shutdown
# wsl
To prevent future sync issues, avoid editing the same files simultaneously from Windows and WSL2. Use either one or the other as your primary editing environment.
Advanced Features and Integration
Windows Terminal Integration
For the best development experience, integrate Antigravity with Windows Terminal. Create a custom profile:
{ "profiles": { "list": [ { "name": "Antigravity Development", "commandline": "wsl -d Ubuntu -e bash -c 'cd ~/projects && antigravity'", "hidden": false, "icon": "https://antigravity.dev/icon.ico", "tabTitle": "Antigravity", "startingDirectory": "//wsl$/Ubuntu/home/username/projects" } ] } }
VS Code Integration
You can use Antigravity alongside VS Code with the Remote-WSL extension. This gives you the best of both worlds:
# Then in WSL2:
code ~/projects/your-project
# Configure VS Code to work with Antigravity
# Add to VS Code settings.json in WSL2:
{ "antigravity.integration.enabled": true, "antigravity.integration.port": 9222, "terminal.integrated.defaultProfile.linux": "bash" }
Automated Backup and Sync
Set up automated backup of your development environment to prevent data loss:
cat > ~/backup-dev-env.sh << 'EOF'
#!/bin/bash
BACKUP_DIR="/mnt/c/dev-backups/$(date +%Y%m%d)"
mkdir -p "$BACKUP_DIR"
# Backup projects
rsync -avz --exclude=node_modules --exclude=.git ~/projects/ "$BACKUP_DIR/projects/"
# Backup Antigravity config
rsync -avz ~/.config/antigravity/ "$BACKUP_DIR/config/"
# Backup shell configuration
cp ~/.bashrc ~/.zshrc "$BACKUP_DIR/" 2>/dev/null || true
echo "Backup completed: $BACKUP_DIR"
EOF
chmod +x ~/backup-dev-env.sh
# Add to crontab for daily backup
(crontab -l 2>/dev/null; echo "0 2 * * * ~/backup-dev-env.sh") | crontab -
Security Considerations
API Key Management
Antigravity needs access to various AI APIs. Store these keys securely and never commit them to version control:
touch ~/.env
chmod 600 ~/.env
# Add your API keys (edit with nano or vim)
echo 'OPENAI_API_KEY=your_openai_key_here' >> ~/.env
echo 'ANTHROPIC_API_KEY=your_anthropic_key_here' >> ~/.env
echo 'GOOGLE_API_KEY=your_gemini_key_here' >> ~/.env
# Source in shell profile
echo 'source ~/.env' >> ~/.bashrc
Configure Antigravity to use these environment variables instead of storing keys in configuration files:
{ "ai": { "providers": { "openai": { "apiKey": "${OPENAI_API_KEY}" }, "anthropic": { "apiKey": "${ANTHROPIC_API_KEY}" }, "google": { "apiKey": "${GOOGLE_API_KEY}" } } } }
Network Security
When working with sensitive codebases, consider these security measures:
sudo ufw enable
sudo ufw default deny incoming
sudo ufw default allow outgoing
# Allow only necessary ports
sudo ufw allow ssh
sudo ufw allow 9222/tcp comment 'Antigravity Browser'
sudo ufw allow 3000:8000/tcp comment 'Development servers'
# Block unnecessary network access
sudo ufw deny out 22/tcp to any comment 'Block outbound SSH'
sudo ufw status verbose
Conclusion and Next Steps
Running Antigravity IDE on Windows through WSL2 gives you the best of both worlds: Windows compatibility with Linux performance. With proper configuration, you can achieve near-native performance and full feature compatibility.
Key takeaways from this guide:
- Always use the Linux filesystem for projects to avoid performance penalties
- Properly configure WSL2 memory and CPU limits based on your hardware
- Set up GPU acceleration if you have compatible NVIDIA hardware
- Use environment variables for secure API key management
- Monitor performance regularly and optimize based on your usage patterns
- Keep regular backups of your development environment
If you encounter issues not covered in this guide, the Antigravity community on Discord is very active and helpful. Most WSL2-specific problems have been solved by other developers, so don't hesitate to ask for help.
As Antigravity continues to evolve, Microsoft's WSL2 also receives regular updates that improve performance and compatibility. Keep both updated for the best experience, and remember that this setup, once properly configured, often outperforms native Windows development environments for AI-assisted coding.