Virtualization Concepts: Hypervisors, VMs, Containers and When to Virtualise
What virtualisation is, how a hypervisor shares hardware, the difference between type 1 and type 2, virtual machines versus containers, hardware assists such as VT-x and SLAT, the real benefits and costs, and how to check that a machine can host virtual machines.
1. The idea in one picture
A physical server runs one operating system and, for most of the day, uses a small share of its CPU. Virtualisation inserts a thin layer, the hypervisor, between the hardware and the operating systems. The hypervisor presents each guest with virtual hardware (virtual CPUs, memory, disks and network cards) and shares the real hardware among them, while keeping them isolated.
Vocabulary you will use all course:
| Term | Meaning |
|---|---|
| Host | The physical machine (and its hypervisor) that runs the VMs |
| Guest | A virtual machine and the operating system inside it |
| vCPU, vRAM | Virtual processors and memory given to a guest |
| Virtual disk | A file or volume that the guest sees as a disk (VHDX, qcow2, VMDK, raw) |
| Virtual switch | A software switch that connects vNICs to each other and to the physical network |
| Snapshot or checkpoint | A saved point-in-time state of a VM that you can return to |
| Template | A prepared VM image used to create many identical VMs |
| Live migration | Moving a running VM to another host with little or no downtime |
| Datastore | The storage location where VM files live (VMware term, used loosely elsewhere) |
2. Types of hypervisor
| Type | Runs | Examples | Typical use |
|---|---|---|---|
| Type 1 (bare metal) | Directly on the hardware, with a small management layer | VMware ESXi, Microsoft Hyper-V, Xen, KVM (a Linux kernel module that makes Linux itself the hypervisor) | Servers and production |
| Type 2 (hosted) | As an application on a normal desktop OS | VirtualBox, VMware Workstation and Player, Parallels | Labs, developers, training |
The line is blurry (Hyper-V turns the Windows you installed into a guest-like “root partition” on top of the hypervisor; KVM turns Linux into the hypervisor), but the practical question is simple: is this machine a dedicated host, or my desktop?
3. How it works: hardware assist and paravirtual drivers
Early virtualisation had to translate privileged CPU instructions in software, which was slow. Modern CPUs provide hardware assist:
- Intel VT-x / AMD-V: lets guests run directly on the CPU in a special mode.
- SLAT (Second Level Address Translation): Intel EPT or AMD RVI/NPT. The CPU translates guest memory addresses in hardware. Required by Hyper-V on current Windows and a big speed-up everywhere.
- IOMMU (Intel VT-d / AMD-Vi): safely lets a guest use a physical device directly (device or GPU passthrough).
On top of that, guests use paravirtual drivers that know they are virtual and talk to the hypervisor efficiently, instead of pretending to be real hardware: Hyper-V integration services (built into modern Windows and Linux), VirtIO drivers for KVM and Proxmox, VMware Tools. Installing these in a guest is one of the first things to check when a VM is slow.
4. Virtual machines, containers and bare metal
| Bare metal | Virtual machine | Container | |
|---|---|---|---|
| Isolation | Complete (own hardware) | Strong (own kernel, hypervisor boundary) | Weaker (shared kernel, namespaces and cgroups) |
| Start time | Minutes | Tens of seconds | Seconds or less |
| Overhead | None | A few percent plus guest OS memory | Very small |
| Different OS per workload | Yes | Yes | No (same kernel family as the host) |
| Portability | Poor | Good (disk image) | Excellent (image and registry) |
| Best for | Heavy databases, GPUs, latency-critical or licensed hardware | General servers, mixed OS, strong isolation | Applications, microservices, build systems |
They combine: a very common design runs containers inside VMs on a virtualised cluster. Lesson 13 covers containers.
5. Why virtualise, and what it costs
Benefits
- Consolidation: fewer physical servers, less power, cooling, space and hardware to buy and patch.
- Isolation: a failing or compromised VM does not take its neighbours down.
- Speed: build a server from a template in minutes; clone, test, throw away.
- Mobility and availability: move VMs between hosts, restart them elsewhere after a failure.
- Protection: snapshots, image-level backups and replication are far easier than for physical servers.
- Labs and testing: the cheapest way to learn and to try changes safely.
Costs and risks
- Shared fate: many VMs on one host means one host failure hits many services. You need a design for it (clusters, replicas, backups).
- Noisy neighbours and over-commit: too many VMs competing for CPU, memory or disk make everything slow.
- Sprawl: VMs are so easy to create that nobody remembers which are needed, patched or paid for.
- Licensing: operating systems, databases and management software can be licensed per host, per core or per VM. Check the terms before you design.
- Skills and tooling: you now manage a layer (hypervisor, storage, network) that must be patched and secured.
When not to virtualise: workloads that need a dedicated GPU or special hardware you cannot pass through, latency-critical or real-time systems, software whose licence forbids it, very large single databases that already saturate a server, and machines that are the hypervisor’s own dependency (such as the one thing that must start before the hypervisor can find its storage). Even then, there are often workarounds; the point is to decide on purpose.
6. Can this machine host VMs?
Windows
systeminfo | Select-String "Hyper-V"
Get-CimInstance Win32_Processor | Select-Object Name, VirtualizationFirmwareEnabled, SecondLevelAddressTranslationExtensions, VMMonitorModeExtensions
Get-ComputerInfo -Property "HyperV*"
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
On a PC that already runs Hyper-V, systeminfo reports “A hypervisor has been detected” instead of the requirement list, and the WMI property may show False even though virtualisation works, because the hypervisor has claimed it. Hyper-V on client Windows needs Pro, Enterprise or Education (not Home).
Linux
lscpu | grep -i virtualization
grep -E -c '(vmx|svm)' /proc/cpuinfo
ls -l /dev/kvm
sudo apt install cpu-checker && sudo kvm-ok
vmx is Intel VT-x, svm is AMD-V. A count above zero means the CPU supports it; /dev/kvm existing means the kernel module is loaded and virtualisation is enabled in firmware.
Inside a virtual machine
If your lab machine is itself a VM, you need nested virtualisation: the outer hypervisor must expose the CPU virtualisation features to the guest (in Hyper-V: Set-VMProcessor -VMName Lab -ExposeVirtualizationExtensions $true while the VM is off). It works but is slower; it is fine for learning.
7. Hands-on lab: the command line
Lab: can this PC run Hyper-V?
You have a new Windows 11 Pro lab PC. Check the CPU features, see whether Hyper-V is enabled, turn it on and confirm the result.
Objectives
- Check that virtualisation and SLAT are enabled in firmware.
- Read the Hyper-V requirements summary.
- See whether the Hyper-V feature is installed.
- Install and enable Hyper-V with its tools (restart required).
- Restart so the hypervisor can load.
- After the restart, check that the host answers as a Hyper-V host.
8. Hands-on lab: platform decisions
9. Common problems
| Symptom | Cause and fix |
|---|---|
| “Virtualization is disabled in the firmware” | Turn on VT-x or AMD-V (and SLAT/EPT, VT-d if offered) in BIOS or UEFI, then fully power off and on |
| Hyper-V option missing on Windows | Windows Home edition, or an unsupported CPU. Use Pro, Enterprise or Education |
/dev/kvm does not exist on Linux |
Module not loaded or virtualisation off in firmware: sudo modprobe kvm_intel or kvm_amd, check firmware |
| A desktop hypervisor is slow or refuses to start | The Windows hypervisor owns the CPU features. Use the product’s mode for coexisting with Hyper-V, or run the lab in Hyper-V |
| Nested VM will not start | Expose virtualisation extensions to the outer VM and give it enough memory |
| VM is slow although the host is idle | Missing paravirtual drivers or tools in the guest, or storage latency. Check the guest drivers first |
10. Key takeaways
- A hypervisor shares hardware among isolated VMs. Type 1 runs on the hardware (servers); type 2 runs on a desktop OS (labs).
- Modern speed comes from VT-x/AMD-V, SLAT and paravirtual drivers (integration services, VirtIO, VMware Tools).
- VMs include a full OS and give strong isolation; containers share the host kernel and start fast.
- Virtualise for consolidation, speed, mobility and protection, but plan for shared fate, over-commit, sprawl and licensing.
- Check support with
systeminfo,Get-CimInstance Win32_Processor,lscpu,/dev/kvm, and enable it in firmware.
A manager wants to move a database server that uses a special USB hardware key and a GPU into a VM 'to save a rack slot'. What do you check before agreeing?
Whether the hypervisor supports passing the USB key and GPU through reliably (device passthrough needs IOMMU support and often has limits on live migration and snapshots), whether the software vendor’s licence and support terms allow virtualisation, and whether the performance and failover story is better or worse than today. If either the key or the GPU cannot be passed through, keeping that server physical may be the right decision, and you can still virtualise the rest.
Can You Explain It?
Close the lesson and answer these without looking back. The goal isn't the wording — it's whether you've formed a usable mental model.
- Explain type 1 versus type 2 hypervisors using one example of each.
- Why are containers lighter than VMs, and what do you give up for that?
- List three benefits and three risks of consolidating servers onto virtual hosts.
🧪 Want to practise this on your own computer? See how to set up your lab →