🎓 BookMCQ
← Back to 16. Virtual Machines

📝 Virtual machine building blocks and architecture (7 MCQs)

Architectural Components of a Virtual Machine System

A virtual machine system consists of physical hardware, a hypervisor, virtual machine definitions, virtual hardware devices, and guest operating systems. The hypervisor controls access to processor, memory, storage, and network resources, while each guest interacts with virtual devices through familiar operating system interfaces. This layered architecture separates guest software from the physical implementation of the host computer.

Why a Control Layer Is Needed Between Guests and Hardware

Multiple guest operating systems cannot safely assume unrestricted control over one processor, memory system, or device set. The hypervisor mediates privileged operations and allocates shared resources. It also presents compatible virtual hardware, allowing unmodified guest systems to execute without directly controlling the host's physical components.

Virtual CPU, Memory and Device Architecture

Each virtual machine has a configuration describing virtual CPUs, memory capacity, virtual disks, and network interfaces. The hypervisor schedules virtual CPUs on physical processors and translates guest memory addresses. Virtual device models or paravirtual drivers handle I/O, while management software controls creation, configuration, suspension, and deletion.

Example of a Virtual Machine Configuration

A host contains an eight-core processor, 32 GB of RAM, and one physical network adapter. A guest is configured with two virtual CPUs, 8 GB of memory, a 100 GB virtual disk, and a virtual network card. The hypervisor maps these virtual resources to available host facilities.

Layered Design and Resource Sharing

This architecture supports multiple operating systems, hardware abstraction, and flexible resource management. Device emulation improves compatibility but may add processing overhead, while specialised virtual drivers can improve efficiency. Resource contention remains possible because virtual devices ultimately depend on shared physical hardware, and faulty hypervisor components can affect several guests.

Misconceptions About Virtual Machine Architecture

'A virtual disk must be a separate physical disk' is false because it may be a file or logical volume. 'A virtual CPU is a dedicated processor core' ignores hypervisor scheduling. 'The guest directly controls every physical device' overlooks mediation through virtual devices and drivers.

Exam Focus: Identifying Architectural Layers

Draw and label physical hardware, hypervisor, virtual devices, and guest operating systems. Trace how a guest CPU instruction or storage request reaches the host hardware. Questions may distinguish virtual resources from physical resources or compare device emulation, paravirtual drivers, and hardware-assisted execution.

Key Terms of Virtual Machine Architecture

  • Hypervisor - Controls and allocates virtual resources.
  • Virtual hardware - Simulated devices presented to guests.
  • Guest OS - Operating system inside a virtual machine.
  • Virtual disk - Guest storage backed by host storage.
  • Host hardware - Physical resources shared by guests.
2
Easy
3
Medium
2
Hard

📝 All Virtual machine building blocks and architecture MCQs

Q1. A virtual machine needs to perform disk I/O on a host that supports hardware-assisted virtualization. Which building block most directly enables this capability?

A.Binary translation
B.Paravirtualization
C.Hardware-assisted virtualization ✅
D.Emulated drivers
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The correct answer is C because hardware‑assisted virtualization provides CPU extensions that allow a guest to execute I/O instructions directly, reducing the need for software emulation. Binary translation (A) converts instructions but adds overhead; paravirtualization (B) requires guest modifications; emulated drivers (D) simulate devices in software, which is slower. Using hardware support lets the VM access disks efficiently, matching real‑world performance expectations.

Q2. In a dual‑mode CPU (user and kernel), a hypervisor must handle privileged instructions issued by a guest OS. Which technique allows the hypervisor to correctly manage these instructions without modifying the guest?

A.Binary translation
B.Trap‑and‑emulate ✅
C.Direct execution
D.Shadow paging
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The correct answer is B. Trap‑and‑emulate intercepts privileged instructions issued in kernel mode, transfers control to the hypervisor, and emulates the intended effect, preserving isolation without altering the guest OS. Binary translation (A) rewrites code but is less efficient for frequent privileged ops; direct execution (C) would run the instruction unchecked, breaking isolation; shadow paging (D) deals with memory mapping, not instruction handling.

Q3. A cloud provider wants to run a hypervisor inside a guest VM to support nested virtualization. Which building block is essential to maintain performance and isolation for the inner guest?

A.Virtual CPU scheduler
B.I/O virtualization layer
C.Nested page tables ✅
D.Hypervisor API
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: The correct answer is C. Nested page tables extend the hardware paging mechanism to translate guest‑physical addresses to host‑physical addresses, allowing an inner guest to run with minimal overhead while preserving memory isolation. A virtual CPU scheduler (A) decides which VCPU runs but does not address address translation; an I/O virtualization layer (B) handles device access; a hypervisor API (D) provides management functions but does not implement the core memory mapping needed for nested virtualization. Therefore, nested page tables are essential for performance and isolation.

Q4. Why do type 0 hypervisors not require the same set of building blocks as type 1 hypervisors?

A.They run directly on hardware ✅
B.They rely on a host operating system
C.They lack support for virtual machines
D.They operate only in user mode
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The correct answer is A because a type 0 hypervisor, also called a bare‑metal hypervisor, runs directly on the physical hardware and therefore does not need the additional abstraction layers required by hosted hypervisors. Option B is false; type 0 does not rely on a host OS. Option C is incorrect because type 0 does support virtual machines. Option D misstates its mode of operation; it can manage both user and kernel modes. Hence, running on hardware eliminates many building‑block requirements.

Q5. Requiring an exact duplicate of the underlying machine increases which aspect of virtual machine monitor design?

A.Complexity of instruction‑set translation ✅
B.Need for simple memory management
C.Ease of I/O handling
D.Ability to use high‑level languages
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The correct answer is A. Providing an exact replica of the underlying machine forces the VMM to translate every guest instruction to an equivalent host instruction, which greatly increases the complexity of the instruction‑set translation module. Simple memory management (B) becomes more difficult, not easier; I/O handling (C) remains a separate challenge; and using high‑level languages (D) does not alleviate the need for precise translation. Thus, the demand for exactness primarily impacts instruction translation complexity.

Q6. When virtualizing a system with distinct user and kernel modes, which statement best describes the hypervisor’s role?

A.It must trap privileged instructions ✅
B.It can ignore mode differences
C.It only runs in user mode
D.It eliminates kernel mode
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The correct answer is A. To preserve isolation, a hypervisor must intercept (trap) any privileged instruction that would affect kernel state and then emulate its effect safely for the guest. Ignoring mode differences (B) would allow the guest to corrupt the host; running only in user mode (C) is impossible for a hypervisor that must control kernel resources; and eliminating kernel mode (D) contradicts the architecture of most CPUs. Therefore, trapping privileged instructions is essential.

Q7. What is the primary function of a hypervisor?

A.Software that creates and manages virtual machines ✅
B.Physical server hardware
C.Network routing device
D.Database management system
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The correct answer is A. A hypervisor is software that creates, runs, and manages virtual machines, allowing multiple operating systems to share the same physical hardware. Options B, C, and D describe unrelated hardware or software components: a physical server, a network router, and a database system respectively. Understanding the hypervisor’s role is fundamental for any virtualization discussion today globally.

🔗 Related Topics (MCQs)