My goal: running Antigravity when I can;t install software locally. I’m using a Cloud Workstation to run Antigravity remotely and going about my development flow in the most seamless way possible. Wondering why I can’t run Antigravity on my local computer? It’s a long story of bad decisions I’ll spare you with. This will use the browser to display Antigravity and Chrome, so it will work on a Linux, Mac or Windows local computer. I’m hoping it helps others trying to do the same thing.

Cloud Workstations, fully-managed development environments on Google Cloud, are great for development. I’ve been using them with VSCode as an alternative to Cloud Shell, which quickly runs out of storage for me. I wanted to reuse the default machine image and use Antigravity instead of VSCode. The challenge: Antigravity doesn’t have a web version, so for this little experiment I’m using VNC and noVNC to stream the GUI into a browser.
Here are the steps I followed and the custom image. I should probably remind folks that Antigravity is in preview for individual users.
Create a Custom Container Image
First step is easy, clone this repo: https://github.com/GoogleCloudPlatform/cloud-workstations-custom-image-examples and navigate to the sample that installs noVNC:
git clone https://github.com/GoogleCloudPlatform/cloud-workstations-custom-image-examples.git
cd cloud-workstations-custom-image-examples/examples/images/gnome/noVnc/
We’ll use the /assets folder from here. You can delete the cloudbuild.yaml and README files if you wish.
Replace the Dockerfile with the following:
# syntax=docker/dockerfile:1
FROM us-central1-docker.pkg.dev/cloud-workstations-images/predefined/base as novnc-builder
ARG NOVNC_BRANCH=v1.5.0
ARG WEBSOCKIFY_BRANCH=v0.12.0
WORKDIR /out
RUN git clone --quiet --depth 1 --branch $NOVNC_BRANCH https://github.com/novnc/noVNC.git && \
cd noVNC/utils && \
git clone --quiet --depth 1 --branch $WEBSOCKIFY_BRANCH https://github.com/novnc/websockify.git
#######################################################
# End NoVNC Builder Container
#######################################################
# Main container build
FROM us-central1-docker.pkg.dev/cloud-workstations-images/predefined/base
# Use ARG to avoid apt-get warnings
ARG DEBIAN_FRONTEND=noninteractive
# Install and configure systemd.
RUN apt-get update && apt-get install -y \
systemd && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* &&\
ln -s /dev/null /etc/systemd/system/apache2.service && \
ln -s /dev/null /etc/systemd/system/getty@tty1.service && \
ln -s /dev/null /etc/systemd/system/ldconfig.service && \
/sbin/ldconfig -Xv && \
ln -s /dev/null /etc/systemd/system/systemd-modules-load.service && \
ln -s /dev/null /etc/systemd/system/ssh.socket && \
ln -s /dev/null /etc/systemd/system/ssh.service && \
echo "d /run/sshd 0755 root root" > /usr/lib/tmpfiles.d/sshd.conf && \
echo -e "x /run/docker.socket - - - - -\nx /var/run/docker.socket - - - - -" > /usr/lib/tmpfiles.d/docker.conf
# Install GNOME
RUN apt-get update && apt-get install -y \
gnome-software \
gnome-software-common \
gnome-software-plugin-snap \
libappstream-glib8 \
libgd3 \
colord \
gnome-control-center \
gvfs-backends \
hplip \
libgphoto2-6 \
libsane1 \
sane-utils \
ubuntu-desktop-minimal && \
apt-get remove -y gnome-initial-setup && \
apt-get remove -y --purge cloud-init && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
chmod -x /usr/lib/ubuntu-release-upgrader/check-new-release-gtk
# Install Antigravity
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://us-central1-apt.pkg.dev/doc/repo-signing-key.gpg | gpg --dearmor -o /etc/apt/keyrings/antigravity-repo-key.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/antigravity-repo-key.gpg] https://us-central1-apt.pkg.dev/projects/antigravity-auto-updater-dev/ antigravity-debian main" | tee /etc/apt/sources.list.d/antigravity.list > /dev/null && \
apt-get update && \
apt-get install -y antigravity
# Install Google Chrome
RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/google-chrome-keyring.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list > /dev/null && \
apt-get update && \
apt-get install -y google-chrome-stable
# Divert the original Chrome executable to a new location and create a wrapper script.
# This ensures the fix persists even when the Chrome package is updated.
RUN dpkg-divert --add --rename --divert /usr/bin/google-chrome-stable.real /usr/bin/google-chrome-stable && \
echo '#!/bin/bash' > /usr/bin/google-chrome-stable && \
echo 'exec /usr/bin/google-chrome-stable.real --no-sandbox --no-zygote --disable-gpu --disable-dev-shm-usage "$@"' >> /usr/bin/google-chrome-stable && \
chmod +x /usr/bin/google-chrome-stable
# Install TigerVNC and noVNC
COPY --from=novnc-builder /out/noVNC /opt/noVNC
RUN apt-get update && apt-get install -y \
dbus-x11 \
tigervnc-common \
tigervnc-scraping-server \
tigervnc-standalone-server \
tigervnc-xorg-extension \
python3-numpy && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Merge assets into the container.
COPY assets/opt /opt
COPY assets/. /
# Run TigerVNC and noVNC as services.
RUN ln -s /etc/systemd/system/tigervnc.service /etc/systemd/system/multi-user.target.wants/ && \
ln -s /etc/systemd/system/novnc.service /etc/systemd/system/multi-user.target.wants/ && \
systemctl enable tigervnc && \
systemctl enable novnc
# This is implicit when extending workstations predefined images, however we are
# including it in the sample to explicitly call-out we are overriding the
# default entrypoint when merging assets.
ENTRYPOINT ["/google/scripts/entrypoint.sh"]
What’s happening here:
- We are using the base codeoss image because it already has a lot of valuable tools installed and optimized
- We are reusing the original Dockerfile installation for systemd and gnome, so we have a UI to interact with
- Updating the local package index and downloading, installing Antigravity and Chrome.
- We have a little hack for Chrome: We need some flags for it not to crash or show the “Aw, Snap!” error due to limitations of the container environment. So we are passing those flags when executing Chrome. We need to override the calls from Antigravity so it uses those flags when calling Chrome AND we need to make sure that if we manually update Chrome, our little hack remains.
- Then we install TigerVNC to stream our UI and noVNC so we don’t need a client and can use the browser instead.
Tip💡: If you are using the Cloud Shell for this and have Gemini Code Assist enabled, you can highlight specific parts of the file and ask it to explain it.
Build and Push the image
Create a repository for these images. In all these commands, you’ll need to replace teh <<REGION>> and <<PROJECT_ID>> with your region of choice and your project ID.
gcloud artifacts repositories create cloud-workstations-images \
- repository-format=docker \
- location=REGION \
- project=PROJECT_ID
Configure Docker to authenticate to the Artifact Registry:
gcloud auth configure-docker <<REGION>>-docker.pkg.dev
Build, tag and push the image with a tag of your choice:
docker build -t <<REGION>>-docker.pkg.dev/<<PROJECT_ID>>/cloud-workstations-images/antigravity-workstation:latest .
docker tag antigravity-workstation \
<<REGION>>-docker.pkg.dev/<<PROJECT_ID>>/cloud-workstations-images/antigravity-workstation:latest
docker push <<REGION>>-docker.pkg.dev/<<PROJECT_ID>>/cloud-workstations-images/antigravity-workstation:latest
Create a configuration and a cluster for a Cloud Workstation
This is all documented here. You start with creating a configuration. This will have you create a cluster.

