Skip to content

bhatti create

Create an isolated Linux VM on your own Linux (KVM) or Apple Silicon (HVF) host. New sandboxes have no NIC unless you opt in to networking or configure a server-wide egress default.

Synopsis

bhatti create [flags]

Description

Boots a krucible VM and returns once its guest agent responds. Sandbox names are optional; if the name is already in use, the server returns that existing sandbox and does not apply requested changes. Check with inspect rather than assuming a rerun changed its policy. The default vCPU count is 1 and default memory is 1024 MB. Without --keep-hot, idle guests undergo thermal transitions; an explicit stop is a power-off, not a memory-preserving snapshot. See Durability.

--from forks an existing sandbox, including its memory, disk and attached volume copies; snapshot names go to snapshot resume instead. It inherits the source's network policy. The CLI rejects --net, --egress, --allow-host, --allow-cidr and --allow-siblings with --from; the server also rejects --mount and create-time --secret-grant on a fork. A fork inherits independent copies of its source's active grants, keeping their placeholders, hosts and expiry. Copied guest env placeholders still resolve. Inspect bhatti secret grants and revoke unwanted inherited access by the fork's own grant IDs; revoking a source grant does not revoke the fork's copy. A new secret grant after creation adds access rather than replacing an inherited grant. Forking is not a cross-host live migration. See Fork & branch.

A stored --secret NAME puts the real value in guest env; --secret-grant NAME@host[,host...] puts a placeholder there and authorizes HTTPS header substitution for those hosts. Grants do not grant network access. Credentials for agents explains the boundary. --file reads local bytes during creation; --volume refers to an existing bhatti volume, while --mount is a live virtio-fs host-directory bind and requires a host path under the server's configured mount_roots (empty by default). Host mounts are not a copy of the host directory.

With --template, the server merges request-side --secret and --file with template defaults. Unknown request-side secrets cause an error rather than disappearing. Existing sandboxes made before v2.4 keep their old guest agent; fork, grant and disk growth can return 409 asking you to recreate them.

Examples

# No NIC: host-to-guest exec still works.
bhatti create --name offline --label purpose=analysis
bhatti exec offline -- sh -c 'echo ready'

# Scoped egress and HTTPS header substitution for one agent.
bhatti secret set MODEL_KEY 'your-key'
bhatti create --name model-agent --allow-host api.openai.com \
  --secret-grant MODEL_KEY@api.openai.com

# An internet-enabled browser, including permitted sibling connections.
bhatti create --name browser --image browser --net --allow-siblings

# Fork a sandbox, retaining its network policy; new disk/volume copies.
bhatti create --name branch --from model-agent

# Create the bhatti volume first; configure the server's mount_roots to
# include /srv/bhatti-share before using --mount.
bhatti volume create --name workspace --size 5120
bhatti create --name worker --volume workspace:/workspace \
  --mount /srv/bhatti-share:/mnt/share:ro --disk-size 8192

Options

| Flag | Default | Description | | ---- | ------- | ----------- | | --name <name> | Auto-generated | Sandbox name. | | --image <name> | Server default | Rootfs tier/image (minimal, browser, docker, computer, or installed custom image). | | --from <sandbox> | — | Fork memory, disk and volume copies from an existing sandbox; inherited network policy cannot be overridden. | | --cpus <float> | 1 | Requested number of vCPUs; subject to server validation and limits. | | --memory <MB> | 0 (server uses 1024) | Guest memory in MB. | | --disk-size <MB> | 0 (image size) | Rootfs disk size; may require v2.4+ guest agent for growth. | | --env <K=V,K=V> | — | Guest environment variables, comma-separated. | | --init <command> | — | Boot-time init command, rerun after power-off/start. | | --keep-hot | false | Disable idle thermal transitions for an active agent/service. | | --hugepages | false | Request 2 MB hugepages. | | --template <name-or-id> | — | Start with template defaults. | | --volume <name:guest-path[:ro]> | — | Attach an existing bhatti persistent volume; repeatable. | | --mount <host-path:guest-path[:ro]> | — | Live virtio-fs host bind; absolute host path under server mount_roots; repeatable. | | --secret <name> | — | Inject stored plaintext into guest env; repeatable. | | --secret-grant <NAME@host[,host...]> | — | Put placeholder in guest env and authorize HTTPS-header substitution; repeatable. | | --file <local-path:guest-path> | — | Inject local file bytes at boot; repeatable. | | --label <key=value> | — | Set a label; repeatable. | | --net | false | Public internet egress (--egress public); conflicts with --egress none/deny. | | --egress <none|deny|public> | Server default_egress (none on fresh installs) | Choose no NIC, NIC with allow rules only, or public internet. | | --allow-host <host> | — | Exact public host or *.example.com pattern; repeatable. | | --allow-cidr <CIDR> | — | Allowed network (except hard-denied destinations); repeatable. | | --allow-siblings | false | Permit this sandbox to send TCP/UDP to same-owner networked sandboxes, not to other owners. |

See Global flags for --url, --token, --json, --timing, --data-dir.

Output

sandbox/offline created (1 vCPU, 1024 MB)
  Net:   none (create with --net for internet access)
  Shell: bhatti shell offline

If networking is enabled, creation prints an IP: line. Create-time grants also print the approved hosts and that the guest variable is a placeholder. --json prints the full sandbox record. A name already in use produces sandbox/NAME unchanged (already exists) even when new flags differ; inspect it before depending on new configuration.

See also