We have been experimenting with some new applications, with the intent of disposing of W them afterwards. Remember, it’s all about disposable but reproducible builds. We wanted something lightweight and completely controlled from the command line. Enter Vagrant.
The beauty of Vagrant is that there are no huge image files to manage. It requires nothing beyond a setup file containing the details needed to set up the disposable VMs, and VirtualBox to provide the underlying virtualisation platform. You could even give someone a copy of the Vagrant file and they could just run it and have the same setup.
To install Vagrant on Ubuntu – other distros and OSes are covered at https://developer.hashicorp.com/vagrant/install – use the following three commands: $ wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorparchive-keyring.gpg $echo “deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main” | sudo tee /etc/apt/sources.list.d/hashicorp.list $sudo apt update && sudo apt install vagrant
After the app is installed (use vagrant -v to report the version number), we need to make the Vagrantfile that contains the definitions to make it how we want it.
Each Vagrantfile needs to exist in a folder and be initialised for Vagrant use. Create a folder called vagrantone in your home directory. Use the command line to navigate into it and use vagrant init to configure the folder. Among other things, it creates a base Vagrantfile. Edit the following line in the Vagrantfile: config.vm.box = “base”
Change it to config.vm.box = “debian/bookworm64” .
All that remains is to create the Vagrantfile and start it. Start it with vagrant up and SSH into it with vagrant ssh default , default being the name given to VMs with no name specified. Other OS choices are available at https://portal.cloud.hashicorp.com/vagrant/discover.
The process of starting up the cluster and its output.