---
title: "Virtual machine structure and benefits"
subject: "Operating System"
chapter: 1
key: "semester_6/operating_system:virtual-machine-structure"
source: https://www.bctengineer.com/q/semester_6/operating_system/virtual-machine-structure
site: BCT Engineering
---

# Virtual machine structure and benefits

Operating System · Chapter 1: Introduction to Operating System

- Asked in: 2072 Asoj, 2+2 marks; 2074 Bhadra, 2+2 marks (asked 2 times)
- Video: [Virtual Machines](https://www.youtube.com/watch?v=daDbY2iDmU0) — Neso Academy
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/virtual-machine-structure
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-1

## Question

Explain the virtual machine structure. What are the benefits over other operating system structures?

## Short answer

A virtual machine structure uses a hypervisor on bare hardware to create multiple virtual machines, each running its own guest OS. Benefits include complete isolation between VMs, running different OSs simultaneously, safe system development, better hardware utilization, and easy backup and migration.

## Answer

#### Structure

A **virtual machine (VM) system** (IBM VM/370) separates multiprogramming from the "extended machine" function. A bare-metal program called the **virtual machine monitor (hypervisor)** runs directly on the hardware and creates several *virtual machines*, each an exact copy of the real hardware (including kernel/user mode, I/O and interrupts). Each virtual machine runs its own operating system, which may be different on each VM.

```text
 VM1         VM2         VM3
+-------+   +-------+   +-------+
| App   |   | App   |   | App   |
| Guest |   | Guest |   | Guest |
| OS 1  |   | OS 2  |   | OS 3  |
+-------+   +-------+   +-------+
+---------------------------------+
| Virtual machine monitor         |
+---------------------------------+
| Real hardware (CPU, RAM, disk)  |
+---------------------------------+
```

When an application makes a system call, it traps to the guest OS in its own VM. When that guest OS then executes a privileged instruction (for example, an I/O instruction), it traps to the monitor, which carries it out (emulates it) for that VM.

#### Benefits over other OS structures

- **Complete protection and isolation**: VMs are separate, so a crash or virus in one VM does not affect the others or the host.
- **Different OSs on one machine**: Linux, Windows and others run side by side, which helps portability testing.
- **Safe system development**: OS development and testing can be done on a VM without halting the production machine.
- **Better hardware utilisation**: many lightly loaded servers can be consolidated onto one physical machine.
- **Easy backup and migration**: a VM image can be saved, cloned or moved to another host.

The drawbacks are slower I/O and CPU performance because of the extra layer, and difficulty in sharing resources between VMs.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does the virtual machine monitor (hypervisor) do?
   A. Runs directly on hardware and creates several virtual machines, each an exact copy of the hardware
   B. Runs on top of one guest OS and schedules its processes
   C. Replaces all guest operating systems with a single common OS
   D. Only compiles programs for the guest OS
   Answer: A. The monitor runs on bare hardware and provides multiple exact copies of the hardware, each running its own OS. (Key point: VMM role)

2. What happens when a guest OS executes a privileged instruction?
   A. It runs directly on the hardware without any check
   B. It traps to the monitor, which emulates it for that VM
   C. It crashes all other virtual machines
   D. It is ignored by the hardware
   Answer: B. The guest runs in virtual kernel mode; privileged instructions trap to the VMM, which emulates them. (Key point: Privileged instruction in guest)

3. Why does a crash or virus in one VM not affect the others?
   A. All VMs share one guest OS and memory space
   B. The monitor automatically repairs the crashed VM
   C. VMs are completely separate and isolated from each other and from the host
   D. Viruses cannot run inside virtual machines
   Answer: C. Complete protection and isolation is a main benefit of the VM structure. (Key point: Isolation benefit)

4. Which is a drawback of the virtual machine structure?
   A. Only one operating system can be run at a time
   B. It cannot be backed up or migrated
   C. It gives no protection between systems
   D. Slower I/O and CPU use due to the extra layer, and difficulty sharing resources between VMs
   Answer: D. The extra monitor layer adds overhead and makes resource sharing between VMs hard. (Key point: Drawbacks)

## Related in Operating System

- [OS as virtual machine; functions](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aos-virtual-machine-functions) — Operating System, chapter 1
- [File system vs virtual memory; contiguous allocation](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afs-vs-virtual-memory-contiguous-tape) — Operating System, chapter 5
- [OS abstraction, extended machine, system call](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aos-abstraction-system-call) — Operating System, chapter 1
- [Extended machine, kernel, system call](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aextended-machine-kernel-syscall) — Operating System, chapter 1
- [Page fault; virtual to physical address](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Apage-fault-64k-virtual-32k-physical) — Operating System, chapter 4
- [Virtual memory management; thrashing](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Avirtual-memory-thrashing) — Operating System, chapter 4

## Related in other subjects

- [Advantages of electrical energy over other forms](https://www.bctengineer.com/question.md?key=semester_7%2Futilization_of_electrical_energy%3Aadvantages-electrical-energy-other-forms) — Utilization of Electrical Energy, chapter 1, asked 2×
- [Benefits of three-phase over single-phase delivery](https://www.bctengineer.com/question.md?key=semester_4%2Fpower_system_analysis_i%3Athree-phase-benefits-over-single) — Power System Analysis I, chapter 1, asked 2×
- [Project financing; structures; capital structure steps](https://www.bctengineer.com/question.md?key=semester_7%2Fproject_engineering%3Aproject-finance-define-structures-steps) — Project Engineering, chapter 6
- [Strategic information system and benefits](https://www.bctengineer.com/question.md?key=semester_8%2Finformation_system%3Astrategic-is-benefits) — Information System, chapter 1, asked 2×
