What does it mean for an operating system to run on a physical machine?
Real hardware resources that the operating system has exclusive access to through hardware interfaces
(instructions set architectures, device I/O ports, etc)
What is a guest OS?
An operating system running inside a virtual machine
How do virtual machines differ from physical machines?
They do not provide the guest OS with exclusive access to the underlying physical machine
Equivalently, the do not provide the guest OS with privileged (or fully-privileged access to the physical machine)
What is the virtual machine monitor (VMM)?
A piece of software running on an operating system (the host OS) that can allow another operating system (the guest OS) to be run as an application alongside other applications.
When we said that the operating system was really just another program, we weren’t kidding!
What are four problems with coupling hardware resources with operating systems?
What are four issues that operating systems create around “isolation”?
What are three reasons why we use virtualization?
What are the three approaches to virtualization discussed in class?
Full virtualization, paravirtualization, and container virtualization
What is full virtualization?
Should be able to run an unmodified guest OS.
Example: VirtualBox
What is paravirtualization?
Includes small changes to the guest OS to improve interaction with the virtual machine monitor.
Examples: Xen, Amazon EC2
What is container virtualization?
Namespace and other isolation techniques performed by the OS to isolate sets of applications from each other
Ex: Docker (with augmentations)
What is the goal of full virtualization?
Run an unmodified OS and applications in a VM which is itself running on a host OS and potentially next to other VMs
Why is VMware special?
They are the best-known provider of full virtualization software solutions
Why is it hard to achieve full virtualization (unmodified running of an OS on a VM alongside other VMs)?
Two issues:
What happens if we run a guest OS with kernel privileges?
Privileged instructions work as expected, but guest has access to the entire machine! (this violates safety)
What happens if we run the Guest OS with user privileges?
Now we need to figure out how to deal with privileged kernel instructions…
Ideally, when privileged instructions are run by the guest OS at user privilege level, these three things happen:
This approach is referred to as trap and emulate
What does the VMM do with traps that occur within the virtual machine?
If the trap is caused by an application, pass the trap to the guest OS
If the trap is caused by the guest OS, handle the trap by adjusting the state of the virtual machine
What happens when an application running inside the virtual machine makes a system call?
What happens when a process inside the virtual machine creates a TLB fault?
What is actually being virtualized in hardware virtualization?
The hardware interface
What is the hardware interface?
Load and store
How do we ensure safety when dealing with the hardware interface?
Translate every unprivileged memory access
How do we get good performance when translating unprivileged memory accesses?
Cache translations in the TLB