What is Vagrant?
Vagrant is an open-source tool by HashiCorp for building and managing portable virtual machine environments. It provides a simple, consistent workflow to create, configure, and destroy VMs using a single configuration file called a Vagrantfile. For database engineers, Vagrant is invaluable for spinning up isolated OEL 8 environments to test MySQL, Oracle, ProxySQL, and other database stacks without touching production systems.
Architecture Overview
Key Concepts
- Box: A packaged VM image — the base operating system. Think of it like a Docker image but for full VMs.
- Vagrantfile: Ruby-based config file that defines your VM — box, CPU, RAM, network, provisioning.
- Provider: The virtualisation engine — VirtualBox or Parallels Desktop in our case.
- Provisioner: Scripts or tools that run inside the VM after it boots — Shell, Ansible, Chef etc.
- Synced Folder: A folder shared between your host machine and the VM.
- Snapshot: A saved state of your VM — restore to it any time.
- Multi-Machine: Define multiple VMs in one Vagrantfile — perfect for database replication labs.
VirtualBox vs Parallels Desktop
| Feature | VirtualBox | Parallels Desktop |
|---|---|---|
| Cost | Free | Paid (licence required) |
| Platform | Mac, Windows, Linux | Mac only |
| Apple Silicon (M1/M2/M3) | Limited (v7+) | Excellent native support |
| Performance on Mac | Good | Excellent |
| Vagrant Provider | Built-in (default) | Plugin required |
| OEL 8 Support | Full | Full (ARM + x86) |
| Snapshots via Vagrant | Yes | Yes |
| Nested Virtualisation | Limited | Yes |
Why Vagrant for Database Work?
- Reproducible environments: Share a Vagrantfile and everyone gets the identical setup.
- Safe testing: Test upgrades, config changes, and migrations without risk.
- Multi-node labs: Spin up Master + Replica + ProxySQL in one command.
- Snapshot and rollback: Break things, restore in seconds.
- Offline work: Full VM runs without internet after initial setup.
- OEL 8 specific: Test exactly what runs in your production Oracle Linux environment.
What We Cover in This Series
| Section | Pages | Topics |
|---|---|---|
| Basics | 1–6 | Introduction, Installation, CLI, Vagrantfile, OEL 8 Box |
| VirtualBox | 7–14 | First VM, Networking, Folders, Multi-Machine, Provisioning, Snapshots |
| Parallels | 15–20 | First VM, Provider Config, Networking, Multi-Machine, Box Packaging |
| Database Labs | 21–30 | MySQL, Oracle, ProxySQL, Galera, InnoDB Cluster, PostgreSQL |
| Advanced | 31–38 | Plugins, Custom Boxes, Secrets, Troubleshooting, Cheat Sheet |
💡 Note: All examples in this series target Oracle Enterprise Linux 8 (OEL 8) — matching real production Oracle Linux environments.