- added
--pid-file <path>argument which writes the process id (pid) of themacosvmprocess into the specified file path before starting the VM and removes it on exit, making it easier to track running VMs if desired.
- added
--scriptargument which allows to specify a script that should be called then the VM is successfully launched. Additional two arguments are added to the provided script string: thepidof themacosvmprocess and the MAC address of the first interface (if is exists). The script is executed via/bin/bash -cso the actual call for--script <script>will be similar to/bin/bash -c '<script> <pid> <mac>'and thus respectsPATHetc.
-
Linux guest would fail with "Number of pointing devices is greater than the maximum number supported" since VZ framework allows the choice of trackpad and USB only for macOS guests (#21, regression from 0.1-4).
-
Add
--recoveryoption to start macOS VM in recovery mode on macOS 13 host and up (#22, thanks to Jim Lake).
- command line parameters are now parsed after the specified configuration file is loaded and will cause the settings to be added to the configuration. This allows the use of pre-specified configurations which can be supplemented by command line arguments. This behavior is more intuitive, but different from 0.1 versions which is why we chose to increase the version.
- added
--save <path>which will write the resulting configuration after all arguments were parsed into a JSON file specified by<path>. Note that--restorealready creates the configuration file without this option, so--saveshould only be used when it is desired to update an existing configuration augmented with command line options to create a new configuration file. - optional capabilities that depend on the host environment are listed as
Capabilities:in the output of--version
--net unix:<socket>[,mac=<mac>][,mtu=<mtu>]creates a network interface which routes network traffic to a unix socket<socket>on the host. The default (and minimum) MTU is 1500, but it can be increased (only on macOS 13 and higher). A temporary socket is created in the temporary directory by default, but the directory can be overridden by theTMPSOCKDIRenvironment variable. (#20, thanks to Alexander Graf!)- ephemeral files are now also removed on
SIGABRTwhich can happen if the Virtualization framework raises an execption - added support for
usbdisk type (macOS 13 and above only) - added support for Mac trackpad if both the guest and host are macOS 13
- added
--spicewhich will enable clipboard shaing between the host and guest using the SPICE protocol (experimental). Requires macOS 13 host andspice-vdagentin the guest. Due to an issue in the Apple VZ framework this currently only works with Linux guests (macOS guests crash).
-
MAC address of each network interface created will be shown at startup, e.g.:
+ network: ether 9a:74:8c:65:6d:e0to make it easier to associate IP addresses to VMs via
arp -a. -
--net nat:<MAC>defines a NAT network interface with a given pre-defined MAC address. Similarly, the interfaces in the"networks"configuration section can have"mac"keys that define the MAC address. -
additonal option
--mac <MAC>on the command line will override the MAC address of the first interface, regardless how it was defined (configuration file or command line). This is useful when creating multiple VMs from the same configuration file, typically with--ephemeral. -
added support for VirtIOFS shared directories via
--voloption. The syntax is--vol <path>[,ro][,{name=<name>|automount}]where<path>is the path on the host OS to share and<name>is the name (also known as "tag") of the share. On macOS 13 (Ventura) and higherautomountoption can be specified in which case the share is automatically mounted in/Volumes/My Shared Files. If not specifed, the share has to be mounted by name withmount_virtiofs <name> <mountpoint>in the guest OS. -
guest serial console is now also enabled in macOS guests (in
/dev/cu.virtioand/dev/tty.virtio). Previous versions enabled it only for Linux guests. It can be explicitly disabled using--no-serialoption. -
experimental
--ptyoption allows the creation of pseudo-tty device for the guest serial console. Without this option the serial console is mapped to the stdin/out streams of themacosvmprocess. If the--ptyoption is specified thenmacosvmwill create a newpty(typically in/dev/ptys.<n>) and map VM's serial port to it.Unfortuantely, Apple Virtialization Framework requires that the pty is connected before the VM is started. Therefore currently
macosvmwill print theptypath and wait for user input so that the user can connect to the newly created pty before starting the VM. Proceeding without connected pty leads to an error. This behavior may change in the future, which is why it is considered experimental.
-
added
--ephemeralflag: when specified, all (read-write) disks (including auxiliary) will be cloned (seeman clonefile) prior to starting the VM (by appending-clone-<pid>to their paths) and the clones are used instead of the original. Upon termination all clones are deleted. This is functionally similar to the--rmflag in Docker. IMPORTANT: you will lose any changes to the mounted disks made by the VM. This is intended for runners that pick up work, do something and then post the results somewhere, but don't keep them locally.macosvmattempts to clean up clones even on abnormal termination where possible. Individual disks can specifykeepoption which prevents them from being cloned in the ephemeral mode, e.g.:--disk results.img,keepwill causeresults.imgto be used directly and modified by the VM even if--ephemeralis specified. -
added heuristic to detect ECID from the auxiliary storage if it is not supplied by the configuration file
-
make the configuration file optional. It is now possible to start VMs simply by specifying the desired CPU/RAM and disk images and
macosvmwill try to infer all necessary settings automatically. I.e., if you have existing disk imagesaux.imganddisk.imgfrom previously restored/created VM, you can use the following to start it:macosvm -g --disk disk.img --aux aux.img -c 2 -r 4g -
fixed a bug where the
"readOnly"flag specified in the configuration file was not honored -
added
osandbootInfoentries in the configuration. Currently valid entries forosare"macos"(default) and"linux". The latter usesbootInfodictionary with entrieskernel(path, mandatory) andparameters(string, optional). Also a new storage type"initrd"has been added to support the Linux boot process (untested).
- initial version