Vagrant

Build CentOS 8 vagrant box from scratch in Windows

We need to install VirtualBox and Vagrant in Windows and download the DVD ISO image of CentOS 8 to be able to build CentOS 8 vagrant box. It is recomended to use Chocolatey (a software management automation for Windows) to install these software. To install Chocolatey, follow the procedure here.

Steps:

  1. Install VirtualBox by executing the following command from the command line or from PowerShell:

Alternative way to get Linux image for Vagrant

Vagrant box downloads are extremely slow and there are no other trusted sources (links, torrents, magnets) available. But there's an alternative way to download your Linux image from faster source and use it with your Vagrant. Instead of downloading the Vagrant box, download the Oracle Virtualbox "ova" image file then convert it to Vagrant box image.

Steps:

  1. Download the Oracle Virtualbox "ova" Linux image file. In this article, CentOS 8 "ova" Linux image file downloaded from https://www.linuxvmimages.com/images/centos-8 will be used as an example.

How to route external domain to router website hosted in local virtualbox web server (Windows as host OS and CentOS 7 as guest OS)

There are test scenarios that requires a development site hosted in local web server accessible via live external domain. In this article, will show how to make a development site hosted in local virtualbox web server (Windows as host OS and CentOS 7 as guest OS). Note: make sure you have full administrator access to your router and the router's WAN IP is a public IP address.

Steps:

  1. Open and configure your Vagrantfile. Add the following lines:

How to save/remove existing Vagrant box and restore the saved vagrant box

We know that Vagrant is a tool for building complete development environments. It allows us to imitate the setup of a server on our local machine which can be easily reproduced on any system.

This article will show three useful routines for Vagrant: saving an existing Vagrant box setup, removing old/unused Vagrant box and restoring saved vagrant box. It is assumed that you are using Windows as host machine's OS and Cygwin command line interface. Throughout this article, we will be using centos7drupal name for our Vagrant box.