Skip to main content
JavaScript examples use @beamcloud/beam-js 1.1.0 or later. Configure the SDK before running them. A VM keeps its name, ID, durable root, and published URLs across restarts. Its runtime and container ID may change.

Inspect state

list displays CPU, memory, configured root disk size, and uptime for the current running boot. get --json includes the specification, state, current container ID, and URLs. States include starting, running, stopping, stopped, paused, and error.

Stop and start

Stop saves the latest root contents before releasing compute and creates a filesystem snapshot artifact by default. Start cold-boots the saved filesystem. A command you launched manually does not rerun on a cold boot; install a systemd service if it should start automatically. --no-snapshot skips the named snapshot artifact, while still saving the durable root:

Pause and resume

Pause checkpoints memory and its paired disks, then shuts down the microVM. Resume restores those processes and memory. beam vm start also resumes a paused VM; resume is an alias for start. External network peers can close connections while the VM is paused. Applications should reconnect their database, API, and other external sessions after resuming. Discard the saved RAM and boot from the disk:
The Python equivalents are vm.stop(), vm.start(), vm.pause(), vm.resume(), and vm.start(cold=True). JavaScript uses the same lifecycle names, with await vm.start({ cold: true }) for a cold boot.

Idle TTL and automatic resume

Unlike a sandbox lifetime, a VM TTL measures idle time. It does not delete the VM.
After 300 idle seconds, the default action saves the root and stops the VM. Set --idle-action pause to preserve RAM instead:
With automatic resume enabled, SDK guest operations, authenticated tunnels, and permitted requests to published URLs wake a stopped or paused VM. Listing or inspecting the VM does not wake it. Without automatic resume, start it before executing commands or using a URL. Disable idle sleep or automatic resume separately:

What counts as activity?

Foreground CLI execution, SSH/tunnels, and active desktop or terminal WebSockets keep an activity lease. SDK access to processes or files updates activity. A command running inside the guest by itself is not a continuous activity signal. For a long Python operation on an idle-limited VM, hold a lease:
Detached commands and background coding agents do not keep the VM awake for their entire lifetime. Disable the TTL for unattended jobs, or keep an SDK activity lease open until the job finishes.

SDK client lifetime and readiness

VM.get(name) reads the VM’s state without starting it. VM.connect(name) also starts or resumes it. To wait for SSH, the browser terminal, or an enabled desktop, use Python vm.wait(services=True) or JavaScript await vm.wait({ services: true }). Desktop and Docker SDK helpers wait automatically.
close() and exiting a with VM... block release local client connections. They leave the VM running. Use stop(), pause(), or remove() to release compute.

Remove a VM

Removal deletes the VM and its root disk. Saved snapshot and template artifacts, additional named disks, and shared volumes are managed separately. Use beam vm snapshot rm and beam vm template rm to remove artifacts you no longer need.

Troubleshooting