Skip to main content
smolvm sandbox env manages environment variables inside a sandbox. Variables are written to the guest so new login shells and later vm.run(...) calls can read them.

Synopsis

Environment variable changes apply to new guest sessions. In an existing shell, run source /etc/profile.d/smolvm_env.sh to reload them.

Shared options

--ssh-key
string
Path to an SSH private key when the command uses SSH.
--ssh-user
string
default:"root"
SSH user when the command uses SSH.
--comm-channel
string
Host-to-guest control channel. Use ssh, vsock, or omit it for auto-selection.
--json
flag
Print a JSON envelope instead of formatted text.

set

Set one or more variables:
Force vsock for a recent Linux image:

unset

Remove variables:

list

List variable names with values masked:
Show values when you are in a safe terminal:

Key rules

Environment variable names must be valid shell identifiers, such as OPENAI_API_KEY or APP_ENV. Use KEY=VALUE pairs for set; values may be empty strings.

Security notes

Environment variables are stored in plaintext inside the sandbox. Avoid printing sensitive values in logs, and rotate credentials after sharing a sandbox with another workflow.
Last modified on June 24, 2026