vftool: A Minimalist Virtualization.framework Tool
vftool
is a minimalist command-line wrapper designed to run Linux virtual machines using Apple's Virtualization.framework
on macOS Big Sur (11.0) and later. It provides a simple, direct way to configure and launch VMs without a graphical interface, making it ideal for developers and scripters.
The tool focuses on simplicity and essential configuration, allowing you to specify:
- The Linux kernel and an optional initial RAM disk (initrd).
- A custom kernel command line.
- The number of virtual CPUs and amount of memory.
- Attached storage, including multiple read-write disk images and read-only CD-ROM images.
- Console and networking options.
All virtualization is handled by the high-performance, native Virtualization.framework
, which vftool
configures and launches. The result is a lightweight VM with a text-based console and network access, perfect for development, testing, and automation tasks.
vftool
is tested on both M1-based (arm64/AArch64) and Intel-based (x86) Macs.
Key Features
- Command-Line Driven: Configure and run VMs entirely from your terminal.
- Lightweight Wrapper: Leverages the native power of
Virtualization.framework
with minimal overhead. - Flexible Configuration: Control CPU, memory, kernel, command line, and storage.
- Multiple Disk Support: Attach up to 8 virtio-blk devices, including read-only images.
- Interactive or Scriptable Console: Choose between an interactive pseudo-terminal (pty) or standard I/O for automation.
- Simple Networking: Default NAT configuration provides out-of-the-box network access for guests.