~/.microsandbox/config.json. All fields are optional. A missing file or empty JSON object is equivalent to using the defaults.
Full example
Full example
Top-level fields
deployment_profile
Set deployment_profile when the local host must enforce one deployment policy for every sandbox:
single-tenant preserves the network configuration requested by each sandbox. multi-tenant applies the host-runtime isolation floor for shared infrastructure. The configured value is authoritative on create and restart, so a per-sandbox CLI or SDK option cannot weaken or replace it. A programmatic LocalBackendBuilder::deployment_profile() override takes precedence over the file. When the field is absent or null, each sandbox selects its own profile and defaults to single-tenant.
The parser also accepts the internal wire spellings single_tenant and multi_tenant for compatibility, but the kebab-case values above are canonical in this human-edited file.
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 config and resolve runtime paths with the same precedence used by sandbox startup: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.
ssh
The timeout applies to host-side SSH sessions created by
msb ssh, msb ssh serve, and the local SDK backend. SSH traffic resets the timer. This setting is separate from a sandbox lifecycle idle timeout: disconnecting SSH does not stop the sandbox, and sandbox activity policy does not change the SSH timeout.
Explicit CLI or SDK options override this value. The setting is resolved when a client or server endpoint is prepared, so changing config.json does not alter existing connections. Programmatic local backends can override the persisted value with LocalBackendBuilder::ssh_inactivity_timeout_secs().
sandbox_defaults
Defaults applied to sandboxes unless overridden per-sandbox.
Explicit CLI or SDK options win over config.json, and config.json wins over built-in defaults. microsandbox resolves the effective values once when it creates a local sandbox and persists that resolved sandbox configuration; changing the global file affects future creations, not existing sandboxes.
For workload effects, host requirements, filesystem expectations, and verification steps for these settings, see Optimization.
sandbox_defaults.oci
Defaults applied only when the sandbox rootfs is an OCI image.
root_disk and upper_size_mib are mutually exclusive. For a portable flat default, use clone: "auto"; it attempts a native reflink and safely falls back to a sparse copy. Use clone: "reflink" only when failure is preferable to copying on a host filesystem without reflink support.
When the root-disk default is flat, plain msb pull IMAGE also prepares the reusable flat artifact. An explicit msb pull IMAGE --materialize layered|flat|all always wins.
runtime
runtime.placement_profiles
Placement profiles let an operator define safe host topology policy once while callers select it by name. numa.mode is prefer_single, strict_single, or inherit; memory.mode is follow_cpu or inherit. Multi-node guest placement is not enabled in this release: prefer_single falls back to inherited host NUMA behavior when one node cannot fit, while strict_single fails clearly because it is an explicit guarantee.
follow_cpu requires managed CPU placement (auto, spread, or compact). Linux prefers the selected node for ordinary profiles and allows memory to spill elsewhere under pressure; strict_single uses a required binding instead. If CPUs span nodes, capacity is already insufficient, or the kernel rejects a best-effort affinity or memory-policy syscall, an ordinary profile starts with inherited memory placement. Windows keeps ordinary memory inherited because its preferred-node allocation cannot be undone if a later vCPU affinity attempt falls back; strict_single can still request required preferred-node allocation. Windows checks current boot-time availability, but does not expose equivalent per-node total capacity for a hard future-growth promise. macOS inherits ordinary CPU and memory scheduling for non-strict profiles because it has no equivalent hard-affinity API.
runtime.block_writeback
Use a fixed policy only when representative measurements justify a different per-disk window:
pool_mib is a live pressure budget, not eagerly allocated RAM. Every eligible writable disk in the same MSB_HOME receives a weighted max-min fair share: disks with a smaller configured maximum keep that smaller value, and the remaining pool is divided equally across the rest. Creating another sandbox never fails merely because this pool is full. Existing VMMs observe membership changes within 250 ms; if a disk already owns more dirty data than its new share, libkrun retires accounted ranges and pauses later writes until it converges below the target. A guest write already reserved before the target changed is allowed to complete safely. fixed and an explicitly pooled auto policy are unsupported on other hosts.
Hardware CRC32C, the guest kernel preemption model, x2APIC, APICv/AVIC capability, vCPU affinity mechanics, and the pure-Rust ext4 writer are implementation or capability details rather than user policy, so they intentionally have no global config keys. The optimization guide explains how those automatic layers interact with the configurable policy.
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:- Explicit SDK auth via
.registry(|r| r.auth(...))on the sandbox builder - OS keyring entries created by
msb registry login - Config file
registries.hosts.<host>.authentries inconfig.json - Docker config
~/.docker/config.jsoncredential helpers - 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: