Ansible - 2 - 1 Insttallation virtual box

To practise Ansible from scratch we need a small lab on our own machine. The plan is to use VirtualBox, a free virtualisation tool that runs on Windows, Linux and macOS. The exact host OS does not matter — the steps below work identically on any of them. The example uses Windows.

VirtualBox and a CentOS template

Download the VirtualBox installer from virtualbox.org, run the executable and follow the installation wizard. Once VirtualBox is open we need a Linux machine to clone. Instead of installing CentOS from an ISO, we grab a ready-to-use disk image from osboxes.org: head to VM Images > VirtualBox Images, pick the CentOS 64-bit build and extract the resulting .vdi file with 7-Zip or WinRAR.

  • Create a new VM in VirtualBox, name it centos-template, type Linux and version Other Linux (64-bit).
  • Allocate 2 GB of RAM and select Use an existing virtual hard disk file, pointing to the extracted .vdi.
  • Before booting, raise the video memory to 16 MB and change the network adapter to Bridged.

Power on the VM, log in as user osboxes with the default password (visible on the osboxes.org info page), and run ifconfig to read the IP address allocated by DHCP. From your host, connect to the VM using an SSH client such as MobaXterm: a new SSH session, the IP we just read, username osboxes, password from osboxes, and we land on a shell. Once we can SSH in successfully we shut the template down — it is now ready to be cloned into the multiple VMs we will need in the upcoming lessons.