Skip to content

Virtual machines

Connect over SSH

Connect to a flockvm VM with the SSH command from its page, as user or root, set up ~/.ssh/config, copy files, forward ports and use VS Code Remote-SSH.

SSH is how you reach a VM: a shell, file copies, port forwarding and editors all go through it. Each VM has its own port on the host in France, forwarded to the VM's port 22.

Connect

Open the VM in the dashboard and copy the command from the Connect block.

Click Copy to copy the command.
ssh -p 22001 user@HOST
  • -p 22001 is the VM's own port, between 22001 and 22990. It stays the same for the VM's whole life, through pause, resume, stop and start.
  • HOST is the host of the VM's region, as written on the VM page.
  • user is the user on the Agent image. On the Minimal image, it is root, and the command reads ssh -p 22001 root@HOST. Logins are by key only: passwords and keyboard-interactive logins are off.

The page also says where the port goes, for example "Port 22001 on HOST goes to 172.16.0.2:22. Log in as user with the key you gave at creation."

Image SSH user Home Root access
Agent (ubuntu-26.04-agent) user /home/user sudo, without a password; logging in as root with the same key works too
Minimal (ubuntu-26.04) root /root You are root

A VM created before 2026-11-01 on Ubuntu 24.04 (ubuntu-24.04-agent or ubuntu-24.04) keeps the same login: user on the old Agent image, root on the old Minimal. See Images.

The examples below use user@HOST and /home/user. On a Minimal VM, write root@HOST and /root.

The command works only while the VM is running. A paused VM's page says "Paused. Resume it and the same command works, with the same processes." See Lifecycle.

If your key is not the default ~/.ssh/id_ed25519, name it:

ssh -i ~/.ssh/flockvm_ed25519 -p 22001 user@HOST

Add the VM to ~/.ssh/config

An entry saves you typing the port, the user and the key. Use the host and port from the VM page, and User root for a Minimal VM.

~/.ssh/config
Host agent
  HostName HOST
  Port 22001
  User user
  IdentityFile ~/.ssh/id_ed25519
  IdentitiesOnly yes
  ServerAliveInterval 30
  ServerAliveCountMax 4

Then:

ssh agent

ssh, scp, rsync, git and editors all read this file, so every command below works with the alias.

Several VMs

Add one Host block per VM, each with its own Port. Shared settings can go in a Host * block at the end, or in a block that matches all of them, such as Host agent-*.

Copy files

scp takes the port with a capital -P. rsync takes it through -e.

# Upload a file
scp -P 22001 ./notes.md user@HOST:/home/user/

# Download a folder
scp -P 22001 -r user@HOST:/home/user/app/dist ./dist

rsync is installed in both images, so both ends have it.

Clone a private repository

The VM has outbound internet access, so git clone over HTTPS works with a token. Over SSH, add a deploy key to the VM, or use agent forwarding (below) with care.

ssh agent
git clone https://github.com/your-org/your-repo.git

Forward a port

A VM has no public HTTP port: only SSH comes in. To open a dev server running in the VM, forward its port to your machine with -L.

# The VM's localhost:3000 becomes your localhost:3000
ssh -N -L 3000:localhost:3000 agent

Open http://localhost:3000 in your browser. -N keeps the connection open without a shell. Forward several ports by repeating -L.

In ~/.ssh/config:

~/.ssh/config
Host agent
  # …
  LocalForward 3000 localhost:3000
  LocalForward 5173 localhost:5173

To show the server to someone else, see Networking.

VS Code and Cursor

Remote-SSH in VS Code and Cursor reads ~/.ssh/config.

  1. Add the config entry

    Add the Host agent block above to ~/.ssh/config.

  2. Connect

    Open the command palette (⌘⇧P or Ctrl+Shift+P), run Remote-SSH: Connect to Host… and pick agent.

  3. Open a folder

    The editor installs its server in the VM on first connection, then opens your home folder (/home/user or /root) or the folder you pick.

The editor server lives on the VM's disk, so it is still there after a stop and start. Its memory counts in the VM's RAM: on a small VM (4 GB), keep an eye on the Memory tile of the VM page.

Keep sessions alive

The VM's sshd sends a keepalive every 30 seconds (ClientAliveInterval 30). Add ServerAliveInterval on your side too, so idle sessions survive NAT and Wi-Fi changes:

~/.ssh/config
Host *
  ServerAliveInterval 30
  ServerAliveCountMax 4

A dropped connection still kills the shell's processes. Run long jobs and agents in tmux, which is installed in both images:

ssh agent -t tmux new -A -s main

See Long-running sessions with tmux.

Pause keeps your session

When you pause a VM, open SSH connections stall. After Resume, the VM has the same processes, address and port, and a connection that did not time out meanwhile carries on.

Agent forwarding

ssh -A lets the VM use the keys of your local SSH agent, for example to git push over SSH.

ssh -A agent
ssh -T git@github.com

Forward your agent only to VMs you trust

While you are connected, anything running as your user or as root in the VM, a coding agent included, can ask your local agent to sign with your keys. Prefer a deploy key or a fine-grained token scoped to one repository for agents.

Host key changes

Each VM generates its own SSH host keys (ed25519 and ecdsa) on its first boot. They stay the same through pause, resume, stop and start.

When you delete a VM and create a new one, the new VM has new host keys. flockvm does not hand a deleted VM's port to the next VM right away, but ports are reused eventually. When a new VM gets a port you used before, SSH refuses to connect:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

If you deleted the old VM yourself, remove its entry and connect again:

ssh-keygen -R "[HOST]:22001"

For short-lived VMs you create and delete often, accept new host keys automatically but still refuse changed ones:

~/.ssh/config
Host agent-*
  StrictHostKeyChecking accept-new

Don't set StrictHostKeyChecking no for VMs you keep. A host key that changes on a VM you did not delete is worth a look.

Troubleshooting

Permission denied (publickey)

The key you offer is not the one given at creation. Pass the private key that matches the key you picked in the New VM form with -i, and compare fingerprints with ssh-keygen -lf ~/.ssh/id_ed25519.pub against the one listed in your account settings. Keys you add to your account later don't reach existing VMs: see SSH keys.

After repeated failed logins from your address, the VM's SSH server (OpenSSH 10, on the Ubuntu 26.04 images) closes new connections from that address for a while, from a few seconds up to 10 minutes. Fix the key, wait, then connect again.

Connection refused or timeout

The VM is not running. Check its status on the VM page: start or resume it, then connect again.

The VM rebooted and now it's stopped

A reboot or poweroff inside the VM stops it. Click Start on the VM page. See Lifecycle.

More in Troubleshooting.

Next steps