When choosing the cluster, make sure the region is close to where your local computer will be located. The networking config will depend on your project and your needs.

As for hardware, I found that E2 machine types were enough. I chose an e2-standard-16 and haven’t had to use a boost configuration so far, but boosting is always an option.
The most important part is choosing the image you added in the previous step:

This will take a few minutes to update.
Connect from your local computer
You’ll need to create a workstation first. Choose the configuration you have just created.
Start and Launch the workstation.

The first time you launch the workstation, you should see this:

This is expected as you need to set the password for VNC.
Get the connection command for your workstation from the UI:

Paste that into a Cloud Shell. You should now be connected to the command line for your workstation.

Once you are connected, run vncpasswd. You’ll be prompted to set a password. You are only allowed 8 characters.
Launch the workstation tab again and you should be prompted to enter the password. If you still see the error, try sudo systemctl restart tigervnc.service from the command line in the workstation.
Prosper:

Moving forward, every time you start and launch the workstation, you should be prompted for this password and there should be no need for you to go into the SSH connection first.
If you see the error “Unable to forward your request to a backend — Couldn’t connect to a server on port 80" right after you start the workstation, give it a minute and refresh the browser tab as it may still be starting the services.
What’s next?
If you’re taking this seriously, you’ll want to set up a pipeline to automatically update the images when either the base image or Antigravity have an update. There’s a great tutorial here.
You may have questions….
- Did I try X11 forwarding? Yes, but the lagging was (understandably) more than I wanted to endure. If you REALLY wanted to use X11 and exercise your patience, let me know and I can share that Dockerfile and SSH connection flag.
- Can I use just VNC? Yes, nothing stops you from using a VNC client. Well, maybe corporate policies but I can’t help with that.
- Is it worth the trouble? It absolutely is IMO. Antigravity is now my default dev environment. Here’s a video of an initial exploration if you are curious why I like my new agentic development workflow so much.
- What’s with the hacks? I do not love using the no-sandbox option for Chrome either and I understand why the banner is there. I also don’t love the clipboard situation with noVNC but I got used to it pretty fast and prefer it to having a VNC client installed.
- Isn’t there another way? For my specific situation, between limitations of my local machine and corporate policies, the other way could have been a remote desktop into a VM. I would have bumped into other issues with remote desktop so I discarded that. If I had a magic wand, Antigravity would work like the Cloud Shell and allow me to seamlessly mount SDD compute disks so I can have as much storage as I want. What would you ask for if you had a magic wand?
Let me know how that goes in the comments or let’s continue the conversation on social media!
LinkedIn — TikTok — YouTube
Running Antigravity on a browser tab was originally published in Google Cloud – Community on Medium, where people are continuing the conversation by highlighting and responding to this story.
Source Credit: https://medium.com/google-cloud/running-antigravity-on-a-browser-tab-6298bb7e47c4?source=rss—-e52cf94d98af—4
