Skip to content

About

Vagrantfiles for specific projects and also generic templates

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Description

This repo is just a collection of template and project specific Vagrantfiles that I created as a way to learn Vagrant and more quickly stand-up development VMs for working on other projects. I'm not looking to start a huge project, but I thought others might get use from them.

I made some design choices that others might find questionable. For example, I deliberately skipped taking advantage of the File Provisioner in some places in favor of making completely self contained Vagrantfiles. For the project-specific ones, I don't do a fresh clone of the project but rather attach a pre-existing clone to /vagrant (That said, the script used to set-up the project is copied to the VM so you can always clone fresh and re-run the script). And possibly most obviously, I'm doing a ton in shell provisioners which would be better suited for a configuration management tool like Ansible, which I know pretty intimately even. I'm just seeing how far I can push the monolithic Vagrantfile without additional tools required.

So, while I'm definitely open to feedback and PRs (particularly for security issues), you will probably find it best to just fork/copy/mod what suits your fancy.

Happy Virtualizing, H Dub


Requirements

Install:

Important

If you are an Ansible user, both of these can be installed in one shot using my install_virtualization_tools.yml playbook over in my ansible-collection-infrastructure repo.


General Usage

Below is the general usage steps for these files. More specific instructions are included with each Vagrantfile.

  1. For project-specific VMs, copy or symlink the desired Vagrantfile to the top level of the project you want to use it with (for example, copy or symlink it where you cloned the podman project for the podman VM).

  2. Update customizeable settings, if desired:

    a. For templates, like the Kali VM, copy the defaults.yml file to overrides.yml, and update the desired values.

    b. For project-specific VMs, you shouldn't need to do anything, but if you really need to, update the desired variables in the block at the top of the Vagrantfile.

  3. Run vagrant up in the directory containing the Vagrantfile.


Available files

Templates

All Templates are customizeable with an overrides file/dir, or a few variables at the top of their respective Vagrantfiles. Click on the Template name for a more detailed README.

Template Version Why Use Description
claude 2.0 Use to develop with the Claude Code CLI in an isolated VM. This is my go-to development VM. Using bento/ubuntu-24.04:
  • update the system and install specified apt packages
  • clone specified git repos to specified directory
  • install and setup pyenv, the specified version of Python (and set as global), and the specified pip packages
  • build and install podman, pasta, conmon, and podman-compose from source at the specified (or latest released) versions, enable the rootless podman socket, and symlink it to /var/run/docker.sock
  • install nvm and the specified Node version, plus bun globally via npm
  • build and install act with a patch to fix nested workflows, and seed ~/.config/act/actrc to use the podman socket
  • install the pinned version of the Claude Code CLI with SHA256 verification against the upstream release manifest, and alias claude with hardening flags (DO_NOT_TRACK, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, CLAUDE_CODE_DISABLE_MOUSE_CLICKS, IS_DEMO)
  • seed opinionated ~/.claude/CLAUDE.md, ~/.claude/settings.json, and ~/.claude/memory/*.md (overrideable), guarded so re-provisioning never clobbers in-VM edits
kali 4.0 General hackery Using kalilinux/rolling:
  • set specified VM name, hostname, shared folder, and bridged adapter
  • Pull kali keyring, fix grub-pc install disk, run apt update and upgrade, install specified apt packages
  • Set preferred shell
  • install and setup pyenv, the specified version of Python (and set as global), and the specified pip packages
  • checkout the specified git repos to the specified dir
  • pipx install the specified projects
  • curl|bash install specified URLs
  • download and extract specified tarballs and zips, as well as install debs, with optional checksum verification on the downloads
  • copy in some desktop shortcuts
  • execute a custom script on provision, which by default installs Java and maven with sdkman in order to compile cfr
python 1.0 Copy and use in a Python based project Using debian/bookworm64:
  • update the system
  • install specified apt_packages as well as optional Python module dependencies
  • install and setup pyenv for the vagrant user
  • install the specified version of Python and set it for the local project
  • create a venv for the project with the specified python_version if it doesn't exist and execute the project setup script specified by the user

Project Specific

Project specific VMs are meant to correspond to Github projects which don't already have a Vagrantfile.

Project Vagrantfile Version Template

Contributing

I can't imagine anyone would be interested in this, but I'm in the process of adding some linting pre-commit hooks, and would ask that new changes pass. To have them automatically run, execute:

# from anywhere in the project
git config core.hooksPath "$( git rev-parse --git-dir )"/.githooks

Important

The commitlint hook requires either podman or npx (Node) to be available. Dealer's choice. If you have docker, you should be able to just alias podman=docker and it should work. (lmk ha).

About

Vagrantfiles for specific projects and also generic templates

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages