💾 Virtualization & Home Lab Setup

Virtualization & Home Lab Setup

Build your own lab environment from VirtualBox fundamentals to Proxmox enterprise-grade virtualization.

Learning Objectives

Module 1: What Is Virtualization?

~2 hours

Lesson 1.1: Hypervisor Types

Type 1 (bare-metal) vs Type 2 (hosted) hypervisors — when to use each.

  • Type 1: VMware ESXi, Proxmox VE, Hyper-V Server, KVM — runs directly on hardware
  • Type 2: VirtualBox, VMware Workstation, Parallels — runs on top of a host OS
  • When to choose hosted vs bare-metal for learning vs production

Lesson 1.2: Core Virtualization Concepts

Virtual CPUs, memory allocation, virtual disks, and guest additions/drivers.

  • PV (paravirtualized) vs HVM (hardware virtualized) mode
  • VT-x / AMD-V enabling in BIOS — why it matters
  • Guest Additions / Open Guest Tools for integrated graphics and clipboard

Real-World Scenario

You're asked to recommend a virtualization solution for a small startup that needs 5 development servers. They have one 16GB RAM laptop. Which approach makes sense and why?

Module 2: VirtualBox Setup & Navigation

~2 hours

Lesson 2.1: Installation & First Run

Installing VirtualBox, Extension Pack, and configuring host settings.

  • Download from virtualbox.org — avoid bundled adware
  • Extension Pack for USB 2.0/3.0 and RDP support
  • VM resource limits per VM in Global Preferences

Lesson 2.2: Manager Interface Walkthrough

Settings tabs: System, Processor, Display, Storage, Network, USB explained.

  • BIOS vs UEFI boot order
  • Chipset selection: ICH9 vs PIIX3
  • Storage controllers: IDE vs SATA vs NVMe
  • Controller type impact on guest OS performance

Hands-On Lab: VirtualBox Foundation

  1. Install VirtualBox 7.x on your host machine
  2. Install the matching Extension Pack
  3. Create a new VM named "Lab-VM-01" with 4GB RAM and 2 vCPUs
  4. Attach a blank VDI hard disk of 20GB
  5. Mount an Ubuntu 22.04 ISO and boot to the live environment

Module 3: Creating & Configuring VMs

~3 hours

Lesson 3.1: Choosing the Right Template

Selecting OS type/version and setting baseline VM parameters.

  • Linux vs Windows guest optimization
  • RAM minimums: 512MB (server headless) to 4GB+ (desktop)
  • Storage format choices: VDI (native), VMDK (VMware compat), qcow2 (KVM compat)

Lesson 3.2: Performance Tuning

Enabling 3D acceleration, adjusting video memory, and snapshot strategies.

  • Video memory: minimum 16MB, recommended 128MB for desktop
  • 3D acceleration needed for graphical desktops, disable for servers
  • Enable IO APIC for multi-CPU guests

Project Assignment

Build a standardized "base VM template" with: 2 vCPUs, 2GB RAM, 20GB dynamic VDI, Ubuntu Server 22.04 minimal install, OpenSSH server enabled, updates applied, Guest Additions installed. Save this as your starting point for all future labs.

Hands-On Lab: Build Your Base Template

  1. Create a new VM using the template specs above
  2. Install Ubuntu Server from the official ISO
  3. After install: install sudo, create a non-root user, configure SSH
  4. Install VirtualBox Guest Additions (or open-vm-tools for Linux)
  5. Take your first snapshot named "Clean Install"

Real-World Scenario

Your organization wants to standardize on a golden image. A VM image was created on a Windows 10 host but needs to run on a Hyper-V cluster. What conversion steps are required and what pitfalls should you watch for?

Module 4: Snapshots & Cloning

~2.5 hours

Lesson 4.1: Snapshot Strategy

When to snapshot, naming conventions, and understanding snapshot chains.

  • Snapshot = delta disk + saved state, NOT a full clone
  • Too many snapshots degrade performance significantly
  • Best practice: snapshot before any risky operation

Lesson 4.2: Full Clone vs Linked Clone

Independent copies vs shared-base dependent clones.

  • Full clone: independent, takes same disk space
  • Linked clone: shares base disk, saves space, depends on parent
  • Deleting parent VM breaks linked clones
