Are you trying to use Antigravity for remote development, but feeling completely stuck?
You can successfully connect to your remote server via SSH, but when you try to attach to a running Docker container, it just doesn't work. The container is nowhere to be found, or you keep getting frustrating errors.
When you try to use the standard "Dev Containers" extension, you might encounter an error log like this in the terminal:
Extension is supported only in Microsoft versions of VS Code or command not found
VSCODE Extension인 Dev Containers 가 antigravity에서는 작동을 하지 않음
Since we cannot use the official Dev Containers extension, we can completely bypass it!
Instead of relying on the editor's extension to bridge the gap, we can open an external port on the Docker container itself and run an SSH server inside it. This turns your Docker container into an independent remote server, allowing Antigravity's standard "Remote - SSH" feature to connect directly to the container.
Here is the step-by-step workaround:
Step 1: Run your Docker Container with an SSH Port Forwarded
When you spin up your Docker container on your remote host, you need to map an extra port specifically for SSH. In this example, we map the host's port 7522 to the container's default SSH port 22.
# Example Docker run command
sudo docker run --gpus all -it --name [CONTAINER_NAME] -p 7522:22 --ipc=host -v [MOUNT_PATH]:/workspace [DOCKER_IMAGE] bash
[DOCKER_IMAGE]: The Docker image you want to use for your development environment
[MOUNT_PATH]: The absolute path of your project folder on the remote host machine (e.g., /home/user/my_project).
[CONTAINER_NAME]: A custom, recognizable name for your container so you can easily find and manage it later.
Step 2: Install and Start the SSH Server Inside the Container
Once you are inside the container's terminal (root@...), you need to install OpenSSH, set a root password, and allow root login. Run the following commands:
apt-get update && apt-get install -y openssh-server
mkdir /var/run/sshd
echo 'root:[PASSWORD]' | chpasswd
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
service ssh start
[PASSWORD] : The password for Container
Step 3: Configure Antigravity to Connect Directly
Now, go back to your local Antigravity editor. Open your SSH configuration file (~/.ssh/config) and add a new entry pointing directly to the container's forwarded port:
Host [My_Docker_Container]
HostName <YOUR_REMOTE_SERVER_IP>
User root
Port 7522
<YOUR_REMOTE_SERVER_IP> : Your Server IP address
Step 4: Connect and Code!
Open the Command Palette in Antigravity (Ctrl + Shift + P or Cmd + Shift + P).
Select Remote-SSH: Connect to Host... and choose container [My_Docker_Container]
When prompted, enter the password (root).
Then, you are now directly connected to your Docker container's workspace without needing the Microsoft Dev Containers extension.
Let's Connect!
Hi, I'm Taehoon Kim. I am currently pursuing my Ph.D. at Chung-Ang University, where my research focuses on AI Safety and AI Risk Management.
I love connecting with fellow researchers, developers, and industry professionals. I am also actively open to research internships, collaborations, or any exciting opportunities in the AI field. If you found this article helpful or want to chat about AI safety, let's connect!
💼 LinkedIn: Taehoon Kim
🐙 GitHub: @rama0126
🎓 Google Scholar: Taehoon Kim's Publications