Hardware Virtualization - Desktop Virtualization
This is a quick follow-up post to the rather popular What Hardware Virtualization Really Means post of mine. I constantly see “hw virtualization” queries to this blog, so would like to expand a bit on this topic and key terminology around hardware virtualization.
HW virtualization means the same thing as hardware virtualization: it’s a virtualization solution where end result (virtualization unit, usually a Virtual Machine) provides a completely isolated virtual representation of a hardware platform, running on top of specialised software and hardware.
The purpose of hw virtualization is to allow you run multiple virtual environments with virtual hardware, all sharing physical hardware available on your system. This achieves higher density: instead of running one OS environment per physical server, you can potentially run dozens of same or different OS environments on the same server.
Most common examples of such solutions are desktop virtualization products:
If you look closely, most of the well known solutions today all provide virtualized environments of the same architecture: x86. This usually means the host (physical server) should be of the same hardware architecture. That’s because virtualization software provides all the VMs with virtualized interfaces to real hardware on your system. The most important component of that is processor (CPU) and CPU instruction set.
If you are looking for a way to run different (non-x86) architectures inside virtual environments, you are going to need a different kind of software – called emulator. Such solutions exist and some indeed provide virtualization capabilities (let you run multiple emulated VMs on top of the same physical system), but at a performance cost: emulators have to emulate (implement using relatively slow software code) every CPU instruction, instead of virtualizing CPU – allowing virtual machines abstracted access to physical CPU where CPU runs its instructions much faster.
This is actually what most people mean when they say hw virtualization: they’re referring to hardware assisted virtualization on desktop and server grade hardware.
Namely, both Intel and AMD processors have special functionality that allows for much more flexible and performant virtualization. Both operating systems and virtualization software check for such HAV support on your system and will usually fail to virtualize on older processors which don’t have hardware assisted virtualization.
Once a VM is created, you can attach a virtual DVD drive to it and slot a virtual disk into it – an ISO image of your favourite operating system. Such virtual machine will then be booted and run the installation from ISO image, allowing you to complete OS install and end up with a virtual environment that looks and feels like a real desktop PC, only running rather slowly and inside a window of desktop virtualization software:
VirtualBox 6 running CentOS 7.4 VM
Specifically for improving virtualization and performance of certain components like I/O, memory management and virtual networking, all of such virtualization solutions supply a collection of purpose-built drivers: VMware Tools or Open-VM-Tools, for example. Installing these drivers lets you access VM disks from your host system, set advanced display resolutions, etc.
The really attractive benefit of using hardware virtualization is running multiple VMs on the same physical system. Using desktop virtualization example diagram at the top of this post, you can see how a single desktop system running Ubuntu Linux can host and run many virtual machines at once.
Here are examples of various virtualization processes happening in a typical desktop virtualization scenario: