Create macOS or Linux virtual machines Running macOS or Linux virtual machines on Apple Silicon * Overview of virtualization technologies - Using the Virtualization framework to build virtual machines * Setting up a macOS VM * Setting up a Linux VM Layers for virtualization: Virtualization framework ⬆ Hypervisor framework ⬆ macOS kernel ⬆ Hardware Hypervisor framework is a low-level API which enables virtualization of CPUs and memory, but because it is a low-level API all of the implementation must be written for it. To support this, there is the higher-level API of the Virtualization framework. The Virtualization framework enables the creation of virtual machines: VM support: macOS - Supported on Apple Silicon Linux - Supported on Intel - Supported on Apple Silicon Creation of virtual machines Two kinds of objects used by Virtualization framework as part of VM creation: * Configuration objects - define all the properties of the virtual machines * Virtual machine objects - abstract virtual machines and how to interact with them Configuration defines the hardware that the virtual machine is running on. - How much memory - How many CPUs - What devices are attached (keyboard, mouse, etc.) Details on the configuration process run from 3:00 through 3:55 of the session video. Virtual machine objects Details on building virtual machine objects run from 4:10 through 5:00 of the session video. macOS virtual machines macOS - Supported on Apple Silicon * Configuration * Installing macOS * Using your virtual Mac * Sharing files between the host Mac and the virtual Mac Three properties which are unique to virtual Mac hardware: * Hardware model - specifies the hardware that the virtual Mac is running on * Auxiliary storage - non-volatile memory used by the system * Machine identifier - unique number which identifies the virtual machine Additional necessary component: macOS boot loader Details on building macOS virtual machines run from 7:45 through 5:00 of the session video. Installing macOS in a virtual machine: * Download a restore image with the version of macOS we want to install * Create a compatible configuration * Install the restore image into the virtual machine The Virtualization framework can provide download information for the restore image. Once downloaded, the restore image can provide the following information for the virtual machine: * Hardware model requirements * Minimum CPU requirements * Minimum memory requirements Special devices for macOS virtual machines: * GPU acceleration * Virtual trackpad - enables use of gestures and pinch to zoom (macOS 13 required on both host and virtual machine.) Sharing files between host Mac and virtual machines Shared directory support available between host Mac and the following virtual machine types: * macOS virtual machines * Linux virtual machines Linux virtual machines Linux VMs will use a .iso file to install, instead of a macOS restore image. Linux .iso files will be flashed onto a virtual USB drive attached to the virtual machine. The EFI boot loader in the virtual machine will be used to search for the virtual USB drive with the desired Linux OS installer. Linux VM graphics - added support for Virtio GPU 2D - Linux renders what is displayed then hands it off to the Virtualization framework to render for the host Mac's screen. Rosetta 2 Linux VMs can take advantage of Rosetta 2 to translate Linux X86 64 binaries to run on Apple Silicon using Rosetta for translation, like is possible on macOS