Skip to main content
The boxd machine provider reaches a boxd machine, by ID, and runs the programs it captures on it. A boxd machine is a full Ubuntu VM with its own kernel and a persistent disk. You create the machine; Mirage only runs programs on it. Python and Node.

Installation

Set api_key in the config, as a value or a credential pointer, or BOXD_API_KEY. Set region (fra or nyc) to the machine’s region, or BOXD_REGION; without either, the SDK looks in your account’s default region. Create the machine with the boxd CLI, the console or the SDK, and pass its ID as machine_id:
isolated keeps the machine off your organization’s private network and out of reach of its credentials, which suits programs an agent writes.

Usage

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

Connecting the workspace

boxd takes no mount_type. Put the files the programs need on the machine yourself, or pass them in on stdin.

The machine’s lifetime

The machine is yours: Mirage never creates, starts, stops or deletes it, and closing the workspace leaves it as it is. A machine in standby or hibernated wakes on the first line. A machine’s processes and disk survive between lines, so a background job started with nohup keeps running. Once the machine is stopped or deleted, a line exits 1, and its error names the fix:
A line that is running when the connection to the machine drops exits 129. The next line connects again.

Notes

  • Output comes back as the program wrote it, binary included, with stdout and stderr apart.
  • Piped input reaches the program as it is read. Without piped input, stdin starts closed.
  • Commands run concurrently, each with its own input and output.
  • A Mirage timeout stops every process of that run.
  • Size, region, networking and the machine’s idle timers stay boxd settings.