containerization-and-devops

Lab Experiment 1 – Comparison of Virtual Machines and Containers

Objective

Tools Used


Part A – Virtual Machine Setup

Step 1 – Download VirtualBox

Step1

Step 2 – Install Vagrant

Step2

Step 3 – Initialize Vagrant

vagrant init hashicorp/bionic64

Step3

Step 4 – Start VM

vagrant up

Step4

Step 5 – VM Created

Step5

Step 6 – VM Running

Step6

Step 7 – SSH into VM

vagrant ssh

Step7

Step 8 – Start Nginx in VM

sudo systemctl start nginx

Step8

Step 9 – Verify Nginx

curl localhost

Step9

Step 10 – Virtualization Enabled

Step10


Part B – Docker Container Setup

Step 1 – Open WSL

Step11

Step 2 – Run Docker Nginx

docker run -d -p 8080:80 --name nginx-container nginx

Step12

Step 3 – Verify Container Output

curl localhost:8080

Step13

Step 4 – Monitor using htop

htop

Step14

Step 5 – Check Memory

free -h

Step15

Step 6 – System Analyze

systemd-analyze

Step16

Step 7 – Docker Stats

docker stats

Step17


Result

Successfully compared VM and Container performance.


🔗 Navigation

Previous Home Next
Main README Lab 2 →

All Labs