Study guides · Intermediate

Virtual Machines, Hypervisors, and Virtual I/O

Separate virtual CPUs, guest-physical memory and virtual I/O while tracing a VM’s isolation boundary.

Ask Logeia about this articleTry the three questionsReview your answers

Updated

On this page
  1. A VM exposes a machine interface
  2. A vCPU receives physical execution time
  3. Address translation can have two stages
  4. Consider virtual I/O and migration constraints
  5. Ask Logeia about this articleCheck your understanding

A VM exposes a machine interface

A virtual machine exposes CPU, memory and device interfaces on which a guest operating system can run. A hypervisor allocates and controls those interfaces across guests. Virtualization does not require interpreting every instruction in software: suitable hardware assistance allows much execution to proceed directly. The guest still does not own the whole physical machine. Virtual CPU counts, memory limits and visible devices depend on host configuration and management. A number reported inside a guest is therefore not, by itself, proof of exclusive ownership of that many physical execution resources.

A vCPU receives physical execution time

A vCPU is a guest-visible execution context scheduled onto physical processing resources. With competing guests, a runnable virtual CPU can wait for host CPU time. Overcommit can improve utilization when workloads do not peak together, but can increase latency when they do. Guest CPU utilization alone may not reveal all scheduling delays or allocation limits. NUMA placement and exposed processor features also affect results. Two machines advertised with the same virtual CPU count need not provide identical sustained compute capacity. Interpret performance measurements using both guest activity and the host resource contract.

Address translation can have two stages

A guest process’s virtual address is translated using guest-managed page tables into a guest-physical address. Another mapping controlled by the virtualization layer connects that address to host memory. The exact mechanism and caching depend on the processor and implementation. Contiguity in guest-physical space need not imply the same physical layout on the host. Allocation can also change through mechanisms such as memory ballooning. Ordinary VM isolation typically trusts the hypervisor; guest page permissions alone do not promise confidentiality against a malicious host. That stronger threat model requires additional mechanisms and carefully defined exclusions.

Consider virtual I/O and migration constraints

Virtual I/O can emulate device behavior, use a cooperative interface such as virtio, or assign hardware more directly to a guest. These choices trade portability, performance, isolation and migratability. Moving a VM between hosts involves CPU, memory and device state as well as storage and network relationships. Directly assigned devices may impose migration restrictions. Likewise, capturing a VM snapshot does not automatically produce an application-consistent backup: in-memory activity and external services may require coordination. Test restoration and state consistency instead of treating a convenient machine-level capture as proof that every application can recover correctly.

Reading and practice are recorded separately in this browser, for each language.

Choose a learning path