Skip to main content

Run your first sandbox

Prefer short commands such as msb run debian for everyday use. msb sandbox run debian and msb sbx run debian do the same thing, with the same flags. Explore the full group with msb sandbox --help.
Having trouble with a local installation? Choose your platform for setup checks and fixes. For release candidates or an exact version, see Versions.
1

Install microsandbox

For application code, install the SDK for your language. For terminal workflows, use one of the CLI options above. These examples run locally without a cloud account or daemon. You can switch to our managed cloud when you need hosted compute.
You can also provision the runtime with the CLI installer above or explicit SDK setup helpers. See Runtime setup for Node’s bundled binaries and Rust’s opt-out options.Check local virtualization support with:
For platform-specific setup notes, see Linux troubleshooting, macOS troubleshooting, or Windows troubleshooting.
2

Run code in a sandbox

Create an ephemeral sandbox, execute code inside it, and stop it when finished. Ephemeral sandboxes are removed after stopping, so the example can reuse the same name.
If you already ran an older version of this example and retained a sandbox named hello, remove it with msb stop hello followed by msb rm hello on the same backend, or choose another name. Stopping a persistent sandbox retains it for later restart.

What just happened?

Here’s what the local runtime did when you created the sandbox:
  1. Pulled the image from Docker Hub, unless it was already cached.
  2. Assembled a copy-on-write filesystem so changes inside the sandbox do not modify the base image.
  3. Booted a microVM as a child process with the resource limits you configured.
  4. Started the guest agent so the SDK can run commands and move data in and out.
The exec call uses the host-guest command channel, not SSH and not the sandbox network.
Ready for hosted compute? Use a remote context in your SDK, or switch the CLI connection. Our managed cloud needs no local VM. See managed cloud to choose a connection at startup and keep your sandbox workflow.

Next steps