Vagrant
Vagrant is a popular local virtualization tool that creates local virtual machines in a declarative manner.
Pigsty requires a Linux environment to run. You can use Vagrant to easily create Linux virtual machines locally for testing.
The currently recommended and validated baselines are Rocky Linux 9.8 / 10.2, Debian 12.15 / 13.6, and Ubuntu 22.04.5 / 24.04.4 / 26.04.0. Major-version Vagrant aliases map to pinned box versions.
Quick Start
Install Dependencies
First, ensure you have Vagrant and a virtual machine provider (such as VirtualBox or libvirt) installed on your system.
On macOS, you can use Homebrew for one-click installation:
After installing VirtualBox, you need to restart your system and allow its kernel extensions in System Preferences.
On Linux, you can use VirtualBox or vagrant-libvirt as the VM provider.
Create Virtual Machines
Use the Pigsty-provided make shortcuts to create virtual machines:
You can use variant aliases to specify different operating system images:
Available OS suffixes: 8 (EL8), 9 (EL9), 10 (EL10), 12 (Debian 12.15), 13 (Debian 13.6), 22 (Ubuntu 22.04.5), 24 (Ubuntu 24.04.4), 26 (Ubuntu 26.04.0)
Build Environment
You can also use the following aliases to create Pigsty build environments. These templates won’t replace the base image:
Spec Templates
Pigsty provides multiple predefined VM specs in the vagrant/spec/ directory:
| Template | Nodes | Spec | Description | Alias |
|---|---|---|---|---|
| meta.rb | 1 node | 2c4g x 1 | Single-node devbox | Devbox |
| dual.rb | 2 nodes | 1c2g x 2 | Two-node environment | |
| trio.rb | 3 nodes | 1c2g x 3 | Three-node environment | |
| full.rb | 4 nodes | 2c4g + 1c2g x 3 | 4-node full sandbox | Sandbox |
| deci.rb | 10 nodes | Mixed | 10-node environment | |
| simu.rb | 20 nodes | Mixed | 20-node production simubox | Simubox |
| minio.rb | 4 nodes | 1c2g x 4 + disk | MinIO test environment | |
| citus.rb | 13 nodes | Mixed | Citus coordinator and six two-replica worker groups | |
| oss.rb | 7 nodes | 2c2g x 7 | 7-platform OSS build environment | |
| pro.rb | 7 nodes | 2c2g x 7 | 7-platform PRO build environment | |
| rpm.rb | 2 nodes | 1c2g x 2 | 2-node EL build environment | |
| deb.rb | 5 nodes | 1c2g x 5 | 5-node Deb build environment | |
| all.rb | 7 nodes | 1c2g x 7 | 7-node full build environment |
Each spec file contains a Specs variable describing the VM nodes. For example, full.rb contains the 4-node sandbox definition:
Current Vagrant templates explicitly provision a 32 GB primary system disk for every VM. Regular nodes also receive one data disk whose size comes from the spec’s disk value, defaulting to 128 GB when omitted. Object-storage nodes whose names begin with minio instead receive four 32 GB data disks mounted at /data1 through /data4.
These disks depend on Vagrant’s experimental disks feature. The repository Makefile exports VAGRANT_EXPERIMENTAL=disks automatically; set it yourself when invoking vagrant directly.
simu Spec Details
simu.rb provides a 20-node production environment simulation configuration:
- 3 x infra nodes (
meta1-3): 4c16g - 2 x haproxy nodes (
proxy1-2): 1c2g - 4 x minio nodes (
minio1-4): 1c2g - 5 x etcd nodes (
etcd1-5): 1c2g - 6 x pgsql nodes (
pg-src-1-3,pg-dst-1-3): 2c4g
Config Script
Use the vagrant/config script to generate the final Vagrantfile based on spec and options:
Image Aliases
The config script supports various image aliases:
| Distro | Alias | Vagrant Box |
|---|---|---|
| Rocky 8 | el8, rocky8, r8 | cloud-image/rocky-8 |
| Rocky 9 | el9, rocky9, el, r9 | cloud-image/rocky-9 |
| Rocky 10 | el10, rocky10, r10 | cloud-image/rocky-10 |
| Debian 12 | d12, debian12, deb12 | cloud-image/debian-12 |
| Debian 13 | d13, debian13, deb13 | cloud-image/debian-13 |
| Ubuntu 22.04.5 | u22, ubuntu22, ubuntu2204 | cloud-image/ubuntu-22.04 |
| Ubuntu 24.04.4 | u24, ubuntu24, ubuntu2404, ubuntu | cloud-image/ubuntu-24.04 |
| Ubuntu 26.04.0 | u26, ubuntu26, ubuntu2604 | cloud-image/ubuntu-26.04 |
| AlmaLinux 8 | alma8 | cloud-image/almalinux-8 |
| AlmaLinux 9 | alma9 | cloud-image/almalinux-9 |
| AlmaLinux 10 | alma10 | cloud-image/almalinux-10 |
| RHEL 8 / 9 | rhel8, rhel9 | generic/rhel8, generic/rhel9 |
| Oracle Linux 8 / 9 | oracle8, oracle9 | generic/oracle8, generic/oracle9 |
The historical d11/debian11/deb11 and u20/ubuntu20/ubuntu2004 aliases remain visible in the script mapping, but the current script explicitly rejects them; they are not supported images.
Resource Scaling
You can use the VM_SCALE environment variable to adjust the resource multiplier (default is 1):
For example, using VM_SCALE=4 with the meta spec will adjust the default 2c4g to 8c16g:
The simu and deci specs don’t support resource scaling. The scale parameter is automatically reset to 1 because their resource configurations are already optimized for simulation scenarios.
VM Management
The vagrant/Makefile provides shortcuts for managing virtual machines. Run the following commands from that directory:
SSH Keys
Pigsty Vagrant templates use your ~/.ssh/id_rsa[.pub] as the SSH key for VMs by default.
Before starting, ensure you have a valid SSH key pair. If not, generate one with:
Supported Images
The standard EL, Debian, Ubuntu, and AlmaLinux matrix uses cloud-image/* boxes from Vagrant Cloud. Explicit RHEL and Oracle Linux aliases use generic/* boxes. The current config script applies the same cloud-image/* mapping to VirtualBox, libvirt, amd64, and arm64; actual payload availability is still resolved by Vagrant Cloud at runtime.
VirtualBox and libvirt use the same mapping. vagrant/config writes the validated versions below for every supported cloud-image/* image, making amd64 and arm64 environments reproducible:
| OS | Vagrant Box | Source Version Policy |
|---|---|---|
| Rocky 8 | cloud-image/rocky-8 | 8.10.20240528.0 |
| Rocky 9 | cloud-image/rocky-9 | 9.8.20260525.0 |
| Rocky 10 | cloud-image/rocky-10 | 10.2.20260525.0 |
| Debian 12 | cloud-image/debian-12 | 20260806.2562.0 |
| Debian 13 | cloud-image/debian-13 | 20260810.2566.0 |
| Ubuntu 22.04 | cloud-image/ubuntu-22.04 | 20260810.0.0 |
| Ubuntu 24.04 | cloud-image/ubuntu-24.04 | 20260801.0.0 |
| Ubuntu 26.04 | cloud-image/ubuntu-26.04 | 20260731.0.0 |
| AlmaLinux 8 | cloud-image/almalinux-8 | 8.10.20260803 |
| AlmaLinux 9 | cloud-image/almalinux-9 | 9.8.20260810 |
| AlmaLinux 10 | cloud-image/almalinux-10 | 10.2.20260526.0 |
The retained but unsupported Debian 11 and Ubuntu 20.04 aliases are pinned to 20260618.2513.0 and 20250624.0.0; experimental generic/* RHEL, Oracle Linux, and CentOS 7 images are pinned to their final 4.3.12 release. These legacy images are outside the current support matrix.
Environment Variables
You can use the following environment variables to control Vagrant behavior:
Notes
When using older versions of VirtualBox as Vagrant provider, additional configuration is required to use 10.x.x.x CIDR as Host-Only network:
The first time you use Vagrant to start a specific operating system, it will download the corresponding Box image file (typically 1-2 GB). After download, the image is cached and reused for subsequent VM creation.
If you’re using libvirt as the provider, you can use make info to view VMs, networks, and storage volume information, and make nuke to forcefully destroy all related resources.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)