group:member, or artifact path.
Guest writeback
Use.guestFlush("required") on snapshot builders or { guestFlush: "required" } in source.fork, source.forkMany, and source.pause options. The default "auto" flushes live disk-only captures, but adds no optional flush to full captures, forks, or pause. "skip" retains mandatory storage barriers. A paused disk capture needs a matching prior flush; cloud rejects non-Auto policies. See guest flush policy reference.
Snapshot
A snapshot retains the backend that created or opened it.Static methods
Snapshot.builder()
fromSandbox(); see SnapshotBuilder for options.
Parameters
namestringMember name within its group; generated when omitted.
Returns
Builder for configuring the snapshot.
Example
Example
builder.createArchive()
Example
Example
Snapshot.open()
Example
Example
group:member, or path. Cheap metadata validation only; it does not read the upper file. Use verify() for content checks.
Parameters
pathOrNamestringGroup head or
group:member selector or filesystem path.Returns
The opened snapshot.
Snapshot.get()
Example
Example
SnapshotHandle.
Parameters
nameOrDigeststringPublic identifier understood by the active backend, such as a local name/digest or cloud snapshot ID.
Returns
Lightweight handle returned by the active backend.
Snapshot.list()
Example
Example
Returns
All indexed snapshot handles.
Snapshot.listDir()
UnsupportedError.
Parameters
dirstringDirectory to scan for artifact subdirectories.
Returns
Parsed snapshots found in the directory.
Snapshot.remove()
Example
Example
force is set. A group’s head cannot be removed while other members remain, even with force; select another head first.
Parameters
pathOrNamestringGroup head,
group:member, unambiguous snapshot ID or digest, or artifact path.opts.forcebooleanRemove even if the snapshot has indexed children. Defaults to
false.Snapshot.reindex()
Example
Example
UnsupportedError.
Parameters
dirstringDirectory to scan. Defaults to the configured snapshots dir.
Returns
Promise<number>
Count of artifacts indexed.
Snapshot.save()
.msb archive. The recorded manifest is archived as-is, so create the snapshot with recordIntegrity() if receivers must verify content. See SaveOpts for bundling options.
Parameters
nameOrPathstringGroup head,
group:member, or artifact path to bundle.outstringOutput archive path.
optsSaveOptsBundling options. All fields default to
false.Example
Example
Snapshot.load()
.msb or .tar) into the snapshots directory. Structural and archive-entry checks run during import; recorded payload integrity is preserved for explicit verify(). Compression is detected from magic bytes.
Parameters
archivestringPath to the archive to unpack.
deststringDestination directory. Defaults to the snapshots directory.
Returns
Handle to the loaded snapshot.
Example
Example
Snapshot.loadWithOptions()
Snapshot.loadMany()
Snapshot.groupHead()
group:member. Returns the group, previous and current snapshot IDs, reason, and whether the head changed. See group selection.
Import options
Options forLoadOpts.
With divergent tips, the existing head stays selected; a new group has no head. Select a member explicitly. Identical members may be reused; conflicting identities fail. See archive imports.
SandboxHandle
handle.snapshot()
SandboxHandle. Local live disk captures preserve the source’s running or paused state. Cloud requires a stopped persistent source. Use the returned artifact path or sandbox:member to open it later.
Parameters
namestringMember name within the source sandbox’s group.
Returns
The created snapshot artifact.
Example
Example
Snapshot instance members
ASnapshot represents a backend-neutral snapshot and retains the backend
that created or opened it. Returned by Snapshot.builder().create(),
Snapshot.open(), and handle.snapshot().
snap.saveTo()
UnsupportedError.
Example
Example
snap.copyTo()
UnsupportedError when save() is awaited.
Example
Example
snap.verify()
Example
Example
report.checkpoint.
Returns
Verification result.
SnapshotHandle
A metadata and lifecycle handle for an existing snapshot.Returned by Snapshot.get(), Snapshot.list(), Snapshot.load()
snapshotHandle.open()
Snapshot.list()); fetch a live handle via Snapshot.get() first.
snapshotHandle.remove()
force is set. Throws if this handle is read-only.
Example
Example
snapshotHandle.saveTo()
Snapshot.list() are metadata-only; fetch a live handle
with Snapshot.get() first. Cloud returns UnsupportedError.
SnapshotBuilder
Fluent builder for a snapshot, returned bySnapshot.builder(name). Every setter mutates in place and returns this, so calls chain. The source sandbox is required: call .fromSandbox() before .create().
.fromSandbox()
.create() fails without it.
Parameters
sourceSandboxstringName of the source sandbox. Local disk capture supports running, paused, stopped, and crashed sources. Cloud requires a stopped persistent source.
.group()
.destDir()
Parameters
destDirstringParent directory to create the artifact in (e.g. a larger volume).
.label()
key=value label to the snapshot manifest. May be called repeatedly.
Parameters
keystringLabel key.
valuestringLabel value.
.force()
.recordIntegrity()
snapshot.full()
.guestFlush()
GuestFlush is "auto" | "required" | "skip"; defaults to "auto". See guest writeback.
.create()
Example
Example
Returns
The created snapshot artifact.
SnapshotCopyBuilder
Returned bysnapshot.copyTo(). Each setter mutates the builder
and returns this.
RestoreBuilder
Restore into a new detached sandbox. Disk boots fresh; full resumes execution. See restore examples and progress.Example
Example
Image, replacement, and startup-command options are not accepted. Full restore requires matching CPU and memory settings, keeps captured network devices, and cannot apply a new guest security profile. Use disk-only restore to change these.
Full restore rejects missing external filesystems and additional disks by default. Use
allowMissingResources() to resume with unavailable devices and warnings. This is separate from strict/relaxed validation of supplied mappings; inheritance does not waive missing backing. Root and owned storage remain required.
Destination options
Destination options
Omitted controls retain destination defaults. Durations are non-negative finite seconds, rounded up. Network policy accepts
NetworkPolicy or NetworkPolicyBuilder. Use v => v.captured() for a private captured volume.Compaction
Compact a local sandbox’s root or owned disks. See compaction for examples and recovery requirements.Options and results
Options and results
Defaults to the root and owned data disks; excludes named/external volumes and directories. Requires a running or fully stopped local sandbox. Fewer than two sealed layers means no change; no eligible disks returns an empty result with zero counts.Results include aggregate counts and per-disk entries keyed by
guestPath. materializedBytes counts copied bytes, not reclaimed space. Times are microseconds: per-disk totalUs covers preparation; aggregate totalUs also includes switching; pauseUs measures the shared VM pause.Types
SaveOpts interface
Bundle options forSnapshot.save() and instance saveTo() methods. Boolean fields default to false; selective-export fields are omitted by default.
Used by Snapshot.save() and instance saveTo() methods
SnapshotScope type
Scope of what a snapshot captures:"disk" for filesystem state or "full" for disk plus VM execution state.
Returned by snap.scope · SnapshotHandle.scope
SnapshotVerifyReport union
Result ofsnap.verify(). Checkpoint snapshots add checkpoint: { kind: "verified", root: string }; the existing upper projection stays intact for disk-snapshot compatibility.
Returned by snap.verify()