QuickStudy: Virtual machines

24.04.2006
At the simplest level, computing environments are thought to consist of hardware, an operating system that runs on the hardware and applications that run on the OS -- though in embedded systems, the operating system is sometimes eliminated and applications run directly on the hardware. The OS is aware of all the capacity and capability of the underlying hardware and controls it directly.

If another layer of software were placed between the OS and the CPU, then the OS would know only what that extra layer of software told it. Its understanding of the capacity and capability of the underlying hardware would depend on the intervening software layer, and it would be able to control the underlying hardware only in ways the intervening layer of software allowed it to.

The intervening layer of software could tell the OS everything there was to know about the hardware and simply pass through control directives without translation. But it also might not reveal everything about the underlying hardware and might add some control of its own as it passes on the control directives to the OS.

In either case, the configuration would not be the standard tripartite configuration. It would be one of the many possible configurations that is called a virtual machine.

Of course, there are servers, networks and Web interfaces, as well as other devices and interfaces, that add nuance and complexity to computing environments. But using a software layer to package a set of computing resources and behaviors and to present it as an available computing environment is at the core of what it means to create a virtual machine.

A virtual machine is a computing environment whose set of resources and behaviors is built (through software) on top of some other computing environment.

Hypervisor VMs

Virtual machines are at the core of server technologies like VMware Inc.'s ESX Server and the open-source Xen virtual machine monitor. Both of these products offer servers that run multiple x86-based OSs simultaneously. Their approaches are slightly different variations of what are called hardware-level, bare-metal or hypervisor virtual machines. The intermediary software layer (called the virtual machine monitor or hypervisor) is between the OS and the hardware. The hypervisor gives all the OSs that are running the illusion that they are the only OS running on the hardware.

Running multiple OSs on one server platform offers several advantages. It makes it possible to more fully use the resources of very powerful servers, provide backward compatibility for legacy programs and partition applications to different OSs so they can't corrupt one another.

VMware uses transparent virtualization, which means that the OSs that run on the hypervisor do not need to be modified. Xen uses paravirtualization, which means that it needs to modify the OSs to make them run simultaneously on the hardware. Xen claims that paravirtualization increases speed and efficiency.

Hosted VMs

Microsoft Corp.'s Virtual PC and VMware's GSX Server and Workstation are called hosted virtual machines. In these products, the VM is like any other application running on an OS. The VM application is divided into an intermediary software layer, an OS and an application running on that OS.

This scheme is less efficient and less powerful than that used for hypervisor servers, but it provides the same kind of advantages, allowing a user to run legacy programs and to partition applications from the rest of the system. A user who wants to visit dangerous Web sites, for example, could add a layer of protection by doing his surfing via a virtual machine.

Application-Level VMs

Application-level VMs, such as the Java virtual machine, are similar to the hosted model in that they run as applications. These VMs, however, combine the intermediary software layer with the OS. The Java VM runs like an application on the native OS, and the Java application runs on the VM.

One of the advantages claimed for this programming paradigm is that a Java program will run on any Java VM without recompilation. That is left to the provider of the Java VM, which must make it run on a variety of native OSs.

Parallel virtual machine

The parallel VM is a slightly different approach to creating a virtual machine. In this case, the intermediary software layer exists as a daemon, or a server program, along with a set of library calls, which must be compiled into the application that is going to be run on the parallel VM. The library calls, which interact with the server programs, make a network of computers appear to be a single computer with parallel processors.

As the saying goes, you can make software do anything. Although efficiency and speed may be an issue, as long as there is an intermediary software layer, virtualization can be made a reality.

VIRTUAL CONFIGURATIONS

App 1

App 2

App 3

OS

HARDWARE

Standard configuration, no virtual machines

The applications run directly on the OS, which runs directly on the hardware.

App 1 App 2

App 3 App 4

App 5 App 6

OS 1

OS 2

OS 3

HYPERVISOR SOFTWARE

HARDWARE

Hardware-level or hypervisor virtual machines

With the hypervisor layer between the hardware and OSs, each OS believes it is running in the standard configuration, when in fact it is sharing the resources of the underlying hardware.

App 3 App 4

Guest OS

App 1

App 2

Virtual return layer

OS

HARDWARE

Hosted virtual machines

The virtual machine runs as an application on the host OS. There is an intermediary layer of software between the host OS and the guest OS.

Java app

App 1

App 2

Java virtual machine

OS

HARDWARE

Application-level virtual machines

A Java virtual machine runs as an application on the OS. The Java application runs on the Java virtual machine.