$ VBoxManage snapshot "Ubuntu-Base" take "Before Upgrade" $ VBoxManage snapshot "Ubuntu-Base" list $ VBoxManage clonevm "Ubuntu-Base" --name "Dev-VM-01" --mode link $ VBoxManage clonevm "Ubuntu-Base" --name "Prod-VM-01" --mode full $ VBoxManage snapshot "Ubuntu-Base" rollback "Before Upgrade"

Hands-On Lab: Snapshot Operations

  1. Take a snapshot of your base VM called "Pre-Malware-Test"
  2. Intentionally break something (install a bad package, corrupt a config)
  3. Roll back to the snapshot and verify restoration
  4. Create a linked clone named "Test-Clone-A" from your base
  5. Create a full clone named "Test-Clone-B" and modify independently
  6. Delete the snapshots and verify both clones still work

Knowledge Check

Q: Can you roll back to a snapshot taken from a VM that has been deleted? A: No — snapshots are tied to the VM's UUID; deleting the VM destroys its snapshot chain.

Q: What is the safest way to create a disposable test environment? A: Use a linked clone from a clean snapshot so you can revert without affecting the base image.

Module 5: Networking — NAT, Host-Only, Bridged

~3 hours

Lesson 5.1: NAT Networking

Default outbound connectivity, port forwarding rules, and limitations.

  • VM shares host IP — no inbound connections unless forwarded
  • Port forwarding: host:port -> VM:port via VirtualBox GUI or VBoxManage
  • Ideal for: Internet access only, isolated testing

Lesson 5.2: Host-Only & Bridged Networks

Internal VM communication and physical LAN integration.

  • Host-Only: VMs talk to host and each other only — no internet
  • Bridged: VM gets its own IP from physical router — appears as real device
  • Virtual Switches for advanced multi-NIC setups
$ VBoxManage modifyvm "Lab-VM-01" --nic1 bridged --bridgeadapter1 "Wi-Fi" $ VBoxManage modifyvm "Lab-VM-01" --natpf1 "ssh,tcp,,2222,,22" $ VBoxManage hostonlyif create # create host-only adapter $ VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1

Hands-On Lab: Multi-VM Network Topology

  1. Create two VMs: "Web-Server" and "DB-Server"
  2. Put them on a Host-Only network — verify they can ping each other but not the internet
  3. Add a second NIC to Web-Server set to NAT for internet access
  4. Configure port forwarding so host can reach Web-Server's HTTP on port 8080
  5. Verify Web-Server can serve pages to the host browser via the forwarded port

Real-World Scenario

You need to simulate a three-tier web app (web, app, db) where each tier is isolated from the internet but can communicate internally. Design the VirtualBox network topology and implement it.

Module 6: Installing Guest Operating Systems

~3 hours

Lesson 6.1: Installing Linux Guests

Ubuntu Server, Debian, Alpine — minimal installs for server labs.

  • Minimal iso downloads and text-only installation workflows
  • Setting up SSH after install for headless management
  • Common packages to pre-install: curl, git, wget, vim, net-tools

Lesson 6.2: Installing Windows Guests

Windows 10/11 evaluation images, activation considerations, and driver integration.

  • Evaluation center ISOs for legal training purposes
  • Guest Additions vs VirtualPC Integration Components
  • Windows Update within the VM may slow down provisioning

Hands-On Lab: Dual-Guest Deployment

  1. Install Ubuntu Server 22.04 as a headless VM (no GUI, SSH only)
  2. Install Windows 10 Evaluation Edition with desktop experience
  3. Install Guest Additions on both — verify shared clipboard works
  4. From Windows, SSH into Ubuntu using PuTTY or built-in OpenSSH client
  5. From Ubuntu, ping the Windows VM's IP address and vice versa

Module 7: Introduction to Proxmox VE

~3 hours

Lesson 7.1: What Is Proxmox?

KVM-based virtualization meets LXC containers — unified management platform.

  • Based on Debian Linux with custom kernel optimizations
  • KVM for full VMs, LXC for lightweight containers
  • Web-based management portal at https://<ip>:8006
  • Cluster support, ZFS storage backend, HA out of the box

Lesson 7.2: First Boot & Initial Configuration

Setting up storage pools, networks, and user accounts.

  • ZFS vs LVM vs directory-based storage — when to use each
  • vmbr0 bridge creation for VM/container networking
  • Subscription notice dismissal and repository configuration
$ ssh root@proxmox-host $ pveversion -v # verify Proxmox version $ pct create 100 local:vztmpl/ubuntu-22.04-default.tar.gz $ qm create 100 --name Win10-Lab --memory 4096 $ qm importdisk 100 win10.iso local-zfs $ qm set 100 --sata0 local-zfs:vm-100-disk-0

