Initial creation of the VM
Instructions:
- Download the latest Centos 7 Minimal ISO from https://www.centos.org/download/
- Open VirtualBox and create a new Virtual Machine (VM) by clicking the New button.
- Give the VM a representative name, such as ‘AnsibleControlNode’. Change the type to ‘Linux’, and the Version to ‘Red Hat (64-bit). Click Next.
- Depending on the VM usage, update the value or accept the default ‘Memory size’ and click Next.
- Accept the default ‘Hard Disk’ and click Next.
- Accept the default ‘Hard disk file type’ and click Next.
- Set the ‘Storage on physical hard disk’ to an appropriate level for your use case - click Next.
- Depending on the VM usage, update the value or accept the default ‘File location and size’ and click Create.
- Right click on the new VM in VirtualBox. Select Settings > System > Motherboard. Change the pointing device to USB Tablet. Click OK
- Right click on the new VM in VirtualBox. Select Settings > Storage. Select the empty disk drive under the IDE Controller. Under Attributes, click the small CD image, then ‘Choose Virtual Optical Disk File’. Locate the CentOs 7 Minimal ISO. Click Open. Click OK.
- Double click on the new VM in VirtualBox to power it on.
- Select Install CentOs 7 using the cursor keys. Hit Return. After a short pause, you will be presented with a GUI to guide you through the installaton of CentOs.
- Choose your desired language settings and click Continue.
- Select Installation Destination, and accept the defaults by clicking Done.
- Begin the installation in the background by clicking ‘Begin Installation’
- You can now set the root users password by clicking on it. Enter the password twice and click Done.
- As we do not want to be using the root used by default, we will create another administrator account for our use. Click ‘User Creation’. Enter a Full name and User name. I suggest ‘ansible’ for both. Ensure the ‘Make this user administrator’ checkbox is checked. Enter the password twice and then click on Done.
- Wait for the installation to complete, and then click ‘Finish configuration’
- Click the Reboot button, and wait for the VM to restart.
- Login to the VM using the non-root account.
- To connect the VM to your host, we now need to make a change to the VMs network card.
sudo vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
- Edit the ONBOOT line to equal ‘set ONBOOT=yes’. Save the file.
- Or sed -i ‘/ONBOOT/s/no/yes’/ /etc/sysconfig/network-scripts/ifcfg-enp0s3
- Restart the VM using ‘reboot’