osmates vm set
Change a machine's settings, at once when it runs.
osmates vm set [<options>] <machine>Most settings change at once, also while the machine runs. --cpus, --memory, --processor-name, --network, --rosetta, --3d, --secure-boot, --security-key, --displays, --hdr and --nested-virtualization change only while it's shut down.
--disk grows the disk of a shut-down machine as a job that Control-C cancels. The other options apply once the disk has grown.
A machine from a spec file changes only while it runs. Then only its clipboard, shortcuts, shares, forwards and --keep-awake change, and on the OSMates engine its mute, microphone and camera. A clone made with --preset agent-sandbox takes no clipboard and no share.
Each setting in the app: https://osmates.com/docs/settings
Examples
osmates vm set dev --cpus 8 --memory 16G
osmates vm set dev --share code=$HOME/src --forward 8080:80
osmates vm set dev --clipboard offArguments
<machine>RequiredThe machine's name or identifier.
--clipboard <clipboard>How the clipboard meets the Mac's: off, to-guest, to-mac or both.
to-guest gives the guest the Mac's content on Edit > Paste in the machine's window. to-mac gives the Mac what changes in the guest while its window is in front. Linux shares plain text only.
One of
off,to-guest,to-mac,both.--shortcuts <shortcuts>How Command reaches a Windows or Linux guest: mac or pc.
mac, which new machines have, makes Command-C Ctrl+C, Command-Tab Alt+Tab and Command-Space the Windows or Super key. pc makes Command the Windows or Super key. An agent's keys go as named either way. macOS machines get the Mac's keys as they are.
One of
mac,pc.--share <name=folder>RepeatableA share's name and its folder on the Mac.
Windows shows it on its share drive, such as Z:\name. Linux and macOS show it in /mnt/osmates/name and /Volumes/osmates/name once the guest agent mounts it. A share of the same name is replaced, which is how --read-only goes on or off for one.
--read-onlyThe guest only reads the shares this command gives.
--no-eventsThe Mac's changes to the shares this command gives don't reach the guest's file watchers.
--unshare <name>RepeatableThe name of a share to take away.
--forward <mac-port[:[guest-address:]guest-port][/udp]>RepeatableA port of the Mac's 127.0.0.1 and ::1 to forward to the guest.
Each connection goes through the guest agent to the guest's localhost, or to an address the guest has, as in 9000:[::1]:9000. Other forms: 8080, 8080:80 and 15353:53/udp. A new forward of a forwarded port replaces its target. Mac ports below 1024 are refused, as only root binds them. A Mac program that starts later on the same port loses its localhost clients to the forward. Clones and
osmates runget no forwards.--unforward <mac-port[/udp]>RepeatableA forward to remove, such as 8080 or 15353/udp.
--cpus <cpus>The number of processors.
At most the Mac's processors and the engine's limit, at least the system's minimum.
--memory <memory>The memory, such as 8G or 6144M.
At most what the Mac and the engine allow, at least the system's minimum.
--network <network>nat, shared:<name> or host-only:<name>.
Machines on a shared network reach each other, this Mac and the internet. On a host-only network, they reach each other and this Mac only. A name is one kind, and a name another machine uses with the other kind is refused. The machine keeps its MAC address. When osmatesd restarts, machines on either kind lose their connection for a few seconds and get new addresses.
--address <address>A fixed address on the shared or host-only network --network names, at each start.
The first fixed address on a network sets its subnet, the address's /24, and the others must be in it. Use a private /24 this Mac doesn't reach already, as through Wi-Fi or a VPN. Another machine's address is refused, and so is any new address while other machines run on the network. --network without --address takes the fixed address away. Clones get an address of their own.
--processor-name <name>The processor name a guest on the OSMates engine sees, from its next start.
Windows shows it as the processor's name. The maker, speed and ID stay as they were when the machine was made.
--disk <disk>The disk's new size, such as 96G.
A disk never shrinks, and the same size asks the guest to grow into it again. The guest grows its system volume at its next start, which
osmates vm infoshows. A macOS machine's recovery container moves to the disk's new end first. A snapshot keeps its own size, which a revert to it or a clone of it gives back.--record <off|on|video|trajectory>Record agents' sessions: off, on, video or trajectory.
on keeps each session for 14 days, outside Time Machine: the screenshots the agent got, a screen after each of its steps, the accessibility trees it read, its programs' output and the egress log's lines. video adds an HEVC video of the display while the agent holds the machine, without sound. trajectory adds every input the agent sends, timed on the video, and a tree after each step that changes the screen. It applies at once, to a session already going from its next call. Clones keep it, and the agent-sandbox preset turns it on. Agents can't change it or read recordings through OSMates.
osmates recordingslists, shows and exports them.One of
off,on,video,trajectory.--muteMute the machine on the Mac; --no-mute plays its sound.
Muted, the guest still plays. macOS machines and machines on the OSMates engine have sound. On Apple Virtualization, a Linux machine has it only as debian-13-desktop or omarchy, or a clone of one. On the OSMates engine it applies at once, on Apple Virtualization from the next start. Machines that agents make or clone, and throwaway runs, start muted.
--no-muteMute the machine on the Mac; --no-mute plays its sound.
Muted, the guest still plays. macOS machines and machines on the OSMates engine have sound. On Apple Virtualization, a Linux machine has it only as debian-13-desktop or omarchy, or a clone of one. On the OSMates engine it applies at once, on Apple Virtualization from the next start. Machines that agents make or clone, and throwaway runs, start muted.
--microphoneWhether the guest hears the Mac's microphone. It's off on new machines and clones.
macOS asks once for access to the microphone. On the OSMates engine it applies at once, and the guest hears it only while it records and no agent drives the machine. On Apple Virtualization it applies from the next start, on the Mac's default input. No agent drives the machine while its run hears the microphone, and a run that starts during an agent's session records silence.
--no-microphoneWhether the guest hears the Mac's microphone. It's off on new machines and clones.
macOS asks once for access to the microphone. On the OSMates engine it applies at once, and the guest hears it only while it records and no agent drives the machine. On Apple Virtualization it applies from the next start, on the Mac's default input. No agent drives the machine while its run hears the microphone, and a run that starts during an agent's session records silence.
--cameraA USB camera in a Windows or Linux guest on the OSMates engine that shows the Mac's camera, at once.
It's off on new machines and clones. macOS asks once for access to the camera, and the camera light is on while the guest streams. While an agent drives the machine, the guest sees black. Agents can't change it.
--no-cameraA USB camera in a Windows or Linux guest on the OSMates engine that shows the Mac's camera, at once.
It's off on new machines and clones. macOS asks once for access to the camera, and the camera light is on while the guest streams. While an agent drives the machine, the guest sees black. Agents can't change it.
--camera-device <camera>The Mac's camera by its name, such as "FaceTime HD Camera", or unique ID, or default for the one macOS prefers.
--keep-awakeKeep the Mac from sleeping on its own while the machine starts, runs or stops, on either engine.
Closing a laptop's lid, choosing Sleep and a low battery still sleep the Mac. The machine pauses then and continues when the Mac wakes. The display still turns off. It's off on new machines. Clones and
osmates runkeep it; machines that agents make or clone don't.--no-keep-awakeKeep the Mac from sleeping on its own while the machine starts, runs or stops, on either engine.
Closing a laptop's lid, choosing Sleep and a low battery still sleep the Mac. The machine pauses then and continues when the Mac wakes. The display still turns off. It's off on new machines. Clones and
osmates runkeep it; machines that agents make or clone don't.--start-at-loginStart the machine without a window when you log in to the Mac, or resume it when it was suspended.
After the Mac restarts, it starts once someone logs in. With FileVault on, macOS can't log in by itself, so after a power loss the Mac waits at its login screen. Machines start one at a time, by name. OSMates notifies you of one that doesn't start: one that would leave the Mac under 4 GiB of memory, a third macOS machine, or one that failed to start twice. Clones don't keep it. Temporary machines and machines a program owns can't have it.
--no-start-at-loginStart the machine without a window when you log in to the Mac, or resume it when it was suspended.
After the Mac restarts, it starts once someone logs in. With FileVault on, macOS can't log in by itself, so after a power loss the Mac waits at its login screen. Machines start one at a time, by name. OSMates notifies you of one that doesn't start: one that would leave the Mac under 4 GiB of memory, a third macOS machine, or one that failed to start twice. Clones don't keep it. Temporary machines and machines a program owns can't have it.
--watchdogRestart the machine when its guest agent doesn't answer for 3 minutes, at most 3 times an hour.
The minutes count while the machine runs and the Mac is awake, and not in a run whose guest agent never answered. OSMates shuts the machine down as
osmates vm stopdoes, then starts it again, andosmates vm eventsshows each restart. After 3 restarts within an hour, also across a restart of OSMates, the machine stays stopped and OSMates notifies you. Clones don't keep it. Temporary machines can't have it.--no-watchdogRestart the machine when its guest agent doesn't answer for 3 minutes, at most 3 times an hour.
The minutes count while the machine runs and the Mac is awake, and not in a run whose guest agent never answered. OSMates shuts the machine down as
osmates vm stopdoes, then starts it again, andosmates vm eventsshows each restart. After 3 restarts within an hour, also across a restart of OSMates, the machine stays stopped and OSMates notifies you. Clones don't keep it. Temporary machines can't have it.--rosettaRun x86_64 Linux programs with Rosetta, from the machine's next start.
--no-rosettaRun x86_64 Linux programs with Rosetta, from the machine's next start.
--3dDraw a Linux machine's display with the Mac's GPU, OpenGL ES 3.0, from its next start.
--no-3d goes back to the engine's 2D display. A machine with 3D can't be suspended or keep its memory in a snapshot. debian-13-desktop and omarchy machines have it from their creation.
--no-3dDraw a Linux machine's display with the Mac's GPU, OpenGL ES 3.0, from its next start.
--no-3d goes back to the engine's 2D display. A machine with 3D can't be suspended or keep its memory in a snapshot. debian-13-desktop and omarchy machines have it from their creation.
--secure-bootA Linux machine's Secure Boot with Apple's default keys, from its next start.
The keys are Microsoft's UEFI CAs, which sign the shims of Debian, Ubuntu, Fedora and most distributions. The firmware then starts only a signed boot loader, and most distributions load only signed kernel modules. --no-secure-boot turns it off and keeps the keys. Clones keep it.
--no-secure-bootA Linux machine's Secure Boot with Apple's default keys, from its next start.
The keys are Microsoft's UEFI CAs, which sign the shims of Debian, Ubuntu, Fedora and most distributions. The firmware then starts only a signed boot loader, and most distributions load only signed kernel modules. --no-secure-boot turns it off and keeps the keys. Clones keep it.
--security-keyA FIDO2 security key in a Windows or Linux guest on the OSMates engine, from its next start.
Each time a site uses it, the machine's window asks you, and Touch ID or your Mac's password confirms it. Agents can't. Its passkeys stay in this machine on this Mac. --no-security-key takes it away and erases them. Clones start without one.
--no-security-keyA FIDO2 security key in a Windows or Linux guest on the OSMates engine, from its next start.
Each time a site uses it, the machine's window asks you, and Touch ID or your Mac's password confirms it. Agents can't. Its passkeys stay in this machine on this Mac. --no-security-key takes it away and erases them. Clones start without one.
--displays <count>The displays of a machine on the OSMates engine, 1 to 4, from its next start.
Linux draws each in a window of its own. The Windows display driver draws only the first, and with more than one, that display loses its EDID modes, 120 Hz among them.
--nested-virtualizationLet a Windows or Linux machine run its own hypervisor, such as WSL2, Hyper-V or KVM, from its next start.
It needs a Mac with an M3 chip or later, and it's off on new machines. A snapshot with memory keeps it, and a revert to one puts it back.
--no-nested-virtualizationLet a Windows or Linux machine run its own hypervisor, such as WSL2, Hyper-V or KVM, from its next start.
It needs a Mac with an M3 chip or later, and it's off on new machines. A snapshot with memory keeps it, and a revert to one puts it back.
--hdrAn HDR display from the machine's next start, on the OSMates engine or for a Linux machine with --3d.
Its EDID says HDR10, and a 3D scanout of 16-bit floating point shows in EDR, tone mapped to the Mac's screen. No Windows or Linux display driver draws HDR yet, so the guest stays SDR. It's off on new machines.
--no-hdrAn HDR display from the machine's next start, on the OSMates engine or for a Linux machine with --3d.
Its EDID says HDR10, and a 3D scanout of 16-bit floating point shows in EDR, tone mapped to the Mac's screen. No Windows or Linux display driver draws HDR yet, so the guest stays SDR. It's off on new machines.
--jsonPrint machine-readable JSON.
JSON output
With --json, it prints an object with these fields.
JSON Schema: /schemas/0/cli/vm/set.json
accessobjectaccess.foldersarray of objectsRequiredaccess.isCreatorbooleanRequiredaccess.machinestring (uuid)Requiredaccess.needsConfirmationbooleanRequiredaccess.scopesarray of stringsRequiredEach item is one of
observe,input,exec_user,exec_admin,guest_files,host_transfer,snapshots,lifecycle,network,usb.access.untilstring (date-time)activityobjectactivity.elapsedintegerRequiredactivity.guestBusynumberRequiredactivity.guestCPUsintegerRequiredactivity.macCPUnumberRequiredactivity.wattsnumberagentobjectagent.displayobjectagent.guestobjectagent.identityobjectagent.layoutOnThisMacbooleanagent.localeobjectagent.problemstringagent.readinessobjectagent.sessionobjectagent.truststring or objectOne of
trusted,awaitingApproval,removed, or an object that holds one key:unavailable.agent.updateobjectHolds one key:
updatingorfailed.agentNeverAnsweredbooleanRequiredbasicDisplaystringOne of
startedWithoutGPU,fellBack.bundlestringcameraobjectcamera.accessstringOne of
undetermined,granted,denied.camera.devicestringcamera.framesintegerRequiredAt least 0.
camera.settingsobjectRequiredcamera.statestringRequiredOne of
off,idle,asking,denied,live,heldForAgent,unavailable.camera.streamobjectclipboardobjectclipboard.channelstring or objectRequiredOne of
off,connecting,waitingForSignIn, or an object that holds one key:ready,locked,unavailable,copyingorfailed.clipboard.lastCarryobjectclipboard.sharingstringRequiredOne of
off,to-guest,to-mac,both.compactionstringconfigurationobjectconfiguration.acceleratedGraphicsbooleanconfiguration.accountobjectRequiredconfiguration.cameraobjectconfiguration.clipboardstringRequiredOne of
off,to-guest,to-mac,both.configuration.cpuCountintegerRequiredconfiguration.createdAtstring (date-time)Requiredconfiguration.creatorstringconfiguration.credentialsarray of objectsconfiguration.dataDisksarray of objectsconfiguration.discstring (uri)configuration.diskBusstringOne of
nvme.configuration.diskSizeintegerRequiredAt least 0.
configuration.displayobjectconfiguration.displayCountintegerconfiguration.egressobjectconfiguration.enginestringRequiredOne of
virtualization,hypervisor.configuration.firmwareobjectconfiguration.firstAgentAnswerstring (date-time)configuration.forwardsarray of objectsconfiguration.highDynamicRangebooleanconfiguration.idstring (uuid)Requiredconfiguration.importedobjectconfiguration.isEphemeralbooleanRequiredconfiguration.keepsMacAwakebooleanconfiguration.lastBuildobjectconfiguration.macOSobjectconfiguration.memorySizeintegerRequiredAt least 0.
configuration.namestringRequiredconfiguration.nestedVirtualizationbooleanconfiguration.networkobjectHolds one key:
natorvmnet.configuration.operatingSystemstringRequiredOne of
linux,macOS,windows,freeBSD.configuration.originobjectconfiguration.ownedByRunbooleanconfiguration.ownerobjectconfiguration.partitionGrowthobjectconfiguration.presetstringOne of
agent-sandbox.configuration.processorobjectconfiguration.pulledFromobjectconfiguration.recordingstringOne of
off,on,video,trajectory.configuration.requirementsobjectconfiguration.rosettabooleanconfiguration.secureBootbooleanconfiguration.securityKeybooleanconfiguration.sharesarray of objectsRequiredconfiguration.shortcutsstringOne of
mac,pc.configuration.snapshotPolicyobjectRequiredconfiguration.soundobjectconfiguration.sourceobjectconfiguration.startsAtLoginbooleanconfiguration.templateSincestring (date-time)configuration.usbDevicesarray of objectsconfiguration.watchdogbooleanconfiguration.windowsDriversobjectconfiguration.windowsDriversUndonestringconfiguration.workspaceobjectcontrolobjectcontrol.acquiredAtstring (date-time)Requiredcontrol.holderobjectRequiredcontrol.lengthintegerRequiredcontrol.machinestring (uuid)Requiredcontrol.pausedSincestring (date-time)control.renewedAtstring (date-time)Requiredcredentialsarray of objectscredentials[].changedAtstring (date-time)Requiredcredentials[].createdAtstring (date-time)Requiredcredentials[].grantsarray of objectsRequiredcredentials[].idstring (uuid)Requiredcredentials[].namestringRequiredcredentials[].usesarray of objectsRequiredcredentials[].variablestringdataDisksarray of objectsdataDisks[].allocatedintegerRequiredAt least 0.
dataDisks[].fromstringRequireddataDisks[].numberintegerRequireddataDisks[].sizeintegerRequiredAt least 0.
discDrivesarray of objectsdiscDrives[].discstring (uri)discDrives[].isRequiredbooleandiskobjectdisk.allocatedintegerRequiredAt least 0.
disk.layoutobjectdisk.sizeintegerRequiredAt least 0.
disk.volumeAvailableintegerAt least 0.
diskGrowthstringdisplayobjectdisplay.framestringRequireddisplay.heightintegerRequireddisplay.isResizingbooleanRequireddisplay.pointerobjectdisplay.sourcestringOne of
firmware,gpu.display.undrawnstringdisplay.widthintegerRequiredegressobjectegress.allowedintegerRequiredegress.appliedstringOne of
live,detached,detachedUntilRestart,atNextStart.egress.lastRefusalobjectegress.pathstringOne of
direct,filtered.egress.pathFollowsPolicybooleanRequiredegress.policyobjectRequiredegress.refusedintegerRequiredegress.restartNeededbooleanRequiredegress.runstringOne of
direct,filtered,detached.egress.sharedNetworkstringengineobjectengine.enginestringRequiredOne of
virtualization,hypervisor.engine.hasarray of stringsRequiredEach item is one of
battery,fiveMouseButtons,sound,memorySnapshots,rosetta,secureBoot,acceleratedGraphics,camera,securityKey,nestedVirtualization.engine.lacksarray of stringsRequiredEach item is one of
battery,fiveMouseButtons,sound,memorySnapshots,rosetta,secureBoot,acceleratedGraphics,camera,securityKey,nestedVirtualization.firmwareOfferedstringfirmwareUpdatestringfixedAddressstring (ipv4)forwardsarray of objectsforwards[].connectionsintegerRequiredforwards[].droppedintegerRequiredforwards[].forwardobjectRequiredforwards[].statestring or objectRequiredOne of
listening,stopped, or an object that holds one key:unavailable.guestDrawsNoHighDynamicRangebooleanguestDrawsOneDisplaybooleanguestRequestsbooleanmemoryobjectmemory.budgetobjectRequiredmemory.footprintintegerRequiredAt least 0.
memory.isOverBudgetbooleanRequiredmemory.peakintegerRequiredAt least 0.
movestringrepositorySharesarray of stringsrosettaobjectrosetta.availabilitystringRequiredOne of
installed,notInstalled,notSupported.rosetta.guestobjectHolds one key:
registeredorfailed.rosetta.inThisRunbooleanrosetta.onbooleanRequiredrosetta.savedbooleansharesarray of objectsshares[].eventsOffstringshares[].guestPathstringshares[].problemstringshares[].shareobjectRequiredshares[].unmountedstringsnapshotsarray of objectsRequiredsnapshots[].createdAtstring (date-time)Requiredsnapshots[].discstring (uri)snapshots[].discControllerbooleansnapshots[].firmwareobjectsnapshots[].frameworkSoundobjectsnapshots[].guestToolsbooleansnapshots[].hardwareobjectRequiredsnapshots[].hostBuildstringsnapshots[].idstring (uuid)Requiredsnapshots[].includesMemorybooleanRequiredsnapshots[].isCrashConsistentbooleanRequiredsnapshots[].isKeptbooleanRequiredsnapshots[].namestringRequiredsnapshots[].networkPathstringOne of
direct,detached,filtered.snapshots[].originstring or objectRequiredOne of
manual, or an object that holds one key:agentSession,agent,beforeRevert,schedule,beforeUpdate,beforeDrivers,guest,beforeGuestRevert,codeSession,beforeMacOSUpdateorbeforeFirmwareUpdate.snapshots[].partitionGrowthobjectsnapshots[].rosettabooleansnapshots[].windowsDriversobjectsnapshots[].withoutNetworkbooleanRequiredsoundobjectsound.accessstringOne of
undetermined,granted,denied.sound.inputobjectsound.microphonestringRequiredOne of
off,idle,asking,denied,live,heldForAgent,unavailable,connected,untilStop,nextStart.sound.missedServicesintegerRequiredsound.outputobjectsound.settingsobjectRequiredsound.thisRunobjectspaceobjectspace.bundleobjectRequiredspace.snapshotsarray of objectsRequiredstatusobjectRequiredstatus.canSuspendbooleanRequiredstatus.controlobjectstatus.detailstringstatus.displayobjectstatus.failureobjectstatus.idstring (uuid)Requiredstatus.namestringRequiredstatus.pauseReasonstring or objectOne of
person,hostAsleep, or an object that holds one key:volumeFull,volumeLowortpmStateUnsaved.status.shutdownWaitobjectstatus.startWaitobjectstatus.statestringRequiredOne of
starting,running,paused,stopping,stopped,failed,suspended,offline.status.suspensionobjectstatus.updatedAtstring (date-time)Requiredstatus.workerBuildstringstatus.workerProcessIdentifierintegervolumestring
Fields nested deeper are in the schema.
Exit statuses
Its exit status is one of these.
| Status | Meaning |
|---|---|
| 0 | The command did what it was asked. |
| 1 | The command failed; with --json, standard error's last line is the error object. |
| 64 | The command line is wrong, as ArgumentParser found before the command ran. |
| 65 | What was given is wrong, found while the command ran; the same command fails until it changes. |
| 75 | The same command can work later with nothing changed, as while an update finishes. |
| 130 | Control-C cancelled what the command started. |