When I bought a new MacBook and prepared my development environment, cross-platform compilation and testing led me to investigate virtual machines. My initial question was practical: if I need Linux, Windows and macOS on architectures such as x86-64 and ARM64, can one VM application put every combination on my computer?
The more I read, the longer the list: QEMU, KVM, libvirt, Xen, VirtualBox, UTM, Firecracker, Hyper-V and Apple's Hypervisor.framework and Virtualization.framework. They often appear together. Some are alternatives, some work together, and some with apparently similar names actually occupy different layers.
My choice was: for full guest systems on a Mac, use UTM as the local entry point. Prefer hardware virtualization for same-architecture guests and reserve cross-architecture full-system emulation for necessary compatibility checks. For routine cross-platform builds, consider cross-compilation, containers and remote native builds first.
Consistency depends on requirements too. For fixed project toolchains and dependencies, prefer containers and Dev Containers. To create and repeatedly rebuild full VMs, first consider Vagrant with a suitable provider and box. Use Ansible as needed to configure and maintain software on existing systems.
This standalone extension of my Mac development environment notes describes the tools' relationships and the rationale for my choices. The unboxing and initial investigation are archived under August 22, 2025. Concepts and sources were expanded in November 2026. Historical milestones below retain their respective dates.
Distinguish the compilation target from the execution environment
“Cross-platform” covers at least three tasks:
- Generate a target program, such as an x86-64 Linux executable on ARM64 macOS.
- Run the target program to confirm it works with the corresponding OS, runtime libraries and CPU environment.
- Run the entire target system, including the guest kernel, drivers, system services and desktop.
A full VM suits the third. A cross-compiler often handles the first. For the second, choose a native machine, VM, container or application-level translation according to the test.
A compilation target means more than CPU architecture. Even on x86-64, Linux, Windows and macOS differ in executable format, system interfaces and ABI. Linux itself can involve runtimes such as glibc or musl. Besides generating target instructions, a cross-compiler needs the corresponding headers, libraries, linker or SDK. Clang cross-compilation documentation
So “supports ARM and x86” doesn't imply every OS and architecture combination will run. Confirm a particular target, such as ARM64 Linux or x86-64 Windows, including system version and dependencies. I later covered this in why compilation targets distinguish both CPU architecture and operating system.
Divide the virtualization stack by responsibility
Hypervisor is a general term for the virtualization monitor, not specifically Apple's Hypervisor.framework. Distinguish low-level execution, virtual devices and management interfaces when discussing products.
| Responsibility | Question answered | Typical components |
|---|---|---|
| CPU and memory hardware virtualization | How to isolate guests while executing guest code on a real CPU | KVM, Xen, Hyper-V Hypervisor, Apple's underlying virtualization implementation |
| Full machine and device models | What machine, disks, network cards, firmware and other devices the guest sees | QEMU, Firecracker's minimal model, corresponding VirtualBox components, Apple VZ device configuration |
| Software CPU emulation | How to execute an instruction set the host CPU does not directly support | QEMU TCG, Bochs |
| Virtualization resource management | How to create, configure, start and stop VMs consistently and manage networking and storage | libvirt |
| Infrastructure and development environment automation | How to declare resources, rebuild project environments or maintain software and services in systems | Terraform, Vagrant and Ansible, each with a different emphasis |
| Complete user-facing products | How to combine engine, configuration, display and controls | UTM, VirtualBox |
Responsibilities overlap, so the table does not exhaust each project's capabilities. QEMU covers software CPU emulation, full machine models and control interfaces. VirtualBox spans several layers too.
QEMU can emulate a CPU or call a hardware backend
QEMU system emulation provides a complete machine model. With TCG it dynamically translates guest instructions and can emulate a CPU different from the host. With backends such as KVM, HVF or WHP it delegates the corresponding CPU execution to the host platform's hardware virtualization.
It also offers a command line and control interfaces such as QMP for other tools to configure and operate VMs. More precisely, QEMU adapts to multiple execution backends internally and exposes machine configuration and control externally. That does not imply the backends share one low-level API. Introduction to QEMU system emulation
KVM is part of the Linux kernel
KVM's kernel components entered mainline in Linux 2.6.20. They can be loaded as kernel modules and execute inside the kernel once loaded. KVM has its own maintainers and developer community while its code belongs to a Linux kernel subsystem. KVM project overview
KVM is not limited to the x86 platforms with Intel VT-x and AMD-V. Architectures including ARM also support KVM. Dependence on Linux and CPU architecture support are separate dimensions. On Linux, distribution kernels usually provide it. Check kernel configuration, hardware virtualization and permissions for /dev/kvm. KVM API architecture and access
Userspace programs use /dev/kvm and associated ioctls to create VMs and vCPUs, map memory and run vCPUs. In a common QEMU/KVM model each vCPU corresponds to a host thread scheduled by Linux. KVM also handles virtualization functions such as interrupt controllers. Its boundary extends beyond CPU and memory alone. KVM API documentation
For one execution example, QEMU prepares guest memory and registers mappings, then enters guest execution through KVM_RUN. When an exit needs userspace handling, QEMU handles the device operation and resumes. Some events can be handled directly in the kernel, so exits don't all require a round trip to QEMU. KVM execution model
My preferred description is: the Linux kernel integrates KVM, and KVM reuses Linux infrastructure to give Linux hardware virtualization. Describing KVM as another standalone kernel running on Linux obscures its reuse of scheduling, memory management and other mechanisms.
libvirt manages more than QEMU
libvirt provides a management API for several virtualization backends and also manages their networks, storage and other resources. QEMU is an important backend. Xen and VirtualBox have drivers too. virsh is a command-line client for libvirt and virt-manager a common graphical one. libvirt driver list
A common Linux combination looks like this:
flowchart TB
M["virsh 或 virt-manager"] -->|"管理请求"| L["libvirt"]
L -->|"启动与配置"| Q["QEMU 用户态机器模型"]
Q -->|"KVM API 经由 /dev/kvm"| K["Linux 内核中的 KVM"]
K --> H["CPU 硬件虚拟化扩展"]
Q --> D["虚拟设备及 I/O 后端"]
This diagram represents calls. libvirt is optional: QEMU can run directly. QEMU can also use TCG or another platform's backend without KVM. libvirt QEMU driver
libvirt also handles persistent configuration, autostart, remote management and migration. Every guest CPU instruction does not go through libvirt. Distinguish management requests from the guest's execution path. Drawing a management layer at the top doesn't mean it participates continuously in computation and I/O. libvirt daemons
Another idea to correct is “QEMU and KVM implement one specification for different operating systems.” The KVM API is a Linux interface and QEMU is one caller. VirtIO specifies virtual device interfaces, while the libvirt API manages resources. These interfaces serve different clients. VirtIO specification
History explains how these responsibilities emerged
Today's common QEMU/KVM/libvirt combination didn't arise from three projects starting together and deliberately dividing up the job.
QEMU dates to 2003. In his 2005 paper Fabrice Bellard described cross-architecture dynamic translation, full system emulation and Linux userspace emulation, listing hosts such as Linux, Windows and Mac OS X. Software CPU emulation predated KVM, and QEMU had a cross-platform focus from the beginning. QEMU project retrospective, Bellard's QEMU paper
libvirt began in November 2005, initially to give Xen a stable application development interface. Adding QEMU support in February 2007 brought the libvirtd daemon. The aim was to insulate upper-level tools from changing details across virtualization implementations. Daniel P. Berrangé's history of libvirt
KVM entered mainline Linux in 2007, using hardware virtualization extensions and reusing kernel infrastructure. Pairing it with QEMU, which already had many device models, avoided reimplementing a full userspace machine emulation environment. Original KVM design paper
That explains why separate projects make sense even though each can “create, start and stop” something. Starting a VM means different things at different layers:
- The management layer defines resources, prepares permissions, storage and networks, and starts relevant processes.
- QEMU assembles the machine, connects device backends and controls run state.
- KVM provides kernel facilities for creating and executing virtual CPUs and related operations.
Upper-level actions ultimately invoke lower-level operations. Similar names don't imply duplicate implementations. These boundaries also let one management tool change backends and one execution backend serve different userspace VM implementations.
There are costs: configuration, versions and interfaces must be coordinated, and diagnosis requires identifying the failing layer. One installer can reduce user effort without eliminating the userspace/kernel boundary. Omit libvirt according to whether you need its management functions.
Overlap doesn't mean only one project will survive
QEMU could always emulate CPUs. KVM needed some instruction emulation from its early design. Moving interrupt, timing or I/O paths into the kernel or a separate backend usually adjusts responsibilities for correctness, performance and isolation. Offloading device backends through vhost, for example, doesn't simply mean KVM absorbed QEMU. KVM design paper, QEMU device backends
I expect this division to persist, with leaner combinations for specialized uses. Some overlapping emulation capabilities do not imply that either project necessarily absorbs the other.
To simplify a stack, omit unnecessary management, reduce device models or choose a specialized VMM. There is no need to aim at consolidating everything in one project.
Firecracker shows how to slim a stack for a particular use
AWS announced Firecracker in November 2018 for serverless workloads such as functions and containers. When the goal narrows from compatibility with many complete operating systems and devices to running many small isolated instances, a different userspace VM implementation becomes attractive. AWS launch announcement
In its Linux/KVM architecture, Firecracker is a userspace VMM and KVM provides underlying hardware virtualization. Firecracker provides a minimal device model and a REST API for configuring vCPUs, memory, disks, networking and boot behavior. It replaces the userspace machine implementation QEMU would provide and accepts management requests directly. It needs neither a separate QEMU nor libvirt. Firecracker architecture and API
Fewer devices and guest features can reduce startup overhead, memory and attack surface, at the cost of narrower applicability. A microVM still has its own guest kernel and doesn't rely only on container isolation. Minimal design alone cannot establish that it is faster or safer for every workload. Firecracker design goals
This explains its absence from my Mac desktop shortlist. It requires a Linux host and working KVM on compatible x86-64 or ARM64 hardware and doesn't offer QEMU TCG-style cross-instruction-set full-system emulation. It suits Linux microVM infrastructure research. UTM better fits this local development environment with several full operating systems. Firecracker platforms and use cases
Xen and KVM differ in how they use the host kernel
The better comparison for Xen is the Linux plus KVM route. QEMU plays a different role: it can provide device models for some Xen guest modes, so Xen and QEMU can work together too.
The 2003 Xen paper used paravirtualization: modify the guest OS so its kernel cooperates with the hypervisor over explicit interfaces while retaining the interfaces applications depend on. This responded to x86 virtualization challenges and the hardware of the time. Today's hardware virtualization facilities shouldn't be projected backward. Xen and the Art of Virtualization
Compare resource management more specifically:
| Comparison | Xen | Linux plus KVM |
|---|---|---|
| Core position | Separate hypervisor running directly on hardware | KVM is a Linux kernel subsystem |
| vCPU scheduling | Xen's schedulers | Linux schedules vCPU threads in a common configuration |
| Linux's role | Typically a Linux Dom0 provides management and drivers | Direct part of the virtualization infrastructure |
| Management OS position | Dom0 and normal guests both sit above Xen, with Dom0 more privileged | Userspace management programs call Linux kernel facilities |
Thus “Xen does not depend on Linux” applies to the Xen core running independently of a Linux kernel. Typical deployments still use a Dom0 OS for management and device access. Dom0 isn't a layer every guest sits on top of. Xen architecture
As hardware extensions spread, KVM could use Linux's existing resource management and hardware ecosystem. This reduced engineering integration cost on Linux and helps explain its adoption. Xen also developed modes such as HVM and PVH. It cannot be frozen in time as an old technology that runs only modified kernels. Different modes need different device models, and not every Xen VM needs QEMU. Xen virtualization modes
Commercial investment also shaped the ecosystem. On September 4, 2008, Red Hat announced the acquisition of Qumranet, bringing KVM-related people and technology into Red Hat. This helps explain later product direction without proving one architecture universally superior. Red Hat acquisition announcement
“Xen was replaced” requires a scope. RHEL 6 supported KVM hosts and dropped Xen host support, but could still run as a Xen guest and supplied migration tools. That was a clear product change, not an industry-wide retirement of Xen. RHEL 6 virtualization release notes
A libvirt maintainer also noted its abstraction let RHEL move from Xen to KVM while keeping user-facing tools. That illustrates the value of an independent management layer. Xen still has maintained releases and uses. One distribution's migration doesn't show that Xen disappeared. libvirt retrospective, Xen releases and support
What corresponds to these components on Windows and macOS?
Calling Hyper-V, Apple's virtualization technologies and KVM/QEMU “native or mainstream virtualization stacks” for three OS ecosystems is more accurate than “three quasi-official virtualization kernels.” QEMU is an independent cross-platform userspace project, Apple's VZ a framework, and Hyper-V can mean either the underlying layer or the entire product.
| Layer | Linux | macOS | Windows |
|---|---|---|---|
| Underlying hardware virtualization | KVM in the Linux kernel | Apple's system virtualization implementation | Hyper-V Hypervisor |
| Userspace interface to low-level capabilities | KVM API via /dev/kvm | Hypervisor.framework, HVF | Windows Hypervisor Platform, WHP |
| Building and running complete VMs | Commonly QEMU | Virtualization.framework (VZ), or QEMU with HVF | Hyper-V's VM stack, or QEMU with WHP |
In terms of QEMU execution backends, the comparable items are KVM, HVF and WHP. Microsoft describes WHP's partition, memory-mapping and virtual processor control APIs, citing QEMU as a user. Hyper-V's own complete VM service is at a different level from those low-level APIs. Microsoft virtualization APIs
In QEMU documentation and CLI the Windows backend is whpx, also written WHPX. Microsoft's API is Windows Hypervisor Platform, or WHP. Here these identify the same integration path, rather than two extra VM engines to install. QEMU backend list
Hyper-V is also structurally different from “KVM inside the Windows kernel.” It has a separate hypervisor with the Windows management system in the root partition. The relationship of root and guest partitions resembles the Xen architecture above. Hyper-V architecture
Where HVF ends and VZ begins
HVF offers lower-level vCPU, memory mapping and execution controls. Applications must supply the rest of the machine environment. VZ provides higher-level APIs for complete VMs, including CPU, memory, devices and lifecycle management. Apple's introduction to both frameworks
“KVM is like HVF and QEMU like VZ” helps explain responsibilities but isn't an exact equivalence. KVM comprises a kernel implementation and an interface. HVF is an interface to system facilities. QEMU and VZ both cover machines and devices, but QEMU can also emulate CPUs across architectures.
For supported guests, an application can run a VM directly with VZ, without QEMU or assembling its own HVF calls. VZ can therefore replace some QEMU/HVF setups, but it doesn't cover all QEMU machine types, guests or cross-architecture emulation. Apple Virtualization.framework
This substitution concerns how to implement a Mac VM. VZ does not implement Linux's /dev/kvm API, so existing KVM calls cannot be switched unchanged. Nor can VZ replace KVM as a Linux kernel module. Moving to VZ means adopting Apple's configuration and execution interfaces.
VirtualBox is a complete product that also reuses components
VirtualBox has a VM execution core, virtual devices, management API, command line and graphical interface. Install the version for your host and prepare the guest OS, without assembling QEMU, KVM and libvirt first. VirtualBox overview
It didn't independently rewrite everything. Historically VirtualBox contained a QEMU-based recompiler for certain software execution scenarios and reused other open-source components. Having its own architecture is compatible with reusing some QEMU code. VirtualBox 5.0 manual, chapters 10 and 16
Host changes can alter underlying choices. VirtualBox 7.0 for macOS removed kernel extensions and switched to Apple's Hypervisor and vmnet frameworks. Windows has an execution path using Hyper-V too. Being a separate product doesn't mean always bypassing system virtualization. VirtualBox 7.0 changelog, 7.1 changelog
The two Apple frameworks have different roles. Hypervisor.framework supports vCPU execution and memory mapping. vmnet supports virtual networking interfaces. Using vmnet neither assigns it CPU virtualization nor establishes that VirtualBox's full machine implementation uses VZ. Apple Hypervisor.framework, vmnet network interface entitlement
Align dates and capabilities before comparing Mac support
| Date | Milestone | Meaning |
|---|---|---|
| December 14, 2021 | QEMU 6.2 | Apple silicon hosts could run AArch64 guests via HVF |
| January 1, 2022 | UTM 3.0 beta | Added an Apple Virtualization.framework backend |
| October 10, 2022 | VirtualBox 7.0 | macOS backend moved to Apple frameworks and offered an early Apple silicon developer preview |
| September 9, 2024 | VirtualBox 7.1 | Released ARM Linux and BSD virtualization on macOS ARM hosts |
See QEMU 6.2 release notes, UTM 3.0 release notes, VirtualBox 7.0 and the 7.1 changelog.
QEMU offered this particular hardware acceleration on Apple silicon earlier. That does not extend to every macOS feature or make macOS QEMU's sole or primary development platform. UTM's product focus on Apple is narrower than QEMU's cross-platform foundation.
Separate Intel Macs from Apple silicon Macs. Supported x86 guests on the former are same-architecture virtualization. Supporting ARM guests on the latter doesn't bring old x86 systems along automatically. The 7.1 release notes explicitly list x86-64 VMs on ARM hosts as unsupported. For cross-architecture full-system emulation here, I chose QEMU/UTM. VirtualBox hosts and guests, 7.1 ARM host limitations
The VirtualBox source I inspected includes a development switch named VBOX_WITH_X86_ON_ARM_ENABLED, but its condition is empty-set, so it isn't enabled by default for a target platform. An entry in source doesn't promise release support, nor would it be accurate to say the project never addressed the capability. VirtualBox Config.kmk
Performance and security cannot be ranked by project name alone
A performance comparison should at least fix host and guest architecture, execution backend, virtual devices and workload. The difference between same-architecture hardware virtualization and cross-architecture software emulation is often more important than the graphical interface. “Both run on macOS” isn't yet a comparable test.
Security involves the actual backend, device exposure, process privileges and update status. Using Apple frameworks reduces the need for custom kernel extensions but cannot establish that the whole product is safer. QEMU's security documentation distinguishes supported hardware virtualization from TCG emulation and explicitly says not to rely on TCG for a guest isolation security guarantee. QEMU security documentation
Configuration changes exposure too. Shared folders expose host files to the guest, bidirectional clipboard transfers data across the boundary, and USB passthrough increases the devices the guest can access. VirtualBox recommends ordinary user privileges for day-to-day operation. These concrete settings provide a better basis for comparison than a label such as “more macOS compliant.” VirtualBox security guide
“Interface compatibility” also needs unpacking: host system APIs, guest device drivers, disk formats and automation APIs are separate questions. I chose by target coverage, required devices and operating effort, without assuming VirtualBox is inferior to QEMU in all respects.
UTM integrates two execution paths in one Mac app
UTM began around QEMU, integrating configuration, display, input and VM management. The 3.0 beta in 2022 added VZ, allowing Linux or macOS guests to run directly through Apple frameworks on supported Macs. UTM 3.0 release notes
Saying “VirtualBox equals UTM plus QEMU” double-counts the engine already bundled in UTM. As complete apps delivered to users, VirtualBox and UTM occupy more comparable positions. Their internal engines, components and platform support differ.
flowchart TB
U["UTM 界面与管理"] --> Q["QEMU 后端"]
U --> V["Apple Virtualization.framework"]
Q --> T["TCG 软件 CPU 模拟"]
Q --> H["HVF 硬件虚拟化接口"]
T --> E["跨架构等模拟场景"]
H --> N["受支持的同架构客户机"]
V --> A["框架支持的 Linux 或 macOS 客户机"]
These are alternative routes, without a requirement to install every layer. UTM's architecture has separate QEMU and Apple VM implementations. The former controls the engine through interfaces including QMP, the latter uses VZ. UTM architecture
UTM also targets Apple platforms such as iOS/iPadOS, beyond macOS. QEMU's cross-platform nature doesn't imply UTM itself has official Windows or Linux host versions. “Running Windows/Linux in UTM” normally refers to the guest. UTM official documentation
UTM SE targets iPhone, iPad and Vision Pro. It runs without JIT and relies on slower interpretation, better suited to older or lighter systems. Performance expectations from same-architecture hardware virtualization on Mac do not carry over. UTM platforms, UTM versus UTM SE
Running x86 on ARM: distinguish whole systems from applications
Hardware virtualization runs compatible guest instructions on a real CPU with isolation and controls. It doesn't automatically translate x86 to ARM. Consequently neither KVM on ARM nor HVF on Apple silicon can directly execute an x86 guest.
QEMU uses TCG to translate instructions and a full machine model to emulate x86 on ARM. Turning on KVM or HVF cannot make those x86 guest instructions execute directly on an ARM CPU. QEMU isn't the only cross-architecture full-system emulator: Bochs also emulates an x86 PC in software. QEMU emulated architectures, Bochs overview
Another approach is to run ARM Linux first, then translate individual x86-64 Linux applications. Apple's Rosetta support in Linux VMs, available starting in macOS 13, does this. The guest kernel remains ARM. Applications are translated without booting x86 Linux. Hardware virtualization and software translation can coexist at different layers. Apple WWDC22 introduction
Also distinguish CPU from hardware platform. QEMU supporting an instruction set doesn't mean it emulates every computer, firmware and specialized device using that CPU. Each build-matrix combination needs a machine model and OS image that can boot and satisfy the tests. QEMU device models
How to use the common three-layer explanation
My research also referenced Zhang Qirui's How are hypervisors, KVM and QEMU actually related? Its beginner's explanation—KVM handles CPU and memory, QEMU devices, libvirt management—helps with a common Linux stack, but several simplifications should not be strict boundaries:
- libvirt is optional for running VMs. As a management layer it need not be part of a hypervisor.
- QEMU can use hardware virtualization without KVM. Examples include HVF on Mac and WHP on Windows.
- KVM covers more than CPU and memory. It includes components such as virtual interrupt controllers.
- The main QEMU process need not handle all I/O. Device backends can be offloaded and devices passed through.
- Linux handles host scheduling of guest vCPU threads. Don't assume KVM builds another general-purpose scheduler alongside Linux.
Compare these boundaries in the KVM API, QEMU system architecture and libvirt drivers. Cloud implementations vary by product and period. The common open-source combination cannot simply be treated as every provider's complete internal architecture.
From running VMs to provisioning and ongoing management
After choosing what runs VMs, decide how to create environments, configure software and maintain consistency during use. Vagrant, Ansible and Terraform each cover parts of this automation layer.
Creating resources is provisioning
Creating VMs, disks and networks is itself infrastructure provisioning. Broadly, server provisioning can include initial system and software preparation too. Its precise meaning depends on context. Red Hat on provisioning
| Stage or task | English term | Local development example |
|---|---|---|
| Create and allocate resources | Infrastructure provisioning / Resource provisioning | Create three VMs and assign CPU, memory, disks and networks |
| Prepare a minimally usable system | Bootstrapping / Initialization | Create initial users, configure SSH and prepare dependencies such as Python |
| Manage system configuration | Configuration management | Maintain desired state for packages, files, users and services |
| Deploy software | Application deployment | Install or update your app and start its service |
| Ongoing post-deployment operations | Day-2 operations / Ongoing maintenance | Patching, health checks, backups, updates and incident handling |
These can share a workflow and needn't be mutually exclusive steps. Vagrant's terminology deserves care. A provider connects to a backend to create and control machines. A provisioner typically handles software and configuration inside. Thus vagrant provision reruns configuration tasks without recreating the VM. Vagrant provisioning
Several networked VMs are only a cluster's infrastructure. Install software such as Kubernetes or a database, initialize a control node and join others before they become that cluster. This is often called cluster bootstrapping or cluster deployment. Vagrant provisioners can connect the steps. Vagrant multi-machine environments
Different problems drove these tools' development
These three appeared in the order Vagrant, Ansible, Terraform. Configuration management and resource provisioning go back further. The field didn't begin with Ansible.
| Date | Project or milestone | Context for this choice |
|---|---|---|
| 1993 | CFEngine development began | Automated system configuration and maintenance have a long history. Project retrospective |
| 2010 | Vagrant development began | Focused on creating, using and reproducing development environments. Retrospective in the founding announcement |
| February 2011 | AWS CloudFormation launched | Created groups of cloud resources from templates and managed dependencies. Launch announcement |
| 2012 | Ansible appeared | Early focus included configuration management, deployment and ad hoc tasks. Early presentation by its founder |
| July 2014 | Terraform launched | Described resources and relationships from multiple providers in one infrastructure declaration. Launch announcement |
In a 2014 account, Ansible's author already covered configuration management, cloud provisioning, application deployment, rolling upgrades and maintenance workflows. Its history wasn't “first creating machines, then switching to ongoing management.” Automating systems and operational processes has long been central. Michael DeHaan on Ansible's design
Terraform traces back to a different need. Mitchell Hashimoto recalls wanting a declarative infrastructure tool spanning providers after CloudFormation appeared in 2011, eventually releasing Terraform in 2014. System configuration and task automation, reproducible development environments, and cross-platform resource orchestration evolved separately. Where capabilities overlap, combine them according to the requirement. Terraform founder's retrospective
There is an explicit official account of this combination. In July 2025 Red Hat described Terraform providing initial resources and Ansible initializing systems and handling ongoing operations. Terraform continues to own scaling and retirement. This recommended split doesn't establish a general shift in how Ansible users use it. Infrastructure lifecycle management
Ansible can configure the system inside a guest
UTM/QEMU and related components run the VM in this workflow. Once it boots, Ansible can configure Linux guest software, users and services over SSH. A Mac can be its control node. Managed targets extend beyond Linux VMs to physical machines, cloud servers or macOS. It automates operations, rather than executing guest CPUs. Ansible nodes
Ansible can also call virtualization management APIs through modules such as community.libvirt.virt to define, start and stop VMs. amazon.aws.ec2_instance creates and manages cloud instances. This calls management interfaces without logging into a guest that doesn't yet exist. Connect to the guest to configure software after boot. It orchestrates existing virtualization capabilities without replacing libvirt or QEMU/KVM. libvirt module, EC2 module
Later tasks can be called configuration management, patch management, or configuration drift detection and remediation, emphasizing configuration, patching, and identifying and fixing divergence. Day-2 operations covers ongoing operations after deployment. Operational automation emphasizes executing them automatically. Infrastructure lifecycle management spans creation through retirement. Red Hat on configuration and operations
Ongoing maintenance does not mean running a playbook once monitors continuously in the background. Rerun as needed, schedule or trigger by event. For example ansible-pull with cron can retrieve and apply configuration from a repository periodically. For my choice about Ansible for a personal Mac and project environment, see the development environment notes. ansible-pull documentation
Vagrant expresses development environments as reproducible configurations
Vagrant is worth considering for per-project development environments. The project's Vagrantfile describes machine and configuration requirements. vagrant up creates and configures the environment accordingly. Commit configuration alongside the project so it can be rebuilt and reused by other developers. Vagrantfile, vagrant up
Vagrant itself doesn't emulate CPUs. The machine runs on the backend connected by a provider, such as VirtualBox, VMware or Hyper-V. A box packages the base environment for that provider. A provisioner installs software and changes configuration, through shell scripts or an Ansible playbook, for instance. Ansible is optional. Simple initialization can start with shell. Providers, box format, Ansible provisioner
For a VM provider, Vagrant uses the project definition to call the provider and create the VM, then invokes a provisioner to configure the guest. Both Vagrant and libvirt manage things, but Vagrant emphasizes developer workflows for project environments. The chosen backend still executes the VM. With a full VM backend, Vagrant doesn't automatically turn the guest into a lighter container. Vagrant overview
On Apple silicon, verify the Vagrant version, provider host support, and whether the box's provider and CPU architecture match. An existing x86 VirtualBox box won't become an ARM VM or escape VirtualBox's cross-architecture limits by adding Vagrant. Supporting a particular VirtualBox version is no guarantee every guest architecture runs. Vagrant VirtualBox support, VirtualBox ARM host limitations
Terraform manages resources and their lifecycles
Terraform connects to platforms using providers, declares resources such as VMs, networks and disks and their dependencies, and uses state to track the resources it manages. After changing a declaration, preview changes with plan and execute with apply. It can manage both cloud and self-hosted environments. Provider support determines the practical boundary. How Terraform works
Both Vagrant and Terraform come from HashiCorp, and overlap on multi-machine creation and lifecycle operations. Vagrant combines SSH, directory synchronization, network setup and initialization into a convenient developer workflow. Terraform focuses on a general resource model, dependencies and long-term change. That explains why both exist without requiring both for every environment. HashiCorp's comparison
Terraform has provisioners such as remote-exec, but that doesn't make resource declarations a good place for every in-system configuration task. The docs prefer images or dedicated configuration management because Terraform cannot model arbitrary script behavior as reliably as ordinary resources. Terraform provisioners
Mac compatibility and operating trade-offs
For local Linux VMs on an Apple silicon Mac, I'd weigh the choices this way:
| Comparison | Vagrant | Ansible | Terraform |
|---|---|---|---|
| Mac compatibility focus | Architecture and version of Vagrant, provider, virtualization backend and box | Python on the control node, guest SSH, privileges and module requirements | CLI and provider host support and the target platform's interface |
| With UTM | Community vagrant_utm provider requires a matching box and capabilities | Configures SSH-accessible Linux guests, usually without a UTM-specific plugin | Verify provider availability and resource coverage. An installable CLI doesn't imply direct UTM support. |
| Batch operation | Define multiple machines in a Vagrantfile | List targets in inventory and execute tasks via playbooks | Declare resources and create or change them in dependency order |
| Ease-of-use trade-offs | Initial provider/box setup, then convenient startup, login, destruction and rebuild | Easy to add to existing machines, with inventory and playbooks to maintain | Requires understanding providers, state, plans and resource lifecycles, potentially increasing local setup effort |
| Consistency focus | Repeatedly create development VMs from a fixed base | Bring declared software and configuration to the desired state | Bring provider-managed resources in line with declarations |
All three can initiate work from a Mac. Running a tool and managing a particular backend are separate conditions. Terraform offers official macOS ARM64 and AMD64 downloads, Ansible supports Mac control nodes, and Vagrant/UTM still needs checks for plugin and box compatibility. Managing remote Linux KVM from a Mac also differs from running KVM locally on macOS. Terraform installation, Ansible installation, UTM provider
“Batch” doesn't guarantee parallel execution of every step. Vagrant supports multi-machine definitions, but its default Ansible provisioning differs from running directly in parallel over the whole inventory. Configure batches, concurrency and order as needed. Vagrant multi-machine configuration, Ansible integration parallel example
Consistency can't be ranked by product name alone. Pin Vagrant boxes, architectures and configuration. Prefer Ansible modules that check target state and constrain software versions. Arbitrary shell scripts aren't automatically idempotent. Terraform checks resource properties visible to its provider, not a compiler manually upgraded inside a guest. ARM/x86, system and package-source differences still need real builds and tests. Ansible playbooks and idempotency, how Terraform works
For personal local development needing full VMs consistently created and rebuilt per project, I'd first consider Vagrant if the provider and box fit. For consistent software and configuration on existing VMs I'd start with Ansible. For broader platform resources with a suitable provider, consider Terraform. A cluster isn't required. Rebuilding one VM repeatedly can benefit from automation. Usually give one tool responsibility for the resource lifecycle and add Ansible as needed.
Working with UTM when you need a desktop
The community vagrant_utm plugin available when I wrote this controls and configures VMs through UTM's API. Install UTM, Vagrant and the plugin and prepare a suitable UTM box. Vagrant can then manage the environment while UTM displays the guest desktop. Normal creation and startup on this route need no separate QEMU install. UTM runs its own engine. Vagrant UTM plugin
UTM integrates a customized QEMU as a shared library. Its ordinary distribution isn't a standalone GUI where an arbitrary external QEMU executable can be selected. “UTM plus Vagrant plugin” and “make UTM use Homebrew's QEMU” are different arrangements. The UTM provider automates creation and configuration, while UTM keeps its integrated runtime. UTM architecture, UTM and ordinary QEMU argument differences
| Route | Components to prepare | VM execution |
|---|---|---|
| Direct UTM | UTM, guest image and configuration | UTM's integrated QEMU or supported Apple VZ backend |
| UTM provider | Vagrant, vagrant_utm, UTM, matching box | UTM's integrated capabilities, without an extra QEMU installation for basic execution |
| QEMU provider | Vagrant, vagrant-qemu, callable QEMU, matching image or box | Plugin invokes QEMU directly. Its macOS installation example uses Homebrew. |
vagrant-qemu is a separate route. Its defaults are headless, and a desktop requires more configuration without automatically gaining UTM's management UI. QEMU embedded inside UTM isn't automatically a configured standalone QEMU for these plugins. You can keep a separate QEMU for CLI experiments, with it and UTM each using their own engine. Vagrant QEMU plugin
A UTM graphical window also differs from a desktop installed inside the guest. For Linux, the box must include a desktop or install it during provisioning and have suitable display hardware and guest tools. Existing UTM VMs must meet plugin networking and connection requirements and be packaged as a suitable box before joining Vagrant workflows. Check actual UTM, plugin and box versions for community plugin scope. Don't assume every UTM guest and backend is covered. Building a UTM box, known plugin limitations
November 2026 addition: HashiCorp's docs announced that HCP Vagrant image hosting stopped creating new boxes on October 1, 2026 and was scheduled to cease operations December 31. This hosted service is separate from the local Vagrant tool. When creating environments, confirm the box download source and future maintenance. Official Box service announcement
My actual choice on the new MacBook
To keep several full operating systems locally for installing toolchains, reproducing issues and verifying system behavior, I chose UTM as the entry point. It combines the QEMU and Apple framework paths in one application, saving me from assembling the interface and engines myself.
Once UTM is installed, there's no separate QEMU, KVM or libvirt prerequisite. You still need guest images, development dependencies inside guests and verification of the required features. The official macOS instructions offer direct download. UTM installation
For control over the QEMU command line, install it separately if desired. The QEMU site lists Homebrew and MacPorts options on macOS. This is an alternative entry point, not a prerequisite for UTM. QEMU download and installation
On an Apple silicon Mac my environment could look like this:
| Need | My choice | Boundaries to check |
|---|---|---|
| Full ARM64 Linux | UTM QEMU with HVF, or Apple VZ | Select the backend by shared folders, display, devices and other requirements |
| Full ARM64 macOS | UTM's Apple VZ backend | Guest versions depend on host system and Apple framework support |
| Full ARM64 Windows | UTM QEMU with HVF | Prepare an ARM system image and required guest drivers |
| Full x86-64 Linux or Windows | UTM QEMU TCG | Suits necessary compatibility checks. Not my first choice for large builds. |
| Frequent, lengthy x86-64 builds and tests | Native x86-64 build machine or CI | Develop locally and trigger jobs |
| Only standardize project toolchains and dependencies | Containers and .devcontainer/devcontainer.json | Pin images and dependencies, without maintaining a full guest per project |
| Consistently create and rebuild full development VMs | First consider Vagrant with a matching provider and box | Verify backend and box on Mac. Vagrant adds no cross-architecture ability. |
| Configure and maintain existing Linux systems in batches | Ansible as needed | No cluster required. Configure connections, permissions and how runs repeat. |
| Arbitrary full OS/architecture combinations | Verify support and testing per combination | One UTM installer cannot guarantee all combinations |
UTM's architecture settings explicitly require matching guest and host architectures for hardware virtualization. Its Apple backend handles supported macOS guests. Windows has separate system and guest-tools installation instructions. Architecture settings, Apple backend, Windows guide
UTM handles local full-system management. A long-term release workflow still needs decisions on build location, targets requiring native testing and scenarios worth retaining a VM for.
Lighter alternatives
Full VMs provide an independent guest kernel, system state and device environment. When only some of that is needed, smaller tools can reduce images, system updates and resource use.
Cross-compilation and target platform SDKs
If you only need to generate another platform's program, start by checking cross-compilation support in the toolchain. For example, a Go main program that already supports the target and does not depend on cgo can generate x86-64 Linux and Windows binaries separately:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o app-linux-amd64 .
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o app-windows-amd64.exe .
This changes the build target without booting Linux or Windows. If the project depends on cgo, disabling it isn't a universal fix. Prepare an appropriate C cross-compiler and target dependencies. Go build environment variables, cgo cross-compilation requirements
C/C++ can use Clang's target selection and a matching sysroot. A compiler recognizing an architecture doesn't supply missing target libraries or linking tools. Rust distinguishes platform support tiers too: generating target code and continuously running official tests are different commitments. Projects calling system APIs or third-party C libraries also need the corresponding dependencies. Rust platform support
For macOS apps shipped on Intel and Apple silicon, Xcode's universal binary workflow combines code for both architectures into one artifact. Generating Intel code need not start by emulating an entire Intel Mac on an ARM Mac. Still distinguish native execution and Rosetta translation when running and debugging. Apple universal binaries
Containers and multi-platform image builds
To pin Linux userspace, compiler versions and project dependencies, prefer containers with .devcontainer/devcontainer.json. Each project needn't own a full OS or desktop VM. Commit configuration alongside code to recreate the development environment from the same definition on a new machine or fresh checkout.
devcontainer.json describes the development container and editor settings and references an image, Dockerfile or Compose file. Put tools and dependencies into the image build and project dependency files as needed. With a container engine and VS Code Dev Containers extension ready, use Reopen in Container. Pin the base image version or digest, toolchain and dependency lockfiles for greater reproducibility than a JSON file referencing latest alone. Getting started with Dev Containers, devcontainer.json reference
Containers share the kernel running them. Configuration cannot turn a Linux kernel into Windows or macOS. Linux containers on Mac usually still have a Linux VM underneath. What shrinks is the per-project burden of maintaining a complete system, rather than all virtualization disappearing.
Choose full VMs for independent guest kernels, complete desktops, drivers or specific system behavior. One Dev Containers configuration also cannot eliminate ARM/x86 differences, host path differences or external service changes. It makes the declarable parts of a development environment consistent. For my Podman and VS Code setup see the development environment notes.
Multi-platform images can use QEMU userspace emulation, multiple native build nodes or cross-compilation. Docker's docs caution that emulation may be substantially slower for CPU-intensive compilation and compression. A linux/amd64 image label does not establish that a native x86 CPU built it. Multi-platform build strategies
Translate just the application
If you're missing an application for a specific architecture but don't need that architecture's entire OS, consider Rosetta or QEMU userspace emulation.
QEMU Linux userspace emulation runs a Linux program built for one CPU architecture in Linux on another, translating relevant system calls. It avoids a second guest kernel but still needs runtime libraries and other dependencies. It isn't a general compatibility layer for running arbitrary Linux ELF files directly on macOS. QEMU userspace emulation
Using Rosetta inside an ARM Linux VM on Mac means starting with Linux and adding application translation. It is more targeted than building a full x86 Linux system, but unsuitable for verifying an x86 kernel, drivers or a complete boot sequence.
Send builds and tests to native remote environments
For the real target OS, complex SDKs or frequent large builds, keep editing and debugging entry points on Mac and send jobs to remote Linux, Windows, Intel Mac or ARM builders. CI matrices can describe the required OS, architecture and toolchain combinations. GitHub Actions matrix documentation
What matters is the environment the runner actually supplies. Naming a matrix variable arm64 doesn't change its CPU. Select a matching node or explicitly configure cross-compilation and emulation. A remote environment may still use VMs, but the local machine needn't maintain the whole setup.
Build and test matrices can be separate. Cross-compile for fast artifacts, use native targets for key runtime tests, and reserve UTM for full-system issues needing direct observation and reproduction.
Use project environments when only toolchains need isolation
If projects merely need different versions of Python, Node.js, compilers or dependencies, start with virtual environments, version managers or declarative development environments. Their isolation scope is smaller and they don't convert the host into another OS.
For my cross-platform requirements I'd add environments as work demands: confirm the target and dependencies, cross-compile where possible, use a container for Linux userspace, and use UTM or a native remote machine for actual target system behavior. Reserve full VMs for verification that needs them.
The research began with development environment choices for a new MacBook on August 22, 2025. This article was organized on November 11, 2026. Architectures and commands illustrate the selection method. Actual guest support depends on the host, tool version and target platform.