VMs

Open an interactive terminal on the VM over a WebSocket. The session outlives this connection: closing the socket only detaches, so it can be reattached or listed later. It also outlives the host that serves it — a host restart reattaches this socket to the same session and replays its scrollback behind a terminal reset, with no break in the stream.

get/v5/vms/{vmIdOrSlug}/pty

Path parameters

vmIdOrSlugstring required

VM id, or your slug for it

Query parameters

execstring

Command to run; omit for a login shell

colsinteger

Initial width in columns (default 80)

rowsinteger

Initial height in rows (default 24)

linuxUserstring

Guest Linux user to run as; omit for the guest's default user (uid 1000, else root)

slugstring

Name this session so you can reattach to it later without storing the id we mint. If a session already has this name you get that one back — alive, or exited with its final output and exit code still readable — and exec is NOT run; the sessionInfo frame's created says which happened. Starting over is DELETE then open again. Must not be all digits: session ids are bare integers, so an all-digit name could not be told apart from one.

replaceOnExitboolean

Respawn the shell in place when it exits, keeping this session's id, name and scrollback — for a terminal that should outlive whatever runs in it. A command that dies at startup is not respawned forever; after a few exits in quick succession the session is left dead so the error is readable. Leave this off if you are waiting on a command's exit code: a session that comes back to life reports running again.

Changes

No recorded changes to this endpoint across all 2 revisions of this API.