Developers need consistent, reproducible environments — the same OS version, the same dependencies, the same configuration — whether they are running code locally, testing in CI, or deploying to production. Inconsistent environments are the root cause of the infamous “it works on my machine” problem, and they waste hours debugging environment-specific issues.
Three open-source tools address this challenge from different angles: Packer (15,667 stars) builds identical machine images for multiple platforms, Vagrant (27,121 stars) provisions reproducible development VMs, and Multipass (9,068 stars) orchestrates lightweight Ubuntu instances on demand.
This guide covers image building, VM provisioning, cloud provider integration, and team environment reproducibility so you can choose the right tool for your development workflow.
Packer: Machine Image Builder
Packer is a tool for creating identical machine images for multiple platforms from a single source configuration. It supports VirtualBox, VMware, AWS AMI, Azure, GCP, Docker, DigitalOcean, and dozens of other builders.
Key characteristics:
- Single HCL configuration produces images for multiple platforms
- Supports provisioners (shell, Ansible, Chef, Puppet, PowerShell) to configure the image during build
- Post-processors to compress, upload, or tag images after building
- Used by teams to create golden images for cloud deployments and local development
- Now maintained by the OpenBao community after HashiCorp’s license change
Packer Docker Deployment / Image Building
Packer itself is a CLI tool, not a service. It runs as a build process, often in CI/CD pipelines:
| |
Packer HCL configuration (ubuntu-docker.pkr.hcl):
| |
Building the image:
| |
Vagrant: Reproducible VM Provisioning
Vagrant is a tool for building and managing virtual machine environments through a simple, declarative configuration file. It abstracts away the differences between VirtualBox, VMware, Hyper-V, Docker, and cloud providers.
Key characteristics:
Vagrantfiledefines the entire development environment in code- Supports multiple providers (VirtualBox, VMware, Docker, Hyper-V, libvirt)
- Built-in provisioning (shell, Ansible, Chef, Puppet)
- Shared folders sync host and guest directories automatically
- Network forwarding and private networks for multi-VM setups
- Widely adopted — the de facto standard for reproducible dev environments
Vagrant Docker Provider Deployment
While Vagrant traditionally uses VirtualBox, it can use Docker as a provider for lightweight container-based environments:
| |
Traditional Vagrantfile (Vagrantfile):
| |
Using Vagrant:
| |
Multipass: Lightweight Ubuntu VMs
Multipass is Canonical’s tool for orchestrating virtual Ubuntu instances. It uses native hypervisors (Hyper-V on Windows, HyperKit on macOS, KVM on Linux) to launch Ubuntu VMs in seconds.
Key characteristics:
- Focused exclusively on Ubuntu — clean, opinionated, Ubuntu-first
- Native hypervisor integration — no VirtualBox dependency
- Cloud-init support for instance configuration
- Automatic image updates (LTS releases)
- Simple CLI:
multipass launch,multipass shell,multipass stop - Designed for developers who need quick Ubuntu environments
Multipass Deployment
Multipass runs natively on the host and manages VMs directly — it is not containerized:
| |
Cloud-init configuration (dev-env-config.yaml):
| |
| |
Comparison: Packer vs Vagrant vs Multipass
| Feature | Packer | Vagrant | Multipass |
|---|---|---|---|
| Stars | 15,667 | 27,121 | 9,068 |
| Language | Go | Ruby | C++ |
| Primary purpose | Build machine images | Provision dev VMs | Launch Ubuntu VMs |
| Output | Images (AMI, VMDK, Docker) | Running VMs | Running VMs |
| Providers | 30+ (cloud, local, container) | 10+ (VirtualBox, Docker, etc.) | Native hypervisors only |
| OS support | Any (depends on builder) | Any (depends on box) | Ubuntu only |
| Provisioning | Shell, Ansible, Chef, Puppet | Shell, Ansible, Chef, Puppet | Cloud-init, shell |
| Reproducibility | Image-level (immutable) | VM-level (rebuildable) | VM-level (rebuildable) |
| CI/CD integration | Excellent (build artifacts) | Good (vm-based testing) | Moderate (Ubuntu-specific) |
| Docker integration | Docker builder + images | Docker provider | Not Docker-native |
| Best use case | Golden image creation | Team dev environments | Quick Ubuntu VMs |
Combining Packer + Vagrant: The Complete Workflow
The most powerful approach combines both tools:
- Packer builds a golden VM image with all base dependencies installed
- Vagrant provisions development VMs from that image, adding project-specific configuration
- Every developer gets an identical base environment with customized project setup
| |
Why Self-Host Your Dev Environment Tooling?
Cloud-based development environments (GitHub Codespaces, GitPod, AWS Cloud9) are convenient but come with recurring per-developer costs, vendor lock-in, and data residency concerns. Self-hosted environment tooling gives you:
Complete control — define exactly which packages, versions, and configurations every developer uses. No platform restrictions on which OS versions or tools are available. Customize images for your specific tech stack without waiting for platform support.
Cost efficiency — running VMs on your own hardware or bare-metal cloud instances costs significantly less than per-developer-per-hour cloud IDE pricing. A single workstation running libvirt can host 10+ development VMs for the cost of one Cloud9 instance.
Offline capability — development VMs run locally, requiring no internet connection. Cloud IDEs require constant connectivity and are vulnerable to platform outages. For teams in areas with unreliable internet or strict network policies, local VMs are essential.
Security and compliance — sensitive code and data never leave your infrastructure. Cloud IDEs may cache content on platform servers, creating compliance risks for regulated industries. Self-hosted environments keep everything within your network perimeter.
For bare-metal provisioning alternatives, see our MAAS vs Cobbler vs Tinkerbell guide. For container-based development, check our container runtime comparison. For server bootstrapping, see our cloud-init vs Ignition vs Butane guide.
FAQ
Can I use Packer to build images for local VMs?
Yes. Packer supports VirtualBox, VMware, and QEMU builders that produce images you can run locally. You can also use the Docker builder to create container images that serve as development environments. The same HCL configuration can produce images for AWS, Azure, GCP, and local hypervisors simultaneously.
Is Vagrant still relevant in the Docker era?
Yes. Vagrant provides full OS-level isolation that containers cannot match. Some software requires kernel modules, specific filesystems, or hardware access that Docker containers cannot provide. Vagrant also works with any OS (not just Linux), making it essential for cross-platform development teams.
Can Multipass run non-Ubuntu operating systems?
No. Multipass is designed exclusively for Ubuntu VMs. If you need Fedora, Debian, or Arch Linux VMs, use Vagrant with the appropriate box images. Multipass’s Ubuntu-only focus is both a strength (clean, opinionated, well-integrated) and a limitation.
How do Packer and Vagrant work together?
Packer builds machine images (the “what”), and Vagrant provisions VMs from those images (the “how”). Use Packer to create a golden image with base dependencies, then use Vagrant to spin up development VMs from that image with project-specific provisioning. This separation of concerns makes environments both reproducible and customizable.
What is the OpenBao fork of Packer?
After HashiCorp changed their license from MPL 2.0 to BSL in 2023, the OpenBao community was formed to maintain an open-source fork of HashiCorp’s tools. The Packer fork continues under the same CLI and HCL configuration format. For most users, the transition is seamless — the commands and configuration files remain compatible.
Can I share Vagrant environments with my team?
Yes. Commit the Vagrantfile to your repository. Every team member runs vagrant up to get an identical environment. You can also create custom Vagrant boxes with Packer and distribute them via a private box server or Vagrant Cloud.
Choosing the Right Dev Environment Tool
Choose Packer if: You need to build machine images for multiple platforms (cloud, local, container) from a single configuration. You want immutable infrastructure with reproducible image builds in CI/CD pipelines.
Choose Vagrant if: You need full-featured development VM management with multi-provider support, shared folders, networking, and team environment reproducibility. You work across multiple operating systems and need consistent dev environments.
Choose Multipass if: You primarily need quick Ubuntu VMs for development, testing, or learning. You want a simple, zero-configuration experience with native hypervisor integration and no VirtualBox dependency.
Choose Packer + Vagrant if: You want the complete solution — Packer builds your golden images with all base dependencies, and Vagrant provisions developer VMs from those images with project-specific customization. This is the most robust approach for teams of 5+ developers.