Virtualization

Introduction to Virtualization Virtualization is a technique that allows running multiple operating systems on the same physical machine, sharing resources but functioning as if each one had its own dedicated hardware. This process is possible thanks to a key software layer: the hypervisor.

What is a Hypervisor? A hypervisor (or Virtual Machine Monitor, VMM) is the software responsible for managing virtual machines (VMs). It handles resource allocation, process isolation, and facilitates the simultaneous execution of multiple operating systems.

Types of Virtualization

Type 1 Virtualization: "Bare-metal" This type of hypervisor runs directly on the physical hardware, without an intermediary host operating system. It's common in server environments and data centers due to its performance and efficiency.

Examples:

  • VMware ESXi

  • Microsoft Hyper-V (core mode)

  • Xen

Advantages:

  • Higher performance

  • Better isolation and security

  • Lower overhead

Disadvantages:

  • Requires compatible hardware

  • Less user-friendly for casual users

Type 2 Virtualization: "Hosted" Here the hypervisor is installed within a host operating system. It's ideal for testing environments or users who need to run additional systems on their laptops or PCs.

Examples:

  • VirtualBox

  • VMware Workstation

  • Parallels

Advantages:

  • Easy to install and use

  • Good environment for software testing

Disadvantages:

  • Lower performance due to the additional operating system layer

  • More dependent on host stability

Architecture: Software Layers A layered view helps us understand how virtualization is organized:

  1. Physical Hardware: CPU, RAM, disk, etc.

  2. Hypervisor:

    • Type 1: installs on hardware

    • Type 2: installs within the operating system

  3. Guest Operating System: can be Windows, Linux, etc.

  4. Applications: what runs inside the VM

This modular architecture allows running multiple independent systems in parallel, ideal for testing, development, and security.

Common Use Cases

  • Software development: isolated and reproducible environments

  • Pentesting and ethical hacking: running tools like Kali Linux without affecting the host

  • Network simulation: multiple VMs interacting in virtual networks

  • Server consolidation: reducing physical hardware in data centers

Recommendations for Practice 📚 Try virtualization labs on TryHackMe or Hack The Box ⚙️ Install VirtualBox and set up a VM with Kali Linux 🧪 Simulate an internal network using multiple VMs to practice sniffing, scanning, and exploitation

ISO Files, OVA, and Virtual Disk Types When working with virtual machines, there are several formats and configurations worth understanding. Here I'll explain the key concepts with simple examples.

What is an .iso file? An .iso is a compressed file that contains an exact image (sector by sector) of a file system, commonly from a CD, DVD, or operating system installation.

What is it used for?

  • To install operating systems on physical or virtual machines

  • It's like a "virtual USB drive" with an installer inside

What is an .ova file? An .ova (Open Virtualization Appliance) is a packaged file that contains:

  • Virtual hardware configuration

  • Virtual hard disk (usually .vmdk)

  • Metadata files

It's used to import pre-configured VMs into VirtualBox or VMware.

Virtual disk types When you create a virtual machine, you can use different file types as virtual hard drives:

  • .vmdk → VMware format

  • .vhd → Microsoft Hyper-V format

  • .vhdx → Improved VHD version (more corruption resistant)

  • .qcow2 → Used by KVM (Kernel-based Virtual Machine)

What is KVM? KVM is a Type 1 hypervisor for Linux. It allows the kernel to act as a hypervisor and directly manage VMs. It's widely used in servers and professional environments.

Network Configurations in Virtualization Important parameters:

  • Does the VM have internet access?

  • Can VMs see each other?

  • Can the host machine communicate with the VM?

Types of Network Adapters

NAT (Network Address Translation) ✅ Internet access ❌ VMs can't see each other ❌ Host can't see VMs

Host-only ❌ No internet access ✅ Communication between VM and host ❌ VMs have no internet access

Bridged Adapter ✅ Internet access ✅ Full access to local network ✅ Host can see the VM ✅ VMs can see each other

Tip If copy and paste doesn't work between the virtual machine and host, try installing VirtualBox tools:

sudo apt update
sudo apt install virtualbox-guest-utils
sudo apt install virtualbox-guest-x11

Recommendations

  • For practicing attacks between machines: use Internal Network or Bridged

  • For browsing from the VM: use NAT

  • For configuring services between host and VM: use Host-only

Last updated