Understanding Tart Virtualization: A Developer-Friendly Virtualization Tool for macOS

Understanding Tart Virtualization: A Developer-Friendly Virtualization Tool for macOS

Tart is a virtualization tool designed specifically for Apple Silicon (M1/M2) devices. It enables developers to create, manage, and run lightweight virtual machines (VMs) directly on their macOS machines. In hypervisors like VirtualBox or VMware which brings their own kernel extensions over the host operating system. Bringing their own programming and these were necessary to provide a isolate environment and providing low-level memory and disk utilisation.

Tart is built on Apple’s own Virtualization.framework, making it deeply integrated with macOS and optimized for performance and simplicity. Think of macOS itself became Hypervisor and giving capabilities to run and manage virtual machines using Hypervisor.framework and Virtualisation.framework.

Tart was developed by CirrusLabs, and it has become particularly popular among iOS developers and continuous integration (CI) engineers. This is because it offers a streamlined way to spin up macOS VMs for building and testing applications without the overhead of a full-blown hypervisor. Tart VMs are disposable by design, encouraging clean and reproducible development environments.

At its core, Tart works by using disk images (usually .img files) to simulate virtual hard drives. These images can be prebuilt or created from scratch. When running a VM using Tart, users can specify CPU count, memory allocation, network options, and disk attachments through simple command-line flags. This makes the tool highly scriptable and easy to integrate into automation workflows.

tart create --linux rhel9        

This sets up a blank and clean bootable environment, using Apple's Virtualisation backend. But this is an empty OS, it needs an ISO to run, therefore we can add a disk with iso image.

tart run --disk ~/Downloads/rhel-9.5-aarch64-boot.iso rhel9        

The command will boot the VM with the ISO image run by the RHEL9 installer. This is equivalent to booting a real physical server from a RHEL DVD. Once the boot is complete, you no longer need iso image.

Creating disk image, either raw or formatted with filesystem is possible to add and needs simple commands to execute and run. Use hdiutil command in macOS to create raw image or file formated image.

hdiutil create -size 10G -fs HFS+ myDiskImage.dmg        

Or if you want to use the raw image inside the virtual machine, use dd command for that.

dd if=/dev/zero of=myDiskImage.img bs=1M count=1024        

Here, /dev/zero is a zero filled raw binary, there it keeps the file filling up until the count doesn't reached around 1GiB.

You can now attach mydisk.img to your Tart VM using the --disk option.

tart run --disk myDiskImage.img rhel9        

One of Tart’s defining characteristics is its minimalism. There is no graphical user interface or heavy configuration layers. You interact with it through the terminal, which makes it ideal for developers who want control and transparency. You can launch a VM with just one command and attach additional virtual disks or forward network ports with straightforward options. This simplicity does not come at the cost of performance—because Tart is backed by Apple’s virtualization technology, it runs VMs efficiently and with native-level speed.

Tart is best suited for use cases like iOS build environments, ephemeral CI runners, or isolated dev/test environments. It is not designed for full-scale infrastructure virtualization like you’d see with tools such as KVM, VMware ESXi, or cloud providers like AWS. It also doesn’t offer orchestration, high availability, or automatic resource scheduling. Instead, it focuses on providing a fast and reliable sandbox for single-machine use or self-managed CI setups.

One of the unique advantages Tart brings is the ability to build VM images using Packer through the packer-plugin-tart. This allows developers to script the process of setting up a VM with all necessary tools and dependencies baked in. Once the image is built, it can be run repeatedly with identical results, ensuring consistency between builds.

In short, Tart is like a developer’s sandbox: quick to set up, efficient to run, and easy to dispose of. It brings the power of virtualization to everyday development tasks without demanding heavy infrastructure or complex setup. For anyone building or testing on macOS, Tart offers a practical and elegant approach to virtualization.

To view or add a comment, sign in

More articles by Utkarsh Pratap Singh

Others also viewed

Explore content categories