Skip to content

Latest commit

 

History

History
132 lines (87 loc) · 2.65 KB

README.md

File metadata and controls

132 lines (87 loc) · 2.65 KB

Vagrant multi-machine environment

Config file driven multi-machine environment with NAT network and static IP addresses. Uses Hyper-V on Windows, Libvirt on Ubuntu and VirtualBox on MacOS.

Based on the original work found here and here.

Requirements

Windows

MacOS

  • Virtualbox: brew install virtualbox
  • Vagrant: brew install vagrant
  • Vagrant Manager: brew install vagrant-manager

Ubuntu

Other Linux distros should work but are untested.

Installation

git clone --depth=1 https://github.com/hitachienergy/vagrant-multi-vm-env.git

Usage

  1. Open command prompt as administrator

  2. Go to project's directory

    Windows (Hyper-V):

    cd vagrant-multi-vm-env/hyperv

    Ubuntu (Libvirt):

    cd vagrant-multi-vm-env/libvirt

    MacOS (VirtualBox):

    cd vagrant-multi-vm-env/virtualbox
  3. Edit config.yml file

  4. Run Vagrant

    • Create environment

      vagrant up
    • Stop environment

      vagrant halt
    • Destroy environment (append -f to destroy without confirmation)

      vagrant destroy
    • Create snapshot of entire environment

      vagrant snapshot save <snapshot-name>
    • Create snapshot of single machine

      vagrant snapshot save <vm-name> <snapshot-name>
    • Restore environment from snapshot

      vagrant snapshot restore <snapshot-name>
    • List snapshots

      vagrant snapshot list
    • Remove snapshot

      vagrant snapshot delete <snapshot-name>
  5. Connect to VM

    • Using SSH client

      ssh vagrant@<vm-ip>
    • Using Vagrant

      vagrant ssh [options] [name|id] [-- extra ssh args]

Supported boxes

This project was tested with the following boxes:

  • almalinux/8
  • centos/7
  • generic/rhel7
  • generic/rhel8
  • generic/rocky8
  • generic/ubuntu1804
  • generic/ubuntu2004