How Does Virtualization Work?

Virtualization software is essentially a computer hardware emulator that tricks an operating system into behaving as if it is installed and running on a physical computer. The hardware emulation provided by virtualization software is referred to as a virtual machine or virtual computer. The hardware emulated is typically that of a generic PC and provides each virtual machine (VM) with its own CPU, RAM, hard disk(s), I/O devices (keyboard, mouse, floppy, CD, network), and video adapter. (This type of VM should not be confused with software run-time environments that use application-level virtual machines, such as Java and Microsoft .NET, which is not the same thing.)

The virtualization software itself runs on a host operating system (or host OS), which is the operating system that is running on the physical computer. (For example, if you installed VM software on Windows XP the host OS is Windows XP.) The operating system running inside of the VM software itself is the guest operating system (or guest OS). (For example, if you run a virtual disk image of Ubuntu Desktop 7.10 in VM software the guest OS is Ubuntu Desktop 7.10.) The host and guest OSes are typically isolated form each other. However, some VM software packages allow the easy transfer of files from the guest and host OSes using simple drag-and-drop operations between the OS’ desktops. With VM that do not allow this type of interaction, the network interface is typically the only way to transfer data into, out of, and between guest and host OSes.

All VMs running on a host OS are controlled by the hypervisor, which acts as a both a monitor and an interface between all VMs and the host OS. The hypervisor itself can be either a programming running in the host OS, or the host OS itself (that is, the hypervisor that is loaded on to and boots as the OS the physical computer). The hypervisor controls all aspects of the interaction between the host and guest OSes and the physical hardware.
The “save file” of a VM software package is a virtual disk image. When a guest OS is first installed in VM software, it is saved as a virtual disk image. This image will be one or more physical files on the host OS’ hard drive or network share. All changes made to a guest OS are saved to its virtual disk image. Because a guest OS is installed using the virtual drivers in the VM software and not the drivers installed on the physical computer, a virtual disk image can be easily copied and move between host OSes.

A special type of virtual disk image is a snapshot. The state of a guest OS can be saved to a snapshot file. The state is everything that has happened in a guest OS from the time it has started to the time the snapshot was made. (A snapshot is identical in concept to a restore point in Windows.) Multiple snapshots made be made of a guest OS. The previous state of a guest OS can be restored by reverting to the snapshot. This is the method used to restore a guest OS to a baseline configuration.

When a VM is first started, it does not contain a guest OS. One must be loaded from an existing virtual disk image file or be created. One of the big misconceptions about VM software is that it gives you a free copy of different operating systems. This is by no means the case. A VM is simply a program capable of “playing” a guest operating system. In most cases, the guest OS image itself must be created from a licensed installation of an operating system from an ISO file or an installation CD. If software activation is necessary for the guest OS, you must have a valid license key as well. In some VM software, the guest OS is built directly into the VM software itself (such as MS-DOS is in DOSBox), but in most cases the guest OS will need to be installed in the VM software just as it would be installed on a physical computer.

For more information on how virtualization works, read VMWare’s Web page VMWare Virtualization Basics and technical paper Understanding Full Virtualization, Paravirtualization, and Hardware Assist.