Virtualization & Containerization Fundamentals

25 minLesson 2 of 5

Learning Objectives

  • Explain what virtualization is and why it exists
  • Differentiate between Type 1 and Type 2 hypervisors
  • Compare virtual machines and containers
  • Understand Docker's role as a Vagrant provider

Why Virtualization?

In traditional IT, companies run one application per physical server. The problem? Most servers use only 10-15% of their capacity — the rest sits idle, waiting for peak loads.

Virtualization solves this by running multiple virtual servers on a single physical machine, dramatically improving resource utilization.

What is Virtualization?

Virtualization creates multiple simulated computing environments from a single physical hardware system. A software layer called a hypervisor divides the physical resources (CPU, RAM, storage) among isolated virtual machines.

How It Works

┌──────────────────────────────────────────┐
│            Physical Hardware              │
├──────────────────────────────────────────┤
│              Hypervisor                   │
├────────────┬────────────┬────────────────┤
│    VM 1    │    VM 2    │     VM 3       │
│  ┌──────┐  │  ┌──────┐  │  ┌──────────┐  │
│  │ App  │  │  │ App  │  │  │   App    │  │
│  │ Libs │  │  │ Libs │  │  │   Libs   │  │
│  │Guest │  │  │Guest │  │  │  Guest   │  │
│  │  OS  │  │  │  OS  │  │  │   OS     │  │
│  └──────┘  │  └──────┘  │  └──────────┘  │
└────────────┴────────────┴────────────────┘

Each VM gets its own:

  • Operating system
  • Allocated CPU cores
  • Dedicated memory
  • Virtual storage
  • Network interfaces

Hypervisor Types

Type 1 — Bare Metal

Runs directly on hardware, replacing the host OS. Used in production data centers.

HypervisorVendorUse Case
VMware ESXiVMwareEnterprise
Hyper-VMicrosoftWindows environments
Proxmox VEOpen sourceHome labs, SMBs
KVMLinux kernelCloud providers
XenOpen sourceAWS (historically)

Type 2 — Hosted

Runs as an application on top of a host OS. Used for development and testing.

HypervisorPlatformUse Case
VirtualBoxCross-platformLearning, dev
VMware WorkstationWindows/LinuxDevelopment
VMware FusionmacOSDevelopment
ParallelsmacOSRunning Windows

For DevOps learning, Type 2 hypervisors and containers are most relevant.

Forms of Virtualization

TypeWhat It Does
ServerMultiple VMs on one physical server
DesktopRemote desktop environments
NetworkVirtual switches, routers, firewalls
StoragePool multiple disks into one logical unit
ApplicationRun apps in isolated environments

Containers: A Lighter Alternative

Containers share the host OS kernel instead of running a full guest OS. This makes them:

  • Faster to start (seconds vs minutes)
  • Lighter on resources (MBs vs GBs)
  • More portable across environments
  • Easier to scale

VMs vs Containers

┌─── Virtual Machines ───┐    ┌──── Containers ────────┐
│                        │    │                        │
│  ┌────┐ ┌────┐ ┌────┐ │    │  ┌────┐ ┌────┐ ┌────┐ │
│  │App │ │App │ │App │ │    │  │App │ │App │ │App │ │
│  │Libs│ │Libs│ │Libs│ │    │  │Libs│ │Libs│ │Libs│ │
│  │ OS │ │ OS │ │ OS │ │    │  └────┘ └────┘ └────┘ │
│  └────┘ └────┘ └────┘ │    │  ┌────────────────────┐ │
│  ┌────────────────────┐ │    │  │  Container Engine  │ │
│  │    Hypervisor      │ │    │  └────────────────────┘ │
│  └────────────────────┘ │    │  ┌────────────────────┐ │
│  ┌────────────────────┐ │    │  │     Host OS        │ │
│  │     Host OS        │ │    │  └────────────────────┘ │
│  └────────────────────┘ │    │  ┌────────────────────┐ │
│  ┌────────────────────┐ │    │  │    Hardware        │ │
│  │    Hardware        │ │    │  └────────────────────┘ │
│  └────────────────────┘ │    └────────────────────────┘
└────────────────────────┘
FeatureVirtual MachinesContainers
Startup timeMinutesSeconds
SizeGBsMBs
IsolationFull (separate OS)Process-level
PerformanceNear-nativeNative
Resource usageHeavyLight
Use caseFull OS neededMicroservices

Docker: Our Vagrant Provider

Docker is the most popular container platform. It packages applications with their dependencies into standardized units called containers.

In this course, we use Docker as Vagrant's provider because:

  1. Speed — Containers start in seconds
  2. Efficiency — Uses fewer resources than VMs
  3. Relevance — Docker is essential for modern DevOps
  4. Simplicity — Easy to clean up and recreate

Docker Images

A Docker image is a read-only template containing:

  • Application code
  • Runtime libraries
  • System tools
  • Configuration files

When you run an image, it becomes a container — a live, running instance.

How Vagrant Uses Docker

Vagrantfile → Vagrant → Docker Engine → Container(s)

Vagrant reads your Vagrantfile, communicates with Docker, and creates containers according to your specifications. You get the simplicity of Vagrant's interface with the speed of Docker containers.

Benefits of Virtualization for DevOps

  • Cost reduction — Fewer physical servers needed
  • Faster provisioning — Spin up environments in minutes
  • Better testing — Isolated environments for each project
  • Disaster recovery — Snapshots and easy restoration
  • Resource optimization — Use hardware to its full potential
  • Environment consistency — Dev matches production

Summary

  • Virtualization runs multiple isolated environments on one physical machine
  • Type 1 hypervisors run on bare metal (production)
  • Type 2 hypervisors run on a host OS (development)
  • Containers are lighter than VMs — they share the host kernel
  • Docker is our Vagrant provider — fast, efficient, and industry-standard
  • Vagrant orchestrates Docker to create reproducible environments

Next Steps

Now that you understand the underlying technology, let's get hands-on. In the next lesson, we'll install Docker and Vagrant, then create our first environment.