Lifecycle states
When you pause a capsule, Wrenn writes the full VM state — memory, processes, open files — to disk as a snapshot. Resuming restores that snapshot, so the capsule comes back exactly as you left it.
Waiting for a capsule to be ready
After creating a capsule withoutwait=True, call wait_ready() to block until it reaches running status:
wait_ready raises TimeoutError if the capsule does not reach running within timeout seconds. It raises RuntimeError if the capsule enters error, stopped, or paused state while waiting.
Checking status
Pausing a capsule
Pausing snapshots the running VM to disk and frees the host CPU and memory. The capsule’s filesystem and process state are preserved exactly.Resuming a capsule
Resume restores the snapshot and brings the capsule back torunning. Memory, processes, and open file descriptors are all restored.
Capsule.connect() also resumes a paused capsule automatically:
Destroying a capsule
Destroying a capsule permanently deletes the VM and all data on its filesystem.Inactivity timeout and ping
When you create a capsule with atimeout value, the capsule is automatically paused after that many seconds of inactivity. An activity is any exec or ping call.
Call ping() to reset the inactivity timer without executing a command: