Virtualisation
Virtualisation is the process of creating a software-based (or virtual) representation of something physical, such as a server, storage device, network, or even an operating system. It enables multiple virtual instances to run on a single physical machine, improving resource utilisation, isolation, and flexibility.
Why Virtualise?
Virtualisation provides several key benefits:
- Server Consolidation: Run multiple workloads on a single physical server, reducing hardware costs and power consumption.
- Isolation: Virtual machines or containers are isolated from each other, improving security and stability.
- Portability: Virtual machines can be moved between physical hosts with minimal downtime.
- Testing and Development: Developers can create disposable environments that mirror production without affecting the host system.
- Legacy Support: Run older operating systems or applications on modern hardware.
Types of Virtualisation
Virtualisation can be categorised into several types, each with different use cases and performance characteristics:
- Full Virtualisation: The hypervisor simulates complete hardware, allowing unmodified guest operating systems to run. Examples include QEMU and VMware.
- Paravirtualisation: The guest OS is aware it is virtualised and makes hypercalls to the hypervisor for improved performance. Examples include Xen PV and KVM with virtio drivers.
- Hardware-assisted Virtualisation: CPU extensions (Intel VT-x, AMD-V) provide hardware support for virtualisation, reducing overhead. Modern hypervisors like KVM and Hyper-V rely on these extensions.
- Operating System-level Virtualisation: The kernel creates isolated environments (containers, zones, jails) that share the same kernel. See Article - Lightweight OS virtualisation techniques (chroot, namespace) for chroot and namespace details.
- Application Virtualisation: Individual applications run in isolated environments with their own dependencies. See Article - Application container systems (snap, flatpak) for snap and flatpak.
- Container Virtualisation: Full application stacks packaged as container images, managed by container runtimes. See Article - Containerized systems (dockerhub images).
See Article - 6 types of virtualisation for a detailed comparison of the six types of virtualisation.
Virtualisation in the Linux Ecosystem
Linux offers several virtualisation technologies:
- KVM (Kernel-based Virtual Machine): Turns the Linux kernel into a hypervisor, enabling native virtualisation with near-bare-metal performance.
- QEMU: A generic machine emulator that can virtualise CPUs and devices, often used with KVM.
- LXC/LXD: OS-level containers providing lightweight virtualisation.
- Docker/Podman: Application container platforms for packaging and deploying software.
- Firecracker: MicroVM technology designed for serverless computing, providing fast boot times and minimal overhead.
Hypervisor Types
- Type 1 (Bare Metal): The hypervisor runs directly on the host hardware (e.g., VMware ESXi, Xen, KVM).
- Type 2 (Hosted): The hypervisor runs as an application on a conventional OS (e.g., VirtualBox, VMware Workstation).
Related Articles
- Types of virtualisation: Article - 6 types of virtualisation
- OS isolation: Article - Lightweight OS virtualisation techniques (chroot, namespace)
- Docker: Article - Containerized systems (dockerhub images)