vagrant

Vagrant development environments with VMs. Use for dev environments.

7 stars

Best use case

vagrant is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Vagrant development environments with VMs. Use for dev environments.

Teams using vagrant should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/vagrant/SKILL.md --create-dirs "https://raw.githubusercontent.com/G1Joshi/Agent-Skills/main/skills/devops/vagrant/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/vagrant/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How vagrant Compares

Feature / AgentvagrantStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Vagrant development environments with VMs. Use for dev environments.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Vagrant

Vagrant provides reproducible, portable development environments using Virtual Machines (VirtualBox, VMWare, Hyper-V).

## When to Use

- **Legacy/Full OS Dev**: You need to simulate a full Linux Kernel or multi-vm network that Docker cannot easily do.
- **Local Testing**: Testing Ansible Playbooks locally on a clean VM.
- **Windows/Mac**: Running Linux VMs on non-Linux hardware with ease.

## Quick Start

```ruby
# Vagrantfile
Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/bionic64"
  config.vm.network "forwarded_port", guest: 80, host: 8080

  config.vm.provision "shell", inline: <<-SHELL
    apt-get update
    apt-get install -y apache2
  SHELL
end
```

`vagrant up` -> `vagrant ssh`

## Core Concepts

### Boxes

Base images. Analogous to Docker Images. (e.g. `ubuntu/trusty64`).

### Providers

The hypervisor backend. VirtualBox (default), VMWare, Hyper-V, Docker, Libvirt.

### Provisioners

Scripts that run on first boot (Shell, Ansible, Chef) to set up the software.

## Best Practices (2025)

**Do**:

- **Use Multi-Machine**: Simulate a network (DB + Web) in one Vagrantfile.
- **Sync Folders**: Edit code in VS Code on Host, run it on Guest VM.
- **Consider Docker**: For most "App Dev" use cases, Docker/DevContainers are preferred in 2025. Use Vagrant for "Infra Dev".

**Don't**:

- **Don't check in `.vagrant/`**: Add it to `.gitignore`.

## References

- [Vagrant Documentation](https://developer.hashicorp.com/vagrant)