๐ŸŽ‰ SynpixCloud is Now Live! Welcome to Our GPU Cloud PlatformGet Started

How to Connect VS Code to Cloud GPU via SSH: Complete Guide

Jan 17, 2026

Connecting VS Code to a remote GPU server is one of the most efficient ways to develop and train AI models. This guide walks you through the complete setup process.

Why Use VS Code with Remote GPU?

BenefitDescription
Full IDE ExperienceIntelliSense, debugging, Git integration on remote server
Local ResourcesUI runs locally, only compute happens on GPU server
File SyncAutomatic synchronization between local and remote
Terminal AccessIntegrated terminal connected to remote server
Extension SupportMost VS Code extensions work remotely

Prerequisites

Before starting, ensure you have:

  1. VS Code installed on your local machine
  2. A cloud GPU instance running (e.g., from SynpixCloud)
  3. SSH credentials: hostname, port, username, and password/key
  4. Remote - SSH extension for VS Code

Step 1: Install Remote SSH Extension

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Remote - SSH"
  4. Install the extension by Microsoft

The extension ID is: ms-vscode-remote.remote-ssh

Step 2: Get Your GPU Server SSH Details

When you rent a GPU instance from SynpixCloud, you'll receive:

SSH Host: gpu-xxx.synpixcloud.com
SSH Port: 22222
Username: root
Password: your-password-here

Note: The port may vary. Always check your instance dashboard for the correct port.

Step 3: Configure SSH Connection

  1. Press F1 or Ctrl+Shift+P to open Command Palette
  2. Type "Remote-SSH: Connect to Host"
  3. Select "Add New SSH Host"
  4. Enter the connection string:
ssh root@gpu-xxx.synpixcloud.com -p 22222
  1. Select the SSH config file to update (usually ~/.ssh/config)
  2. Click "Connect" in the notification

Option B: Edit SSH Config Directly

Open your SSH config file and add:

Windows: C:\Users\YourName\.ssh\config macOS/Linux: ~/.ssh/config

Host synpixcloud-gpu
    HostName gpu-xxx.synpixcloud.com
    Port 22222
    User root

Then connect via Command Palette โ†’ "Remote-SSH: Connect to Host" โ†’ select "synpixcloud-gpu"

Step 4: Enter Password and Connect

  1. VS Code will open a new window
  2. Select the platform type (Linux)
  3. Enter your password when prompted
  4. Wait for VS Code Server to install on the remote machine

First connection takes 1-2 minutes while VS Code installs its server component.

Step 5: Open Your Project Folder

Once connected:

  1. Click "Open Folder" in the Explorer sidebar
  2. Navigate to your project directory (e.g., /root/projects/my-ai-project)
  3. Click "OK" to open

You're now editing files directly on the GPU server.

Step 6: Configure Python Interpreter

For AI development, configure the Python interpreter:

  1. Press Ctrl+Shift+P โ†’ "Python: Select Interpreter"
  2. Choose the Python version on the remote server
  3. If using Conda, select the appropriate environment

Common Python paths on cloud GPU:

/usr/bin/python3
/root/miniconda3/bin/python
/root/miniconda3/envs/pytorch/bin/python

Step 7: Install Essential Extensions (Remote)

Install these extensions on the remote server:

ExtensionPurpose
PythonPython language support
PylanceFast Python IntelliSense
JupyterRun notebooks in VS Code
GitLensEnhanced Git integration

Important: Extensions must be installed separately on the remote server. Click "Install in SSH: hostname" when prompted.

Using the Integrated Terminal

The VS Code terminal is now connected to your GPU server:

# Check GPU status
nvidia-smi

# Activate conda environment
conda activate pytorch

# Run your training script
python train.py

File Transfer Tips

Upload Files to Server

  1. Drag and drop files from your local machine to the VS Code Explorer
  2. Or use the terminal with scp:
# From local terminal (not VS Code terminal)
scp -P 22222 local_file.py root@gpu-xxx.synpixcloud.com:/root/projects/

Download Files from Server

  1. Right-click file in Explorer โ†’ "Download"
  2. Or use scp from local terminal:
scp -P 22222 root@gpu-xxx.synpixcloud.com:/root/projects/model.pth ./

