Computer Systems

Virtualisation

Virtualisation

Table of Contents

Motivation

History

Requirements for Virtualisation

Hypervisors should provide:

Type 1 and Type 2 Hypervisors

hypervisor-types

Questions

  1. Give a reason why a data center might be interested in virtualization.

Can run a number of servers on the same hardware, reducing costs, and increasing versatility.

  1. Give a reason why a company might be interested in running a hypervisor on a machine that has been in use for a while.

If the hardware is upgraded, you can allow the old software to keep running

  1. Give a reason why a software developer might use virtualization on a desktop machine being used for development.

To test whether the application being developed works on a particular platform

  1. Give a reason why an individual at home might be interested in virtualization.

The ability to run applications that aren’t supported on the operating system they run.

  1. Why do you think virtualization took so long to become popular? After all, the key paper was written in 1974 and IBM mainframes had the necessary hardware and software throughout the 1970s and beyond.

The explosion of PCs vs access to a mainframe: there was little need to support multiple systems. The adoption of the x86 architecture also meant that it was difficult to implement virtualisation when it might have been useful.

  1. Name two kinds of instructions that are sensitive in the Popek and Goldberg sense.
  1. Name three machine instructions that are not sensitive in the Popek and Goldberg sense.
  1. What is the difference between full virtualization and paravirtualization? Which do you think is harder to do? Explain your answer.
  1. Does it make sense to paravirtualize an operating system if the source code is available? What if it is not?

Yes. In paravirtualisation, the guest operating system needs to be ported - this cannot be done if the source code is unavailable. An alternative is full virtualisation where all instructions are emulated

  1. Consider a type 1 hypervisor that can support up to n virtual machines at the same time. PCs can have a maximum of four disk primary partitions. Can n be larger than 4? If so, where can the data be stored?

Yes: there is a virtual disk for each VM stored as a file on disk.

  1. Briefly explain the concept of process-level virtualization.

Process-level virtualisation allows a process to run that was originally written for a different OS. To do this a virtualisation layer between the application and the OS is used which executes the application’s instructions, modifying as necessary prior to execution. e.g. WINE: Windows Emulator

  1. Why do type 2 hypervisors exist? After all, there is nothing they can do that type 1 hypervisors cannot do and the type 1 hypervisors are generally more efficient as well.

Type 2 hypervisors allow the user to run an application within their existing OS - this may be of greater convenience to the user.

  1. Why was binary translation invented? Do you think it has much of a future? Explain your answer.

Binary translation was invented to handle sensitive, non-privileged instructions, by rewriting them with an equivalent instruction that will trap. As modern architectures are designed with virtualisation in mind and have hardware support, it is unlikely to be a key part of future virtualisation. However it will continue to be used to support legacy applications.

  1. Explain how the x86’s four protection rings can be used to support virtualization.

x86 has 4 protection rings: the innermost ring, ring 0, is the most privileged and is used by the kernel. The outermost ring, ring 3, is the least privileged ring and is used for user mode. Rings 1 and 2 aren’t used in existing operating systems, meaning ring 1 can be used for the privileged mode of the guest OS, which is both more privileged that user mode, and less privileged than the hypervisor.

  1. State one reason as to why a hardware-based approach using VT-enabled CPUs can perform poorly when compared to translation-based software approaches.

The hardware-based approach of trap-and-emulate can produce a large number of costly traps in comparison to software approaches.

  1. Briefly explain why memory is so difficult to virtualize well in practice? Explain your answer.

Memory is difficult to virtualize because guests don’t really control physical pages, and it is necessary to add another level of page tables to prevent multiple guest OSs allocating the same physical page.

  1. Running multiple virtual machines on a PC is known to require large amounts of memory. Why? Can you think of any ways to reduce the memory usage? Explain.

Multiple virtual machines need to load the kernel of each OS into memory, and additional memory is required for the hypervisor itself. To reduce memory usage, if you have multiple VMs running the same OS, you could share kernel pages of shared code.

  1. Explain the concept of shadow page tables, as used in memory virtualization.

Shadow page tables provide a mapping between the guest OS page tables and the physical page tables. They are necessary because the guest OS thinks it owns the memory, while there may be multiple guests trying to allocate the same physical page.

  1. Why are balloon drivers used? Is this cheating?

Balloon drivers are used to force a guest OS to evict pages when the hypervisor runs out of pages, as the hypervisor itself doesn’t know which pages should be kept.

  1. Descibe a situation in which balloon drivers do not work.

If the hypervisor knows nothing about the guest OS, or if there is no way to include a balloon driver.

  1. What were the three main requirements considered while designing VMware?
  1. Why was the enormous number of peripheral devices available a problem when VMware Workstation was first introduced?

VMware could not produce drivers for all devices available. By making VMware a Type 2 hypervisor, it could run on the drivers already installed on the host OS.


Edit this page.