Contents

VZVirtualMachineConfiguration

The environment attributes and list of devices to use during the configuration of macOS or Linux VMs.

Declaration

class VZVirtualMachineConfiguration

Mentioned in

Overview

Use a VZVirtualMachineConfiguration object to configure the environment for a macOS or Linux VM. This configuration object contains information about the VM environment, including the devices that the VM exposes to the guest operating system. For example, use the configuration object to specify the network interfaces and storage devices that the operating system may access. For more information on the devices that macOS and Linux guests can support, see the Devices section on the Virtualization framework page.

You create and configure VZVirtualMachineConfiguration objects directly. After validating the configuration object, use it to initialize the VZVirtualMachine object that manages the virtual environment. The smallest valid configuration includes a value for the bootLoader property; you can also include more devices in the configuration depending on the needs of your app, such as graphics devices, shared directories, and so on. When you finish configuring the object, call the validate() method to determine whether a VM can successfully support your configuration. A configuration object is invalid if your app doesn’t have the com.apple.security.virtualization entitlement.

For more information on using VZVirtualMachineConfiguration, see Installing macOS on a Virtual Machine and Creating and Running a Linux Virtual Machine.

Topics

Configuring the guest system

Setting the number of CPUs

Sizing the memory partition

Adding devices to the VM

Validating the configuration

See Also

Configurations