Hands-On Lab: Deploy Your First Proxmox Node

  1. Download the Proxmox VE ISO and install on a spare machine or VM (needs bare metal or nested virt enabled)
  2. Access the web GUI and explore the dashboard
  3. Create a CT (LXC container) running Debian 12
  4. Create a KVM VM with 2 vCPUs and 4GB RAM running Ubuntu Server
  5. Snapshot the VM, make a change, roll back — mirroring VirtualBox workflow

Real-World Scenario

Your company wants to migrate from VirtualBox to a clustered Proxmox setup. Draft a high-level migration plan covering downtime windows, data export/import strategy, and network reconfiguration.

Module 8: Building a Home Lab

~3.5 hours

Lesson 8.1: Hardware Requirements

Minimum specs, recommended builds, and repurposing old hardware.

  • Minimum: 16GB RAM, 4 CPU cores, 256GB SSD for a modest lab
  • Recommended: 64GB+ RAM, 8+ cores, dual 1GbE NICs, NAS storage
  • Old laptops: use as homelab nodes with USB-to-Ethernet adapters

Lesson 8.2: Recommended Lab Architecture

Networking design, VLANs, and typical service stack for learning.

  • Physical switch or managed switch for VLAN tagging
  • Core services: Pi-hole (DNS sinkhole), NGINX proxy, Ansible controller
  • Monitoring: Prometheus + Grafana stack
  • Git repository: Gitea or GitLab CE

Capstone Project: Build a Functional Home Lab

Design and build a mini infrastructure with at least these components:

  1. A proxmox or VirtualBox host running 3 VMs
  2. One VM as a web server (NGINX/Apache)
  3. One VM as a DNS/DHCP server (Pi-hole or BIND)
  4. One VM as a file server (Samba/NFS)
  5. All VMs communicating over a private network segment
  6. Document your topology with a simple diagram

Hands-On Lab: Build the Lab

  1. Choose your hypervisor: VirtualBox (simpler) or Proxmox (more realistic)
  2. Deploy 3 Linux VMs with static IPs on an internal network
  3. Install and configure NGINX on VM-1, verify from VM-2 and VM-3
  4. Set up Samba sharing on VM-2 accessible from VM-3
  5. Configure a Pi-hole DNS resolver on VM-3
  6. Take snapshots of each at key milestones

Module 9: Automation with Scripts

~2.5 hours

Lesson 9.1: VirtualBox CLI Automation

VBoxManage command-line tool for unattended VM creation and management.

  • vboxmanage createvm, registervm, startvm commands
  • Automated snapshot management with date stamps
  • Batch operations on multiple VMs via shell loops

Lesson 9.2: Packer & Ansible for Infrastructure-as-Code

Building reproducible VM images with Packer, configuring with Ansible playbooks.

  • Packer templates for VirtualBox and Proxmox builders
  • Ansible provisioner to bake in software at image build time
  • Version-controlling your golden images
#!/bin/bash # auto-create-vm.sh — Creates a standard dev VM NAME="$1" RAM="${2:-2048}" CPU="${3:-2}" DISK="${4:-20}" VBoxManage createvm --name "$NAME" --register VBoxManage modifyvm "$NAME" --memory "$RAM" --cpus "$CPU" \ --ioapic on --graphicscontroller vmsvga --videoram 128 \ --nic1 nat --audio none --usb off VBoxManage createmedium disk --filename "$NAME.vdi" --size ${DISK}000 VBoxManage modifyvm "$NAME" --harddisk "$NAME.vdi" echo "VM '$NAME' created with $CPU cores, ${RAM}MB RAM, ${DISK}GB disk"

Hands-On Lab: Scripted VM Creation

  1. Write a bash script that accepts name, RAM, CPU args and creates a VM
  2. Extend the script to also create and attach a network adapter on host-only mode
  3. Create a second script that takes snapshots of all running VMs with timestamps
  4. Write an Ansible playbook targeting your Ubuntu VMs that installs Docker and nginx
  5. Run the playbook against all lab VMs simultaneously

Real-World Scenario

Your team needs 10 identical test VMs spun up weekly for QA. Each needs the same OS version, Docker, and a monitoring agent. Draft an automated pipeline using scripts that provisions all 10 in under 30 minutes total.

Progress: 0%