Skip to main content
The smolvm machine provider reaches a running smolvm microVM, by name, and runs the programs it captures in it. Each machine has its own guest kernel, on macOS, Linux and Windows. You create and start the machine; Mirage only runs programs in it. Python SDK and Node.

Installation

Install the smolvm CLI. Create and start a machine from an image that has what connecting the workspace needs:

Usage

captures defaults to @external: every program Mirage does not have itself. Name @python to run Python in the machine too.

Connecting the workspace

Pick a mount_type. With ssh, the guest needs sshfs; with mirage, mirage-fuse. With own, put sandbox.yaml in the machine, in its image or a directory passed with --volume, and start Mirage:

Pausing the machine

To pause the machine when the workspace pauses, set on_pause: pause on it:
workspace.pause() closes the workspace, then runs smolvm machine pause, which saves the machine’s memory and disks to its data directory and stops its VM. The next line resumes it with smolvm machine resume, running processes included. This needs smolvm 1.18 or later, and a host that can take smolvm’s portable checkpoints; where smolvm refuses the pause, workspace.pause() raises smolvm’s error and the machine keeps running. Without on_pause, workspace.pause() leaves the machine running unless the call names it. See Pause.

Notes

  • Host files reach the machine only through directories passed with --volume at boot.
  • The machine must be running or paused; Mirage resumes a paused one. Start a stopped or created machine, or clone a frozen machine before using it. Mirage cannot run commands while a machine is unreachable.
  • Lines sent to one machine share its files and processes. Give each tenant its own machine.