Virtual Machines

From COMP15212 Wiki
Depends on Virtualisation

Virtualisation extends to whole machines, thus, for example, one physical machine may appear as several, distinct virtual machines.

There are different ways to approach this virtualisation. In one sense, the simplest approach is to use an application program which runs a software model of a separate machine, modelling the hardware including the processor. This is a machine emulator.

Process Virtual Machine

There are several benefits to this model:

  • it allows simple control of security in that the virtual application is completely contained by the emulator
  • the emulator can emulate any machine: the virtual processor can be completely different from the actual hardware
  • the emulator may collect additional monitoring information; this can help with debugging etc.

There are also at least one significant drawback:

  • using software to model hardware is slow; typically much slower than a real system.

An example is the Java Virtual Machine (JVM) which emulates a computer which runs a Java bytecode instruction set. Some emulators – such as QEMU – apply various clever acceleration techniques but it is difficult to get close to hardware performance speeds.

If all the code runs on the native hardware ISA then the efficient approach is to run directly on that hardware. This is the same principle applied to processing as is used in virtual memory – and presents similar problems: there must be some way of preventing the guest system from doing something it shouldn’t.

In a software emulation the software can check for this; with the software layer removed there needs to be a hardware check. (In memory management this is the page fault.) Indeed, in some sense, in a multi-tasking system each process is in its own ‘virtual machine’, cocooned by the operating system, which is supported by the hardware.

With a sufficiently detailed virtual model, this can be extended so that the process is a whole machine model which can run its own operating system.

Emulated OS

However, the O.S. feels free to manipulate the hardware directly (it’s its job) which is a problem if there is more than one O.S. trying to run simultaneously. To support this, another abstraction layer can be added, between the operating system(s) and the hardware. This is called a Virtual Machine Monitor (VMM) or – more catchily – a “hypervisor”.

Hypervisor layers


Here’s a video (13 mins.) of someone demonstrating his virtual machinery.

This is a comprehensive view of virtualisation and hypervisors, particularly from the user’s perspective (1 hr.)


Also refer to: Operating System Concepts, 10th Edition: Chapter 18, pages 701-729