If we’re diving into Vagrant and working on a shiny new M4 Mac (or any other Apple Silicon M series), we’ve probably stumbled across terms like KVM, QEMU, and Libvirt as providers. But which one fits our workflow best - especially when dealing with Apple Silicon?
Here’s a simple, real-world comparison.
Quick Intro: The options
- KVM – A Linux-native virtualization technology that’s lightning fast, but strictly tied to Linux kernels.
- QEMU – A powerful emulator and virtualizer, supports cross-architecture (e.g., x86 VMs on ARM). It’s highly versatile and works well for testing and development across different architectures.
- VMware Fusion – Another commercial option, providing robust virtualization capabilities on macOS, though its support for Apple Silicon is still evolving.
- Libvirt – A management layer that works on top of KVM or QEMU to provide better VM orchestration (snapshots, port forwarding, etc.).
The Apple Silicon Challenge
Here’s where things get tricky on the Mac — especially with Apple Silicon:
❌ KVM is a no-go
- KVM requires /dev/kvm, a kernel module only available on Linux, and not supported on macOS.
- Apple Silicon (M1–M4) doesn’t allow KVM passthrough even via emulation layers. See here.
⚠️ Libvirt adds complexity on macOS
- Libvirt doesn’t run natively on macOS. To use it, we would need to spin up a Linux VM (via Colima, Lima, or UTM) just to run QEMU and Libvirt.
- While doable, it’s like building a tower to launch a paper airplane - overkill for most development use cases.
QEMU: Your Friendly Option on Apple M4
Thankfully, QEMU works directly on macOS, supports ARM64 (native for M1–M4), and integrates with Vagrant using vagrant-qemu.
It’s:
- ✅ Native to Apple Silicon
- ✅ Great for cross-architecture testing
- ✅ Easy to set up with brew install qemu vagrant + plugin
- ✅ Ideal for lightweight VMs and multi-purpose dev
We can pair QEMU with ARM-based boxes like generic/ubuntu2204-arm64 or others from Vagrant Cloud.
💡 Want to get started fast? Try:
brew install qemu
vagrant plugin install vagrant-qemu
vagrant init perk/ubuntu-2204-arm64
vagrant up --provider=qemu
Comparing the Providers
Provider | macOS Native | M4 Compatible | Performance | Complexity | Best Use Case |
---|---|---|---|---|---|
KVM | No | No | High | Simple (on Linux only) | Linux-based dev servers |
QEMU | Yes | Yes | Medium | Easy on Mac | Local multi-arch dev |
Libvirt | No (indirect) | Only with Linux VM | (via KVM/QEMU) | Complex on macOS | Advanced VM orchestration (on Linux) |
So Which One to choose on Apple M4?
For macOS Silicon chip users:
- ✅ QEMU is your best bet: It runs natively on Apple Silicon, supports ARM64 architecture, and integrates seamlessly with Vagrant using the
vagrant-qemu
plugin. This makes it an excellent choice for lightweight virtual machines and cross-architecture development. - ⚠️ Consider Libvirt only if necessary: While Libvirt offers advanced VM management features, it requires running a Linux VM on macOS, adding unnecessary complexity for most use cases.
- ❌ Avoid KVM: Since KVM relies on Linux-specific kernel modules, it’s not an option for macOS.
In summary, QEMU provides the most straightforward and efficient solution for virtualization on Apple M4.