Request an invite
Docs menu

osmates vm clone

Make a new machine from another, or from one of its snapshots, without copying its disk.

Usage
osmates vm clone [<options>] <source> [<name>]

The clone gets a new name, MAC address and identity. A running source is cloned as it is now, and keeps running.

With the name alone, the clone is of the template for agents. The first clone that needs the template makes it, a minute or two more.

--ephemeral and --owner-pid together make a machine for the life of a shell. The clone gets none of the source's port forwards.

--preset agent-sandbox makes an ephemeral clone for an agent to work in, on a copy of a folder. Start it, then run osmates workspace push. Its stop takes the workspace's diff.

Clones, templates and sandboxes: https://osmates.com/docs/clone

Examples

sh
osmates vm clone dev dev-test
osmates vm clone dev scratch --ephemeral --owner-pid $$
osmates vm clone dev sandbox --preset agent-sandbox

Arguments

<source>Required

The machine to clone; the template for agents when only the name is given.

A running machine is held while its disk is copied, longer when osmates vm info says its disk image is in many pieces. A clone of a template is a machine like any other.

<name>

The clone's name: lowercase letters, digits and hyphens.

--snapshot <snapshot>

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

--ephemeral

Delete the clone once it stops.

--keep-identifier

Keep a macOS source's machine identifier, so Xcode's provisioning UDID stays the same.

Only one machine with that identifier runs at a time.

--owner-pid <owner-pid>

Stop the clone once this process exits.

--clipboard <clipboard>

How the clipboard meets the Mac's: off, to-guest, to-mac or both. Default: the source's.

One of off, to-guest, to-mac, both.

--preset <preset>

Settings the clone takes together: agent-sandbox.

agent-sandbox makes an ephemeral clone with no shares and the clipboard off, and keeps a Windows or macOS screen on and unlocked while idle. Its network is never open. The clone of an open source reaches package registries, GitHub and AI model APIs. The clone of a limited source keeps its rules, minus those that reach this Mac or a local network. --egress and --allow set others. The clipboard, shares and network can't be opened later.

One of agent-sandbox.

--egress <egress>

The clone's network access: open, allowlist or blocked. Default: the source's.

One of open, allowlist, blocked.

--allow <rule>Repeatable

A destination the clone's allowlist allows; repeat for more.

--json

Print machine-readable JSON.

JSON output

With --json, it prints an object with these fields.

JSON Schema: /schemas/0/cli/vm/clone.json

acceleratedGraphicsboolean
accountobjectRequired
account.authorizedKeysarray of stringsRequired
account.enablesRemoteLoginbooleanRequired
account.userstringRequired
cameraobject
camera.devicestring
camera.onbooleanRequired
clipboardstringRequired

One of off, to-guest, to-mac, both.

cpuCountintegerRequired
createdAtstring (date-time)Required
creatorstring
credentialsarray of objects
credentials[].credentialstring (uuid)Required
credentials[].endedobject
credentials[].expiryobject or stringRequired

One of machineStop, never, or an object that holds one key: at.

credentials[].grantedAtstring (date-time)Required
credentials[].includesClonesbooleanRequired
credentials[].placeholderstringRequired
dataDisksarray of objects
dataDisks[].filestringRequired
dataDisks[].fromstringRequired
dataDisks[].sizeintegerRequired

At least 0.

discstring (uri)
diskBusstring

One of nvme.

diskSizeintegerRequired

At least 0.

displayobject
display.heightintegerRequired
display.pixelsPerInchinteger
display.scaleintegerRequired
display.widthintegerRequired
displayCountinteger
egressobject
egress.modestringRequired

One of open, allowlist, blocked.

egress.rulesarray of stringsRequired
enginestringRequired

One of virtualization, hypervisor.

firmwareobject
firmware.sha256stringRequired
firmware.versionstringRequired
firstAgentAnswerstring (date-time)
forwardsarray of objects
forwards[].gueststringRequired
forwards[].guestPortintegerRequired

At least 0.

forwards[].hostPortintegerRequired

At least 0.

forwards[].transportstringRequired

One of tcp, udp.

highDynamicRangeboolean
idstring (uuid)Required
importedobject
imported.bitLockerbooleanRequired
imported.formatstringRequired

One of vmdkSparse, vmdkFlat, vmdkSplitSparse, vmdkSplitFlat, vmdkStream, vmdkVMFS, hddExpanding, hddPlain, qcow2, raw, asif.

imported.fromstringRequired
imported.identitystringRequired

One of kept, new.

imported.leftBehindarray of objects or stringsRequired

