Sandboxes (hx vm)
Create and manage Linux and macOS sandboxes, files, logs, processes, terminals, volumes, images, snapshots, and disks
Use hx vm (aliases: hx sandbox, hx sandboxes) to run and manage Linux and macOS sandboxes from your terminal.
Create, Inspect & Stop Sandboxes
# Linux sandbox from a built-in or custom image
hx vm create node
hx vm create node --port 3000 --port 9222:auth --region us --timeout-minutes 30
hx vm create --image-name node --image-id < image-i d > --port 3000 --auth --enable-recording
# Launch from a memory snapshot
hx vm create my_snapshot --snapshot
hx vm create --snapshot-name my_snapshot --snapshot-id < snapshot-i d >
# Launch a macOS sandbox (Beta) or reuse a persistent disk
hx vm create --macos --region us --cpu 8 --memory 8g --timeout-minutes 60
hx vm create --disk-id < disk-i d > --region us --cpu 8 --memory 8g
# List, inspect, and stop
hx vm list
hx vm list --status closed --page 1 --limit 20
hx vm get < sandbox-i d >
hx vm stop < sandbox-i d >
hx vm stop --all --force
# Linux sandbox from a built-in or custom image
hx vm create node
hx vm create node --port 3000 --port 9222:auth --region us --timeout-minutes 30
hx vm create --image-name node --image-id <image-id> --port 3000 --auth --enable-recording
# Launch from a memory snapshot
hx vm create my_snapshot --snapshot
hx vm create --snapshot-name my_snapshot --snapshot-id <snapshot-id>
# Launch a macOS sandbox (Beta) or reuse a persistent disk
hx vm create --macos --region us --cpu 8 --memory 8g --timeout-minutes 60
hx vm create --disk-id <disk-id> --region us --cpu 8 --memory 8g
# List, inspect, and stop
hx vm list
hx vm list --status closed --page 1 --limit 20
hx vm get <sandbox-id>
hx vm stop <sandbox-id>
hx vm stop --all --forceVerified hx vm create Flags
- Target:
--image-name,--image-id,--snapshot,--snapshot-name,--snapshot-id,--macos,--disk-id - Resources & region:
--region,--cpu,--memory,--disk,--timeout-minutes - Networking, storage & recording:
--port(<port>,<port>:auth,<port>:public),--auth,--mount,--allow-internet,--allow-out,--deny-out,--enable-recording - Secrets (Linux):
--secret,--secret-version,--vault,--1password-token,--1password-vault,--1password-field
Outbound Network & Exposed Ports
# Set outbound policy at creation or live on a running sandbox
hx vm create node --allow-internet=false --allow-out api.example.com --allow-out 1.1.1.1
hx vm network set < sandbox-i d > --deny-out 203.0.113.0/24
hx vm network set < sandbox-i d > --allow-internet=false --allow-out api.example.com
hx vm network clear < sandbox-i d >
# Expose / unexpose ports on a running sandbox
hx vm expose < sandbox-i d > --port 3000
hx vm expose < sandbox-i d > --port 3000 --auth
hx vm expose < sandbox-i d > --port 3000:auth
hx vm unexpose < sandbox-i d > --port 3000
# Set outbound policy at creation or live on a running sandbox
hx vm create node --allow-internet=false --allow-out api.example.com --allow-out 1.1.1.1
hx vm network set <sandbox-id> --deny-out 203.0.113.0/24
hx vm network set <sandbox-id> --allow-internet=false --allow-out api.example.com
hx vm network clear <sandbox-id>
# Expose / unexpose ports on a running sandbox
hx vm expose <sandbox-id> --port 3000
hx vm expose <sandbox-id> --port 3000 --auth
hx vm expose <sandbox-id> --port 3000:auth
hx vm unexpose <sandbox-id> --port 3000See Network Policies for rule precedence and target formats.
Run Commands & Background Processes (hx vm exec, hx vm process)
Run a one-shot command:
hx vm exec < sandbox-i d > 'pwd'
hx vm exec --cwd /tmp --env FOO=bar --timeout-ms 30000 < sandbox-i d > 'echo $FOO'
hx vm exec <sandbox-id> 'pwd'
hx vm exec --cwd /tmp --env FOO=bar --timeout-ms 30000 <sandbox-id> 'echo $FOO'Manage long-running background processes:
hx vm process start < sandbox-i d > 'python3 -m http.server 3000'
hx vm process list < sandbox-i d > --status running --limit 20
hx vm process get < sandbox-i d > < process-i d >
hx vm process wait < sandbox-i d > < process-i d > --timeout-ms 60000
hx vm process stream < sandbox-i d > < process-i d > --from-seq 120 --show-seq
printf 'hello\n' | hx vm process stdin < sandbox-i d > < process-i d > --from-stdin --eof
hx vm process signal < sandbox-i d > < process-i d > --signal TERM
hx vm process kill < sandbox-i d > < process-i d >
hx vm process start <sandbox-id> 'python3 -m http.server 3000'
hx vm process list <sandbox-id> --status running --limit 20
hx vm process get <sandbox-id> <process-id>
hx vm process wait <sandbox-id> <process-id> --timeout-ms 60000
hx vm process stream <sandbox-id> <process-id> --from-seq 120 --show-seq
printf 'hello\n' | hx vm process stdin <sandbox-id> <process-id> --from-stdin --eof
hx vm process signal <sandbox-id> <process-id> --signal TERM
hx vm process kill <sandbox-id> <process-id>Open an Interactive Terminal
Launch an interactive shell inside a running sandbox with hx vm connect:
# Pick an active sandbox interactively, or pass a sandbox ID
hx vm connect
hx vm connect < sandbox-i d >
# Override command, working directory, env vars, or terminal dimensions
hx vm connect < sandbox-i d > --command python3 --arg -i --cwd /tmp --env FOO=bar
hx vm connect < sandbox-i d > --rows 40 --cols 120
# Pick an active sandbox interactively, or pass a sandbox ID
hx vm connect
hx vm connect <sandbox-id>
# Override command, working directory, env vars, or terminal dimensions
hx vm connect <sandbox-id> --command python3 --arg -i --cwd /tmp --env FOO=bar
hx vm connect <sandbox-id> --rows 40 --cols 120By default, hx vm connect launches /bin/bash -i -l. Also accepts --timeout-ms and --use-shell.
Filesystem Operations (hx vm file, hx vm cp, hx vm read)
Copy & Read Shorthands
# Copy between local machine and sandbox (or between two sandboxes)
hx vm cp ./local.txt < sandbox-i d > :/tmp/local.txt --overwrite
hx vm cp < sandbox-i d > :/tmp/local.txt ./downloaded.txt
hx vm cp < sandbox-i d > :/tmp/a.txt < sandbox-i d > :/tmp/b.txt
# Read file contents directly (sandbox ID and path are separate arguments)
hx vm read < sandbox-i d > /tmp/file.txt
hx vm read --encoding base64 --offset 0 --length 128 < sandbox-i d > /tmp/file.bin
# Copy between local machine and sandbox (or between two sandboxes)
hx vm cp ./local.txt <sandbox-id>:/tmp/local.txt --overwrite
hx vm cp <sandbox-id>:/tmp/local.txt ./downloaded.txt
hx vm cp <sandbox-id>:/tmp/a.txt <sandbox-id>:/tmp/b.txt
# Read file contents directly (sandbox ID and path are separate arguments)
hx vm read <sandbox-id> /tmp/file.txt
hx vm read --encoding base64 --offset 0 --length 128 <sandbox-id> /tmp/file.binFull Filesystem Subcommands (hx vm file)
| Command | Key Flags | Description |
|---|---|---|
hx vm file ls <sandbox-id> <path> | --depth, --long | List directory entries. |
hx vm file exists <sandbox-id> <path> | — | Check whether a path exists. |
hx vm file stat <sandbox-id> <path> | — | Inspect size, mode, and timestamps. |
hx vm file cat <sandbox-id> <path> | --offset, --length, --encoding | Read file contents. |
hx vm file write <sandbox-id> <path> | --data, --from-stdin, --append, --encoding, --mode | Write or append to a file. |
hx vm file write-batch <sandbox-id> <manifest-path> | — | Write multiple files from a JSON manifest. |
hx vm file upload <sandbox-id> <local-path> <remote-path> | --overwrite | Upload a local file. |
hx vm file download <sandbox-id> <remote-path> <local-path> | --overwrite | Download a remote file. |
hx vm file presign-upload <sandbox-id> <path> | --expires-in-seconds, --one-time | Generate a presigned upload URL. |
hx vm file presign-download <sandbox-id> <path> | --expires-in-seconds, --one-time | Generate a presigned download URL. |
hx vm file mkdir <sandbox-id> <path> | --parents, --mode | Create a directory. |
hx vm file rm <sandbox-id> <path> | --recursive, --force | Remove a file or directory (aliases: remove, delete). |
hx vm file mv <sandbox-id> <from> <to> | --overwrite | Move or rename a path (aliases: move, rename). |
hx vm file cp <sandbox-id> <from> <to> | --recursive, --overwrite | Copy a path inside the sandbox. |
hx vm file chmod <sandbox-id> <path> <mode> | --recursive | Change file permissions. |
hx vm file chown <sandbox-id> <path> [uid] [gid] | --recursive | Change file ownership. |
hx vm file watch <sandbox-id> [path] | --from-cursor | Watch filesystem change events. |
Read Sandbox Diagnostic Logs (hx vm logs)
List available diagnostic logs or read/follow a specific stream (chrome, captcha, proxy, window-manager, vnc, selenium, ffmpeg, port-forward, xvfb):
hx vm logs < sandbox-i d >
hx vm logs < sandbox-i d > chrome --tail 500
hx vm logs < sandbox-i d > captcha --follow
hx vm logs < sandbox-i d > ffmpeg --all
hx vm logs <sandbox-id>
hx vm logs <sandbox-id> chrome --tail 500
hx vm logs <sandbox-id> captcha --follow
hx vm logs <sandbox-id> ffmpeg --allVolumes, Images, Snapshots & Persistent Disks
Volumes (hx vm volumes)
hx vm volumes create my-workspace
hx vm volumes ls --page 1 --limit 20
hx vm volumes get < volume-i d >
hx vm volumes delete my-workspace --force
# Mount at creation time
hx vm create node --mount < volume-i d > :/mnt/workspace
hx vm create node --mount < volume-i d > :/mnt/cache:ro
hx vm volumes create my-workspace
hx vm volumes ls --page 1 --limit 20
hx vm volumes get <volume-id>
hx vm volumes delete my-workspace --force
# Mount at creation time
hx vm create node --mount <volume-id>:/mnt/workspace
hx vm create node --mount <volume-id>:/mnt/cache:roCustom Images (hx vm image)
# Remote Dockerfile build (no local Docker needed)
hx vm image build --remote ./my-app app-prod --dockerfile Dockerfile
# Export a local Docker image
hx vm image build node:22 custom_node --env NODE_ENV=production --entrypoint 'npm run start'
# Inspect, wait, cancel, list, and delete
hx vm image status < build-i d >
hx vm image wait < build-i d > --wait-timeout 35m --poll-interval 3s
hx vm image cancel < build-i d >
hx vm image list --source team --search app
hx vm image delete < name | id > --force
# Remote Dockerfile build (no local Docker needed)
hx vm image build --remote ./my-app app-prod --dockerfile Dockerfile
# Export a local Docker image
hx vm image build node:22 custom_node --env NODE_ENV=production --entrypoint 'npm run start'
# Inspect, wait, cancel, list, and delete
hx vm image status <build-id>
hx vm image wait <build-id> --wait-timeout 35m --poll-interval 3s
hx vm image cancel <build-id>
hx vm image list --source team --search app
hx vm image delete <name|id> --forceAdditional verified build flags: --remote-full-context, --cpu, --memory, --disk, --rootfs-disk, --yes.
Memory Snapshots (hx vm snapshot)
hx vm snapshot create < sandbox-i d > my_snapshot
hx vm snapshot list --limit 20 --image-name node --status created
hx vm snapshot get < name | id >
hx vm snapshot delete < name | id > --force
hx vm snapshot create <sandbox-id> my_snapshot
hx vm snapshot list --limit 20 --image-name node --status created
hx vm snapshot get <name|id>
hx vm snapshot delete <name|id> --forcePersistent Mac Disks (Beta) (hx vm disks)
hx vm disks list
hx vm disks list --defaults --region us
hx vm disks list --snapshots
hx vm disks create --source < default-or-snapshot-i d > --name workspace --region us
hx vm disks get < disk-i d >
hx vm disks snapshot < disk-i d > --name before-install
hx vm disks delete < disk-i d >
hx vm disks list
hx vm disks list --defaults --region us
hx vm disks list --snapshots
hx vm disks create --source <default-or-snapshot-id> --name workspace --region us
hx vm disks get <disk-id>
hx vm disks snapshot <disk-id> --name before-install
hx vm disks delete <disk-id>create and snapshot also accept --id for idempotent retries. See macOS Sandboxes (Beta) for full workflows.