Virtualization and containerization are modern technologies used to run applications in isolated environments. A Virtual Machine (VM) emulates a complete physical system and runs its own operating system using a hypervisor. In this experiment, Ubuntu is installed as a VM using VirtualBox and Vagrant. VMs provide strong isolation but consume more system resources and have slower startup times due to the presence of a full guest OS.
Containers, on the other hand, are lightweight and share the host operating system’s kernel. Using Docker inside WSL, an Ubuntu-based Nginx container is deployed. Containers start faster, use fewer resources, and are highly portable, making them suitable for modern cloud and microservices-based applications.
Ubuntu is used as the base operating system in both environments for consistency, while Nginx is deployed as the web server due to its high performance and low resource usage. By deploying Nginx on both a VM and a container, this experiment compares resource utilization, performance, and operational characteristics of virtual machines and containers.
Download and install Oracle VirtualBox and vagrant.

Install ubuntu

Run vagrant up to create and boot the Ubuntu virtual machine.

Use vagrant ssh to log into the Ubuntu VM.


Use vagrant haltand vagrant destroy to stop and destroy the VM.


Install and configure WSL to run Linux environment on Windows.

Install Docker Engine inside the WSL Ubuntu environment.

Check Docker version and status to confirm successful installation.

Install and run Nginx inside the Docker container.

Observe startup time, memory usage, CPU consumption, and overall performance.

Ubuntu-based Nginx web server was successfully deployed on both Virtual Machine and Docker Container. The experiment demonstrated that containers are more lightweight and faster, while virtual machines provide stronger isolation with higher resource usage.
This experiment highlights the key differences between Virtual Machines and Containers in terms of architecture, performance, and resource utilization, helping understand their appropriate use cases in modern computing environments.