In this guide
- What is virtualization?
- How virtualization works
- Type 1 and type 2 hypervisors
- What a virtual machine is made of
- Types of virtualization
- What virtualization is used for
- Virtualization vs containerization
- Benefits and drawbacks of virtualization
- Snapshots, live migration and high availability
- Managing a virtualized environment
- Virtualization and cloud computing
- Virtualization security
- Virtualization for beginners: a learning path
- FAQ
Virtualization basics, from one hypervisor to the cloud
Virtualization basics come down to one idea: software can pretend to be hardware. A program called a hypervisor divides one physical computer into several virtual machines, each of which believes it has a processor, memory, a disk and a network card of its own.
That single trick is why a rack of servers became one host, why a server can be copied like a file, and why cloud computing exists at all.
This guide covers the fundamentals of virtualization in the order they build on each other: what virtualization is, how it works, hypervisors, virtual machines, the types of virtualization, containers, the benefits and the drawbacks, the features that matter in production, how virtualization relates to the cloud, and how to keep it secure. Each section links to a full page in this library.
DefinitionWhat is virtualization?
Virtualization is the creation of a software version of a computing resource, such as a server, a desktop, a network or storage, that behaves like the physical one. The most common form is server virtualization, where one physical server runs many isolated virtual servers at the same time.
Put another way, virtualization lets a single physical computer run multiple operating systems and multiple applications at the same time, each in its own isolated environment. The processor, memory, storage and network of the machine become a pool of resources that software hands out on demand.
The reason it caught on is utilization. A physical server dedicated to one application sits mostly idle, because it is sized for its busiest moment. Virtualization lets many workloads share the same hardware, each taking resources as it needs them, so an organization runs the same applications on far fewer machines.
Three terms recur throughout:
- Host: the physical machine that provides the resources.
- Guest: a virtual machine running on the host, with its own operating system.
- Hypervisor: the software layer between them that shares out the hardware and keeps the guests apart.
MechanicsHow virtualization works
The hypervisor sits between the physical hardware and the virtual machines and does three jobs. It presents each virtual machine with virtual hardware. It schedules the real processor, memory, storage and network among them. And it isolates them, so that a crash or a compromise in one guest does not reach another.
Modern processors help. Intel VT-x and AMD-V are hardware virtualization extensions that let guest code run directly on the processor at close to native speed, with the hypervisor stepping in only for privileged operations.
They are usually switched on or off in the firmware settings, which is the first thing to check when a hypervisor refuses to start; what a BIOS is explains where those settings live.
HypervisorsType 1 and type 2 hypervisors
Hypervisors come in two types, distinguished by what they run on.
| Type 1, bare metal | Type 2, hosted | |
|---|---|---|
| Runs on | The hardware directly, with no operating system underneath | An ordinary operating system, as an application |
| Performance | Close to native | Lower, because the host operating system is in the path |
| Used for | Production servers and data centers | Testing, development and running a second operating system on a desktop |
| Examples | VMware ESXi, Microsoft Hyper-V, KVM, Xen, Proxmox VE | Oracle VirtualBox, VMware Workstation, Parallels Desktop |
Type 1 vs type 2 hypervisor goes through the differences in detail. For choosing a production platform, Hyper-V vs VMware compares the two most common, and ESX vs ESXi clears up the naming of the VMware hypervisor.
Virtual machinesWhat a virtual machine is made of
A virtual machine, or VM, is a complete computer defined in software. To its operating system it is indistinguishable from a physical one. On the host, it is a handful of files:
- Virtual CPUs (vCPUs): shares of the host's processor cores, scheduled by the hypervisor.
- Virtual memory: a portion of the host's RAM assigned to the guest.
- Virtual disk: a file on the host's storage, such as a VMDK or VHDX, that the guest sees as a hard drive.
- Virtual network adapter: connected to a virtual switch, which joins the VM to other VMs and to the physical network.
- Configuration file: the definition that ties the rest together.
Because a VM is files, it can be copied, moved, backed up and restored like files, which is where most of the practical benefits come from.
ScopeTypes of virtualization
Servers were first, but the same idea is applied to most of the data center:
| Type | What is virtualized | Example |
|---|---|---|
| Server virtualization | One physical server into many virtual servers | Several application servers on one host |
| Desktop virtualization (VDI) | User desktops, run in the data center and reached remotely | Call center or remote staff on thin clients |
| Network virtualization | Networks defined in software, independent of the cabling | VLANs, VXLAN overlays, software-defined networking |
| Storage virtualization | Many physical disks pooled and presented as one | A SAN, or a hyperconverged cluster |
| Application virtualization | An application packaged to run without being installed | Streaming a legacy application to users |
| Operating system virtualization | One kernel shared by many isolated user spaces | Containers |
In practiceWhat virtualization is used for
- Server consolidation: replacing many underused physical servers with a few hosts, the use that paid for the technology.
- Running multiple operating systems on one machine, such as Windows and Linux side by side, without rebooting.
- Development and testing: disposable environments that match production and can be reset in seconds.
- Disaster recovery: replicating virtual machines to a second site, where they can be started on different hardware.
- Legacy applications: keeping software that needs an old operating system running safely on modern infrastructure.
- Desktop delivery: giving remote staff a managed desktop while the data stays in the data center.
- Cloud infrastructure: every virtual server rented from a cloud provider is a virtual machine on someone else's hypervisor.
ContainersVirtualization vs containerization
A container virtualizes the operating system instead of the hardware. Every container on a host shares that host's kernel and carries only its application and the libraries it needs, so it starts in seconds and takes megabytes where a VM takes gigabytes.
| Virtual machine | Container | |
|---|---|---|
| Virtualizes | Hardware | The operating system |
| Contains | A full guest operating system | An application and its dependencies |
| Starts in | Minutes | Seconds |
| Isolation | Strong, enforced by the hypervisor | Lighter, because the kernel is shared |
| Best for | Different operating systems, legacy applications, strong separation | Microservices, fast deployment, high density |
The two are usually combined: containers running inside virtual machines. Containers vs VMs covers when to choose each, and what Docker is explains the tool that made containers mainstream.
Trade-offsBenefits and drawbacks of virtualization
The benefits of virtualization are the reason nearly every server is now virtual:
- Consolidation: fewer physical servers, so less hardware, power, cooling and rack space.
- Speed: a new server is deployed from a template in minutes, not ordered and racked over weeks.
- Recovery: a whole server can be backed up, replicated and restored on different hardware.
- Isolation: each application gets its own operating system, so one cannot break another.
- Testing: a snapshot before a change gives an instant way back.
- Legacy support: an old operating system keeps running on new hardware.
The drawbacks are fewer but real:
- A single point of failure: when a host fails, every VM on it fails, which is why production uses clusters.
- VM sprawl: servers that are easy to create are easy to forget, and each one still needs patching and licensing.
- Resource contention: too many busy guests on one host slow each other down.
- Licensing and skills: hypervisor licensing and the expertise to run a cluster are real costs.
In productionSnapshots, live migration and high availability
A few features turn a hypervisor from a convenience into a platform:
- Snapshots capture a VM's state at a moment so a change can be undone. They are not backups: they live with the VM and grow the longer they are kept.
- Templates and clones create new VMs from a known-good image, which is how builds stay consistent. Infrastructure as code takes the same idea further.
- Live migration moves a running VM from one host to another with no downtime, so hardware can be maintained during the day. It needs shared storage or a fast copy of the disk.
- High availability restarts the VMs of a failed host on the surviving hosts automatically.
- Overcommitment assigns more virtual CPU and memory than physically exists, betting that guests will not all peak together. It raises density and, pushed too far, causes contention.
OperationsManaging a virtualized environment
One host is managed from its own console. Beyond that, a management layer such as VMware vCenter, Microsoft System Center Virtual Machine Manager or the Proxmox cluster interface treats multiple hosts as one pool of resources.
It is where an administrator creates virtual machines, balances them across hosts, sets resource limits and reservations, watches capacity and applies updates to the hypervisors themselves.
The management discipline matters as much as the software. Size each VM for what its applications actually use, because unused virtual CPUs still cost scheduling time. Monitor the hosts for memory pressure and storage latency, the two resources that run out first.
Keep an inventory of every VM with an owner and a purpose, and retire the ones nobody claims. Back up virtual machines at the hypervisor level so that a whole system, and not just its data, can be restored.
CloudVirtualization and cloud computing
Virtualization is the technology; cloud computing is a way of delivering it. A cloud provider runs hypervisors at enormous scale and adds self-service, automation and billing by usage, so a customer rents virtual machines by the hour without ever seeing the hardware.
An organization that runs its own virtualized servers has virtualization without cloud. One that builds the same self-service layer on top has a private cloud.
SecurityVirtualization security
Virtualization concentrates risk as well as servers, so a few points deserve attention:
- Patch the hypervisor. A flaw that lets a guest break out to the host, known as a VM escape, is rare and serious, because the host controls every guest.
- Protect the management interface. Whoever controls the hypervisor console controls every server on it. Keep it on a separate management network with MFA.
- Treat every VM as a server. It needs patching, antivirus, backup and monitoring like a physical one.
- Segment virtual networks the way you would physical ones.
- Control sprawl with an inventory and an owner for every VM.
Reading orderVirtualization for beginners: a learning path
- Type 1 vs type 2 hypervisor: the two kinds and where each is used.
- Hyper-V vs VMware and ESX vs ESXi: the production platforms.
- Containers vs VMs: the alternative, and when it wins.
- What Docker is: containers in practice.
The quickest way to learn the virtualization basics is to install a type 2 hypervisor on a laptop, build two virtual machines and a virtual network between them, and break things on purpose.
