Request an invite
Docs menu

vm_run

Run a program in a throwaway clone.

Clones a machine (or one of its snapshots), starts the clone, copies files in, runs the program, copies files out whether it succeeded or not, and deletes the clone whatever happens; a clone the person took control of stays until they give it back, close its window or stop it. Returns the exit status and output like vm_exec. With desktop, a clone at its login screen is signed in first with the source's password. The source machine is not changed. A macOS clone waits while two macOS machines run.

Profiles
full
Read-only
No
Destructive
No
Idempotent
No
Open world
Yes
Runs as a task
Optional

Parameters

architecturestring

Which code of a program built for several architectures runs.

One of arm64, x64.

argvarray of stringsRequired

The program and its arguments. No shell interprets them: pass ["sh", "-c", "..."].

copy_inarray of objects
copy_in[].guest_pathstringRequired

An absolute path in the guest.

copy_in[].host_pathstringRequired

An absolute path on this Mac.

copy_outarray of objects

Copied to the Mac afterwards; what arrives is quarantined, as a download is.

copy_out[].guest_pathstringRequired

An absolute path in the guest.

copy_out[].host_pathstringRequired

An absolute path on this Mac.

cwdstring

Working directory; default the account's home, C:\, or the user's profile with desktop.

desktopboolean

Run as the user signed in at the screen, on their desktop; user then names the account expected there. Default false.

envarray of strings

Variables to add to the environment, as NAME=value.

queueboolean

Waits while two macOS machines run, or the two machines OSMates Free runs; false refuses. Default true.

snapshotstring

A snapshot of it to clone instead.

sourcestring

The machine to clone; default the template for agents.

timeout_secondsinteger

Killed after this long; default 600, none in the background.

From 1 to 3600.

userstring

The guest account to run as; default root; in Windows only with desktop.

wait_secondsinteger

Seconds to wait before answering with a job to follow; default 20.

From 0 to 30.

workspaceobject

Copied in before copy_in; its diff comes out after copy_out.

workspace.diff_pathstring

Where the patch goes on this Mac; default ~/Library/Application Support/OSMates/Workspaces.

workspace.guest_pathstring

Where it goes in the guest; default the account's home and the folder's name.

workspace.host_pathstringRequired

A folder on this Mac, a git work tree's top or any other.

Output

The result's structured content is one of these objects.

JSON Schema: /schemas/0/mcp/tools/vm_run/output.json

running

jobstringRequired
statestringRequired

One of running.

run

clockobject

Holds one key: synced, drifted or unchecked.

clock.syncedobject
clock.driftedobject
clock.uncheckedobject
clonestringRequired
copiedOutarray of objectsRequired
copiedOut[].bytesintegerRequired

At least 0.

copiedOut[].destinationstringRequired
copiedOut[].filesintegerRequired
copiedOut[].sha256string
copiedOut[].verificationobjectRequired
exitCodeinteger
jobstringRequired
machinestring (uuid)Required
networkstring or object

One of connected, noAddress, off, detached, or an object that holds one key: noDNS, isolated, tunnelUnchecked, lost, unchecked, restricted or hostOnly.

network.noDNSobject
network.isolatedobject
network.tunnelUncheckedobject
network.lostobject
network.uncheckedobject
network.restrictedobject
network.hostOnlyobject
signalinteger
stderrobjectRequired
stderr.bytesintegerRequired

At least 0.

stderr.encodingstring

One of base64.

stderr.guestDatastringRequired
stderr.shownintegerRequired

At least 0.

stdoutobjectRequired
stdout.bytesintegerRequired

At least 0.

stdout.encodingstring

One of base64.

stdout.guestDatastringRequired
stdout.shownintegerRequired

At least 0.

timedOutbooleanRequired
verificationobjectRequired
verification.evidencestringRequired
verification.statusstringRequired

One of verified, unverified, failed.

workspaceobject
workspace.patchobjectRequired
workspace.patchBytesintegerRequired

At least 0.

workspace.patchPathstringRequired
workspace.reportobjectRequired
workspace.reportPathstringRequired

Fields nested deeper are in the schema.

Report a problem with this page