macOS and Linux VMs on Apple Silicon to use in CI and other automations
Go to file
Fedor Korotkov 3a6c5fb81d
feat: Add disk image format selection with ASIF support (#1094)
* feat: Add disk image format selection with ASIF support

* fixed goreleaser-pro

* Fix ASIF disk format compatibility issues

- Use .uncached caching mode for ASIF disks to avoid Virtualization framework compatibility issues
- Improve caching mode selection logic for better maintainability
- Fix compiler warning by changing var to let for attachment variable

This resolves VM startup failures when using ASIF disk format by ensuring proper disk attachment configuration.

* Update goreleaser installation to use tap-specific formula

Change from 'brew install --cask goreleaser-pro' to 'brew install --cask goreleaser/tap/goreleaser-pro' for proper installation from the official goreleaser tap.

* Remove VS Code configuration and add to gitignore

- Remove .vscode/launch.json from repository
- Add .vscode/ to .gitignore to prevent VS Code settings from being tracked

* Implement ASIF disk resize using diskutil

- Add support for resizing ASIF disk images using diskutil image resize
- Detect disk format from VM config and route to appropriate resize method
- Use diskutil image info to get current ASIF disk size and validate resize
- Remove restriction that prevented ASIF disk resizing in Set command
- Add FailedToResizeDisk error case for proper error handling
- Maintain backward compatibility with raw disk resizing
- Add comprehensive size validation to prevent data loss

* Update Sources/tart/Commands/Create.swift

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>

* Update Sources/tart/DiskImageFormat.swift

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>

* Update Sources/tart/DiskImageFormat.swift

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>

* Fix test naming and remove redundant test cases

- Rename testFormatArgument to testCaseInsensitivity for clarity
- Remove redundant 'raw' and 'invalid' test cases already covered in testFormatFromString
- Remove testFormatDescriptions test as it's not very useful

Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152093510

* Remove canCreate property and simplify DiskImageFormat

- Remove canCreate property since it's the same as isSupported
- Remove description property entirely as it's not used
- Fix displayName for RAW format (remove UDIF reference)
- Remove checkDiskutilASIFSupport helper function

Addresses review comments:
- https://github.com/cirruslabs/tart/pull/1094#discussion_r2152109450
- https://github.com/cirruslabs/tart/pull/1094#discussion_r2152115610
- https://github.com/cirruslabs/tart/pull/1094#discussion_r2152124330

* Update Create command validation and help text

- Simplify ArgumentParser help text to let it show possible values automatically
- Remove canCreate validation since property was removed
- Simplify error message for unsupported disk formats

Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152113480

* Add disk format validation to Run command

- Add validation to ensure ASIF disk format is supported on current system
- Check disk format compatibility before attempting to run VM

Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152109450

* Use proper namespaced constant for OCI label

- Add diskFormatLabelAnnotation constant in Manifest.swift
- Use org.cirruslabs.tart.disk.format namespace for consistency
- Use variable shadowing instead of new variable name for labels

Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152163515

* Remove special ASIF caching mode

- Remove .uncached caching mode for ASIF disks
- Use default caching logic for all disk formats
- Testing shows .cached mode works fine on macOS 26.0

Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152133589

* Improve code structure in VMDirectory

- Use guard let instead of nested if let for better readability
- Reduce nesting in resizeASIFDisk function
- Improve error handling flow

Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152141916

* diskFormatLabel

* reverted caching mode

* Use PropertyListDecoder

---------

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
2025-06-19 18:27:30 +04:00
.ci Fixed plist file in version update (#927) 2024-10-29 13:01:47 +04:00
.github Added Code Owners (#328) 2022-11-17 22:57:12 -05:00
Resources Add `NSLocalNetworkUsageDescription` (#1058) 2025-04-18 18:27:32 +04:00
Sources/tart feat: Add disk image format selection with ASIF support (#1094) 2025-06-19 18:27:30 +04:00
Tests/TartTests feat: Add disk image format selection with ASIF support (#1094) 2025-06-19 18:27:30 +04:00
benchmark Bump golang.org/x/crypto from 0.21.0 to 0.35.0 in /benchmark (#1057) 2025-04-18 18:01:55 +04:00
docs docs: new "Bridging the gaps with the Tart Guest Agent" blog post (#1080) 2025-06-01 19:54:45 -04:00
integration-tests integration-tests: downgrade "requests" package to 2.31.0 (#829) 2024-05-21 13:35:33 +00:00
scripts Update docs, examples and CI to Sequoia 2025-05-04 20:49:23 -04:00
.cirrus.yml tart ip: implement --resolver=agent (#1095) 2025-06-19 13:07:06 +04:00
.editorconfig Update dependencies and styles (#12) 2022-03-24 18:54:49 +03:00
.gitignore feat: Add disk image format selection with ASIF support (#1094) 2025-06-19 18:27:30 +04:00
.goreleaser.yml Fix #1004: Wrong binary path in distro (#1005) 2025-01-18 13:32:54 +04:00
.swiftformat Reformat code idents and introduce the SwiftFormat linter (#339) 2022-11-29 15:56:13 +00:00
CONTRIBUTING.md Add CONTRIBUTING.md? (#575) 2023-08-03 13:10:34 -04:00
LICENSE Relicensed under Fair Source License (#415) 2023-02-28 12:22:25 -05:00
PROFILING.md PROFILING.md: document how to profile Tart using time(1) and xctrace(1) (#926) 2024-10-28 18:49:10 +04:00
Package.resolved tart ip: implement --resolver=agent (#1095) 2025-06-19 13:07:06 +04:00
Package.swift tart ip: implement --resolver=agent (#1095) 2025-06-19 13:07:06 +04:00
README.md Update docs, examples and CI to Sequoia 2025-05-04 20:49:23 -04:00
gon.hcl Fix #1004: Wrong binary path in distro (#1005) 2025-01-18 13:32:54 +04:00
mkdocs.yml Improve Orchard docs (#1064) 2025-04-29 18:10:14 +04:00

README.md

Tart is a virtualization toolset to build, run and manage macOS and Linux virtual machines (VMs) on Apple Silicon. Built by CI engineers for your automation needs. Here are some highlights of Tart:

  • Tart uses Apple's own Virtualization.Framework for near-native performance.
  • Push/Pull virtual machines from any OCI-compatible container registry.
  • Use Tart Packer Plugin to automate VM creation.
  • Easily integrates with any CI system.

Tart powers Cirrus Runners service — a drop-in replacement for the standard GitHub-hosted runners, offering 2-3 times better performance for a fraction of the price.

Many companies are using Tart in their internal setups. Here are just a few of them:

Note: If your company or project is using Tart please consider sharing with the community.

Usage

Try running a Tart VM on your Apple Silicon device running macOS 13.0 (Ventura) or later (will download a 25 GB image):

brew install cirruslabs/cli/tart
tart clone ghcr.io/cirruslabs/macos-sequoia-base:latest sequoia-base
tart run sequoia-base

Please check the official documentation for more information and/or feel free to use discussions for remaining questions.