Step by Step installation of Linux Virtual Host personal LAB setup using Oracle Virtual-box



Setting up LAB on personal laptop or desktop is very important now days which helps in saving expenses on cloud services and allows self management of resources to test , develop or demo Proof of Concept setup for rapid growing technologies like containerization , no-sql databases , Ansible automation , azure CI / CD pipeline etc.

In this article will demo ...

1. How to Install Oracle Virtual-Box ?

2. How to create virtual machine using guest Operating System images ?

3. How to configure virtual machine to connect from host machine(using port forwarding) ?

4. How to clone the machine from template virtual machine ?





Let's begin ...


We will create MYLAB-TMPL as a first virtual machine and use it for making clone machine named MYLAB-SRV1 , similar to which MYLAB-SRV2...n machine can be created.


1. How to Install Oracle Virtual-Box ?


1.1 Download oracle virtual box setup file from https://www.virtualbox.org/








Click on windows hosts to download file VirtualBox-6.1.14-140239-Win.exe








1.2 Install Virtual Box on windows machine

Right click downloaded file VirtualBox-6.1.14-140239-Win.exe to run as administrator & follow the snapshots
















Virtual Box installation Completed successfully !






2. How to create virtual machine using guest Operating System images ?



2.1 Download Guest Operating system Virtual disk Image *.VDI file from https://www.osboxes.org/



Click on Virtual Box Images






Download Ubuntu Server .. Check info for Username/Password for server login .. which should be osboxes/osboxes.org & unzip the file






2.2 Create First Virtual Machine on Virtual Box

Click on New machine of Oracle VM VirtualBox Manager .. Select appropriate location to store virtual machine , operating system & type .. any linux 64 bit selection would work in case 64 bit is not listed , virtualization need to be enabled from BIOS setting of your desktop/laptop









Supply virtual hard disk image downloaded in step 2.1






Virtual Machine is created successfully !






3. How to configure virtual machine to connect from host machine(using port forwarding) ?


3.1 Configure network adapter


Adapter 1 : attached to "NAT"





click on port forwarding .. add rule as below to forward ssh port 22 traffic on localhost:2222





Adapter 2 : attached to "Bridged Adapter"





3.2 Startup the Virtual Machine 





Startup logs ..






Supply Username/Password as osboxes/osboxes.org






3.3 Check network IP 

Install the net tools in case errors

sudo apt-get install -y net-tools






Note network static IP assigned to bridged network enp0s8

IP can be changed per virtual machine within same VirtualBox.

File can be edited using sudo followed by VM restart to take effect ..







3.4 Connect externally to virtual machine

Download Mobaxterm or Putty to connect localhost 127.0.0.1 port 2222 as configured in 3.1 step ..










3.5 Change hostname


Change virtual machine hostname as per snapshot followed by sudo reboot –f







Verify changes ..





4. How to clone the machine from template virtual machine ?


4.1 Cloning from template virtual machine

Right click on template virtual machine created and select clone








select "linked clone" to use same virtual disk image








4.2 Change hostname and static IP of the cloned machine






4.3 Adapter settings


Change Adapter 1 "NAT" port forwarding host port to forward traffic to localhost port 3333





4.4 Connect externally

connect from host using Mobaxterm on localhost port 3333









Start both the machine and check connectivity








LAB Setup is successfully completed n Number of virtual machine can be cloned from template VM depending on underlying laptop/desktop hardware cpu/memory capacity.. 




Also Read .. 


No comments:

Post a Comment