Skip to main content
microsandbox reads its global configuration from ~/.microsandbox/config.json. All fields are optional. A missing file or empty JSON object is equivalent to using the defaults.

Top-level fields

database

paths

All path fields are optional. When null, they resolve relative to home. On Windows, the default home is %USERPROFILE%\.microsandbox. JSON strings can use escaped backslashes such as "C:\\Users\\you\\.microsandbox\\lib\\libkrunfw.dll" or forward slashes such as "C:/Users/you/.microsandbox/lib/libkrunfw.dll".

Rust SDK path helpers

Rust callers can inspect the active local config and resolve runtime paths with the same precedence used by sandbox startup. microsandbox::config::config() uses the active default backend and returns Unsupported when that backend is cloud.
When your code owns an explicit local backend, prefer the backend-owned config:
LocalBackend has two plain constructors alongside the builder. LocalBackend::lazy() is synchronous and defers opening (and migrating) the local sandbox database until the first operation; it is what backend resolution uses when no backend is set explicitly. LocalBackend::new().await? opens the database up front, so startup fails fast if the database is unusable.

sandbox_defaults

Defaults applied to every sandbox unless overridden per-sandbox.

sandbox_defaults.oci

Defaults applied only when the sandbox rootfs is an OCI image.

registries

registries.hosts

A map of registry hostnames to settings. Each host entry can mark the registry as insecure (plain HTTP) and can include an auth entry. Each auth entry specifies a username and exactly one credential source.

Host entry fields

Auth entry fields

Exactly one of store, password_env, or secret_name must be set per entry. Setting none or more than one is an error.

Auth resolution order

When pulling from a registry, microsandbox resolves credentials in this order:
  1. Explicit SDK auth via .registry(|r| r.auth(...)) on the sandbox builder
  2. OS keyring entries created by msb registry login
  3. Config file registries.hosts.<host>.auth entries in config.json
  4. Docker config ~/.docker/config.json credential helpers
  5. Anonymous (no authentication)

metrics

profiles

Named backend profiles keyed by profile name; active_profile selects the default. How profiles participate in backend selection, including the full resolution order, is documented in Backends. Supported credential references for api_key_ref: