Request an invite
Docs menu

osmates run

Run a program in a throwaway clone of a machine.

Usage
osmates run [<options>] [<machine>] [-- <arguments> ...]

Clones the machine, starts the clone, copies --copy-in files in and runs the program. Then it copies --copy-out files out and deletes the clone, whatever happened. The source doesn't change.

The output streams here as it comes. The command exits with the program's status, 124 when it ran out of time, 125 when the run failed, or 128 plus the signal that ended it.

Control-C stops the program and deletes the clone. A clone a person took control of stays until they give it back.

Throwaway clones and the template for agents: https://osmates.com/docs/clone

Examples

sh
osmates run -- uname -a
osmates run dev --copy-in ./tests:/tmp/tests -- sh /tmp/tests/run.sh
osmates run dev --workspace . -- make test

Arguments

<machine>

The machine to clone; the template for agents when left out.

The template for agents is Debian without a desktop, with 2 CPUs, 1 GiB of memory and an 8 GiB disk. The first run that needs it makes it, a minute or two more. osmates template list lists it.

--snapshot <snapshot>

A snapshot of the machine to clone instead of its current state.

--copy-in <local:guest>Repeatable

Copy a local file or folder into the clone first.

--copy-out <guest:local>Repeatable

Copy a file or folder out of the clone afterwards, whether the program succeeded or not.

It arrives quarantined, as a download does, so macOS checks an app or a script from it before it first opens. xattr -dr com.apple.quarantine <path> removes that, after chmod -R u+rwX <path> where items are read-only.

--workspace <local[:guest]>

A folder of the Mac to work on in the clone.

It goes in as osmates workspace push puts it, before --copy-in, and its diff comes out after --copy-out. A diff that fails keeps the clone, and the command names it.

--diff <file>

Where the workspace's patch goes. Default: ~/Library/Application Support/OSMates/Workspaces.

--queue

Wait for a place instead of being refused.

Two macOS machines run at once, and on OSMates Free two machines in all.

--user <user>

The guest account to run as. Default: root, or LocalSystem in Windows.

With --desktop, the account expected at the screen. Windows takes an account only with --desktop.

--workdir <workdir>

The working directory. Default: the account's home, C:\ in Windows, or the user's profile with --desktop.

--env <name=value>Repeatable

Add a variable to the program's environment.

--timeout <timeout>

Seconds the program runs before it's killed. Default: no limit.

--desktop

Run as the user signed in at the screen, on their desktop.

--arch <arch>

Which code of a program built for several architectures runs.

One of arm64, x64.

<arguments>Repeatable

The program and its arguments, after --.

Report a problem with this page