Running Jupyter Notebooks

VS Code can run Jupyter notebooks directly on the remote GPU:

  1. Install the Jupyter extension (on remote)
  2. Open any .ipynb file
  3. Select the kernel (Python interpreter)
  4. Run cells with Shift+Enter

Advantage: No need to set up port forwarding or Jupyter server manually.

Troubleshooting Common Issues

Connection Timeout

Symptom: "Could not establish connection"

Solutions:

  1. Verify the server is running (check SynpixCloud dashboard)
  2. Check if the port is correct
  3. Try connecting via regular terminal first:
ssh -p 22222 root@gpu-xxx.synpixcloud.com

Permission Denied

Symptom: "Permission denied (publickey,password)"

Solutions:

  1. Double-check your password
  2. Ensure you're using the correct username (usually root)
  3. Check if the server allows password authentication

VS Code Server Installation Fails

Symptom: "Failed to install VS Code Server"

Solutions:

  1. Check disk space: df -h
  2. Check internet connectivity on server
  3. Try reconnecting after a few minutes

Extensions Not Working

Symptom: Extensions installed but not functioning

Solutions:

  1. Ensure extensions are installed on remote (not just local)
  2. Reload the VS Code window (Ctrl+Shift+P โ†’ "Reload Window")
  3. Check extension compatibility with remote development

Slow Performance

Symptom: Typing lag, slow file operations

Solutions:

  1. Check network latency to server
  2. Disable unnecessary extensions
  3. Exclude large folders from file watching:

Add to .vscode/settings.json:

{
  "files.watcherExclude": {
    "**/data/**": true,
    "**/checkpoints/**": true,
    "**/.git/**": true
  }
}

Best Practices

1. Use SSH Keys Instead of Passwords

Generate and copy SSH key for passwordless login:

# Generate key (if you don't have one)
ssh-keygen -t ed25519

# Copy to server
ssh-copy-id -p 22222 root@gpu-xxx.synpixcloud.com

2. Keep Sessions Alive

Add to SSH config to prevent disconnection:

Host synpixcloud-gpu
    HostName gpu-xxx.synpixcloud.com
    Port 22222
    User root
    ServerAliveInterval 60
    ServerAliveCountMax 3

3. Use tmux for Long-Running Tasks

Training jobs should run in tmux to survive disconnections:

# Start new session
tmux new -s training

# Run your script
python train.py

# Detach: Ctrl+B, then D

# Reattach later
tmux attach -t training

4. Set Up Workspace Configuration

Create .vscode/settings.json in your project:

{
  "python.defaultInterpreterPath": "/root/miniconda3/envs/pytorch/bin/python",
  "python.formatting.provider": "black",
  "editor.formatOnSave": true,
  "files.exclude": {
    "**/__pycache__": true,
    "**/*.pyc": true
  }
}

Alternative: PyCharm Professional

If you prefer PyCharm, it also supports remote development:

  1. Go to File โ†’ Settings โ†’ Project โ†’ Python Interpreter
  2. Add Interpreter โ†’ On SSH
  3. Configure SSH connection
  4. Select remote Python interpreter

Note: Remote development requires PyCharm Professional (paid). VS Code's Remote SSH is free.

Comparison: VS Code vs PyCharm for Remote GPU

FeatureVS CodePyCharm Professional
PriceFree$199/year
Setup ComplexityEasyModerate
PerformanceLightweightResource-heavy
Jupyter SupportExcellentGood
DebuggingGoodExcellent
RefactoringGoodExcellent

Recommendation: Start with VS Code (free and effective), switch to PyCharm if you need advanced debugging or refactoring.

Summary

Connecting VS Code to a cloud GPU via SSH provides a seamless development experience:

  1. Install Remote - SSH extension
  2. Configure SSH connection with your GPU server details
  3. Connect and open your project folder
  4. Install Python/Jupyter extensions on remote
  5. Start developing with full GPU access

This setup gives you the best of both worlds: local IDE comfort with remote GPU power.


Need a GPU server to connect to? Browse SynpixCloud's marketplace for RTX 4090, A100, and H100 instances ready in seconds.

SynpixCloud Team

SynpixCloud Team