Information
To reach a broader audience, this article has been translated from Japanese.
You can find the original version here.
When I was using an Intel-based MacBook, I regularly used virtualization software such as VirtualBox and VMware Fusion. Initially, when I switched to a MacBook with an M1 chip, these software options were not compatible, and I ended up not using them anymore. Recently, I discovered Tart, a virtualization tool that makes it easy to set up virtual machines on Apple Silicon Macs, so I'd like to introduce it.
Tart is a virtualization toolset exclusively for Apple Silicon Macs. It is implemented on Apple Silicon's native Virtualization Framework, allowing macOS and Linux to run efficiently.
Tart is using Apple’s native Virtualization.Framework that was developed along with architecting the first M1 chip. This seamless integration between hardware and software ensures smooth performance without any drawbacks.
You can find the Tart GitHub repository here:
GitHub - cirruslabs/tart: macOS and Linux VMs on Apple Silicon to use in CI and other automations
Tart's VM images can be managed in an OCI-compatible registry, and the official images are published in GitHub's Package Registry.
https://github.com/orgs/cirruslabs/packages
Additionally, Cirrus Runners, a CI runner using Tart, is also available.
Information
Tart is free for use on personal machines. Organizations exceeding a certain number of server installations need to obtain a paid license.
Usage on personal computers including personal workstations is royalty-free, but organizations that exceed a certain number of server installations (100 CPU cores for Tart and/or 4 hosts for Orchard) will be required to obtain a paid license.
You can get a general idea of how to use it by looking at the Quick Start.
Install it with Homebrew.
You can fetch, launch, and configure machine images with the tart CLI.
Let's fetch an image of macOS Sonoma with Xcode installed. Specify the registry's image and a local name (in the following example, sonoma-xcode).
The download will start. It's 54GB, so it will take quite some time. It finishes like this:
98% pulling NVRAM...Launch the VM.
It starts up quite fast.
Xcode also launched properly. My host machine is running macOS Ventura, but I can use the latest Xcode in a macOS Sonoma VM (though I only use Xcode Command Line Tools).
The default memory is 8GB, which is a bit small, so let's expand it.
First, stop the VM from the Control menu.
Use the Tart CLI to specify the VM and set the memory size in MB.
Relaunch the VM with tart run, and the memory has successfully increased.
Fetch an Ubuntu VM image.
It's just under 1GB, so it finishes quickly.
It's a good idea to expand the default disk size of 20GB before launching.
Launch it.
It launches, but the GUI is not set up, leading to a console login screen.
The default user/password is admin/admin.
To use the desktop environment, I installed the module.
sudo apt update sudo apt install ubuntu-desktopAfter restarting the VM, the GUI login screen appeared.
Logging in, I could successfully use the desktop environment.
After spending a few hours setting up the environment and building applications, it was a smooth and comfortable VM environment.
With the Tart CLI, you can create VM images from macOS IPSW files (firmware format files like those for iOS) or Linux ISO images.
Example of creating a macOS image.
Information
When executing the above command, it seems to download the IPSW file from ipsw.me to create the image.
Example of creating a Linux image.
Since it's possible to push to an OCI registry, you can push images to ECR or similar and pull them when needed.
There's also a plugin for Packer, allowing you to create and manage Tart images with Packer.
For macOS, Cirrus Runners use Tart, and for Linux, they use vetu, a virtualization technology, to provide CI runners. They can be used from GitHub Actions or GitLab CI.
For GitHub Actions, simply set up the Cirrus Runners app for your organization, and then specify Cirrus Runners in your workflow file.
For macOS, it seems to be much cheaper than the runners hosted by GitHub.
The experience of using VMs with Tart was satisfactory.
Although I have no plans to use macOS VMs for now, being able to quickly set up a VM for testing or when you don't want to significantly alter the configuration of your host machine is reassuring.
The VMs introduced in the previous article "OrbStack - A Fast and Lightweight Container & Linux VM Environment Exclusively for macOS" only supported shell environments. With Tart, desktop environments are also available, which seems useful for testing Linux desktop applications.
For Windows... let's use a physical machine.
For native app development on macOS and iOS, Cirrus Runners seems like a good solution for building CI/CD pipelines.