This Post we will focus on building our lab to practice Sys-Admin Tasks.

There are multiple ways of setting up the lab with different distro’s.

  • Cloud (AWS,GCP etc) Free tier.
  • Hypervisor (virtual box, Vmware etc)
  • Vagrant (which would use an hypervisor but convenient for ready to use boxs)

many more.

I will choose Hypervisor(Virtual Box) with my host OS as Kubuntu.

Download VirtualBox

virtualbox-link

virtualbox-download

select the distribution of your choice and download it.

Install VirtualBox

installation instructions are provided within the docs.

in my case

install-vb

Download Extension Pack

Download the extension from the virtualbox-link

extention-pack

Install Extension Pack

lets install the extension pack

  • click on File on top left corner

  • Prefrences

  • Extensions

add-extension

select-pack

  • it will ask u to install do it

  • scroll and agree the license

  • click OK

we have successfully install extension pack

Download Centos Image

centos-download

select the architecture dependent dvd.iso file

centos-download

Install centos 8

  • click on add New

New

  • Name and Operating System

    • Type Name : desired name

    • Machine Folder: desired location

    • Type: Linux

    • Version : Red Hat (64-bit)

name-and-oprating

  • Memory Size

    around 1024MB

memory-size

  • Create virtual hardisk
    • click on create

virtual-disk

  • Hardisk file type
    • VDI (VirtualBox Disk Image)

vdi

  • Storage on physical hard disk
    • Dynamically allocated

dynamic

  • File location and size
    • leave location as is
    • size : 20 GB

disk-size

You should get something like this

box-overview

Change the name by clicking on Settings icon at the top center Navbar

template

  • and click OK

we will be using this as base template for creating multiple instances in case our vm breaks or all Hell falls upon us we can always create new one from base template.

PS: we could have set the name at the very start but forgot it hence i changed it later

u can also create snapshots to save workstate

Configure Base Template

  • click on settings
    • General
      • advanced
        • clipboard & Drag’n’Drop : Bidirectional

bidirectional

  • Boot Order

boot-order

  • Add DVD Installer

iso

add-iso

select-iso

done

  • Click on Start

click-start

  • Click on install centos 8

install-centos8

It might take some time be patient

language

click continue

timezone

click done

Network

on it and click done

install-disk

root

click done twice if pass simple

user

click done twice

begin

progress

Be patient this might take some time

Restart the box

accpet-license

tick mark and click done

finsih-configuration

  • Login with credentials

Install Guest Editions

open terminal

and follow these steps

su

login as root

dnf install -y epel-release

repo

  • Install Kernel Headers and Build Tools
sudo dnf install -y gcc make perl kernel-devel kernel-headers bzip2 dkms

kernel

rpm -q kernel-devel
uname -r

might face kernel conflict like i do

conflict

To resolve this issue

dnf update kernel-*

type y on prompt

resolve

reboot

reboot now

select the correct kernel during boot

correct

again check kernel info

rpm -q kernel-devel
uname -r

noconflict

mount /dev/cdrom /mnt   

./VBoxLinuxAdditions.run

guest

shudown now

Clone The Base Template

  • right click on the box select clone
    • Full clone

clone

clonning

Start Clone

start-clone

dat