Each item is one of firmwareVariables, guestTools, appSettings, or an object that holds one key: tpm, snapshots, savedStates or otherDisks.

imported.systemstringRequired

One of linux, macOS, windows, freeBSD.

isEphemeralbooleanRequired
keepsMacAwakeboolean
lastBuildobject
lastBuild.enginestring
lastBuild.signaturestringRequired
lastBuild.versionstringRequired
macOSobject
macOS.listedAtstring (date-time)
macOS.offerobject
macOS.reportedAtstring (date-time)Required
macOS.versionstringRequired
macOS.wayBackobject
memorySizeintegerRequired

At least 0.

namestringRequired
nestedVirtualizationboolean
networkobject

Holds one key: nat or vmnet.

network.natobject
network.vmnetobject
operatingSystemstringRequired

One of linux, macOS, windows, freeBSD.

originobject
origin.keptIdentifierboolean
origin.machinestring (uuid)Required
origin.namestringRequired
origin.sharesAccessboolean
origin.snapshotstring
origin.templateSincestring (date-time)
ownedByRunboolean
ownerobject
owner.processIdentifierintegerRequired
owner.startedAtstring (date-time)Required
partitionGrowthobject
partitionGrowth.diskSizeintegerRequired

At least 0.

partitionGrowth.failuresintegerRequired
partitionGrowth.problemstring
partitionGrowth.retriesbooleanRequired
presetstring

One of agent-sandbox.

processorobject
processor.clockSpeedintegerRequired

At least 0.

processor.manufacturerstringRequired
processor.midrintegerRequired

At least 0.

processor.namestringRequired
pulledFromobject
pulledFrom.digeststringRequired
pulledFrom.publisherstring
pulledFrom.pulledAtstring (date-time)Required
pulledFrom.referencestringRequired
pulledFrom.signedBystring
recordingstring

One of off, on, video, trajectory.

requirementsobject
requirements.cpuCountintegerRequired
requirements.memorySizeintegerRequired

At least 0.

rosettaboolean
secureBootboolean
securityKeyboolean
sharesarray of objectsRequired
shares[].eventsbooleanRequired
shares[].folderstring (uri)Required
shares[].namestringRequired
shares[].readOnlybooleanRequired
shortcutsstring

One of mac, pc.

snapshotPolicyobjectRequired
snapshotPolicy.beforeRevertingbooleanRequired
snapshotPolicy.includesMemorybooleanRequired
snapshotPolicy.keepintegerRequired
snapshotPolicy.schedulestringRequired

One of never, hourly, daily.

soundobject
sound.microphonebooleanRequired
sound.mutedbooleanRequired
sourceobject
source.buildstring
source.digeststring
source.formatstring

One of qcow2, raw, asif, xz.

source.imagestringRequired
source.installedOnstring
source.linuxLocaleobject
source.locationstring
source.macOSLocaleobject
source.versionstring
source.virtualSizeinteger

At least 0.

source.windowsobject
source.xcodeobject
startsAtLoginboolean
templateSincestring (date-time)
usbDevicesarray of objects
usbDevices[].namestring
usbDevices[].productIDintegerRequired

At least 0.

usbDevices[].serialstring
usbDevices[].vendorIDintegerRequired

At least 0.

watchdogboolean
windowsDriversobject
windowsDrivers.datestring (date-time)Required
windowsDrivers.namestringRequired
windowsDrivers.resultsarray of objectsRequired
windowsDrivers.setstringRequired
windowsDrivers.snapshotstring (uuid)
windowsDrivers.snapshotNamestring
windowsDriversUndonestring
workspaceobject
workspace.bytesintegerRequired

At least 0.

workspace.commitstring
workspace.filesintegerRequired
workspace.folderstringRequired
workspace.guestPathstringRequired
workspace.historyLeftOutstring
workspace.hooksPathstring
workspace.idstring (uuid)Required
workspace.isGitWorkTreebooleanRequired
workspace.lastDiffobject
workspace.leftOutarray of objectsRequired
workspace.objectFormatstringRequired

One of sha1, sha256.

workspace.outstandingstring
workspace.pushedAtstring (date-time)Required
workspace.snapshotsBeforearray of strings (uuid)Required

Fields nested deeper are in the schema.

Exit statuses

Its exit status is one of these.

StatusMeaning
0The command did what it was asked.
1The command failed; with --json, standard error's last line is the error object.
64The command line is wrong, as ArgumentParser found before the command ran.
65What was given is wrong, found while the command ran; the same command fails until it changes.
75The same command can work later with nothing changed, as while an update finishes.
130Control-C cancelled what the command started.

Report a problem with this page