📝 I/O virtualization in operating system (13 MCQs)
Virtual Devices and Guest Input Output Operations
I/O virtualisation allows guest operating systems to access storage, network interfaces, and other devices through virtual hardware or specialised virtual drivers. The hypervisor or host I/O backend mediates requests and maps them to physical devices. This enables multiple guests to share hardware while preserving separate device views and controlled access.
Why Physical Devices Cannot Be Shared Without Mediation
Guest operating systems expect to control device registers, interrupts, and data transfers. Allowing each guest unrestricted access to one physical controller could cause interference or expose data. I/O virtualisation provides a controlled interface, coordinates ownership, and routes requests to the appropriate hardware or software backend.
Device Emulation, Paravirtual Drivers and Passthrough
Device emulation presents a hardware model that existing guest drivers understand. Paravirtual drivers use an interface designed for virtualisation to reduce emulation overhead. Device passthrough assigns a physical device or function to a guest, often using IOMMU protection to restrict its direct memory access to authorised regions.
Example of a Virtual Network Interface
Two guest machines each receive a virtual network interface connected to a virtual switch. When one guest sends a packet, its virtual driver submits the data to the hypervisor network backend. The backend forwards it through the virtual switch and, when required, the physical network adapter.
Performance and Device Sharing Constraints
I/O virtualisation supports isolation, portability, and flexible device allocation. Emulation may add CPU overhead, while paravirtual drivers generally reduce some of that cost. Passthrough can improve performance but reduce sharing flexibility and complicate migration. IOMMU configuration, driver compatibility, interrupts, and host bandwidth affect security and throughput.
Misconceptions About Virtual I/O
'Every virtual device is a physical device dedicated to one guest' is false because devices may be shared or emulated. 'Passthrough requires no protection' ignores IOMMU isolation. 'Paravirtual drivers and device emulation are identical' overlooks their different interfaces and processing paths.
Exam Focus: Emulation, Paravirtualisation and Passthrough
Compare the three main I/O virtualisation approaches by compatibility, performance, isolation, and sharing. Trace a guest network or disk request through its virtual driver and host backend. Questions may examine device passthrough, IOMMU protection, virtual switches, and why direct assignment can complicate live migration.
Key Terms of I/O Virtualisation
- Device emulation - Software reproducing a hardware interface.
- Paravirtual driver - Driver using a VM-specific interface.
- Passthrough - Direct assignment of a physical device.
- IOMMU - Controls device memory access and translation.
- Virtual switch - Software connecting virtual network interfaces.
📝 All I/O virtualization in operating system MCQs
Q1. What is the primary characteristic that distinguishes a type 0 hypervisor from other hypervisor types?
📖 Explanation: The correct answer is C because a type 0 hypervisor resides in hardware or firmware and is initialized during system boot, unlike software‑based hypervisors. Option A describes a type 2 hypervisor, which runs after the OS is up. Option B also refers to a type 2 scenario where the hypervisor is an application. Option D is too narrow, as type 0 hypervisors manage CPU, memory, and I/O, not just networking. Understanding this hardware‑level placement helps explain why type 0 offers low‑overhead access to physical resources.
Q2. Which term describes the situation where a system has so many virtual machines that tracking their usage and state becomes difficult?
📖 Explanation: The correct answer is B because VM sprawl refers to an uncontrolled increase in the number of virtual machines, making management and tracking hard. Option A, VM migration, is the movement of a VM between hosts. Option C, snapshotting, captures a VM's state at a point in time. Option D, consolidation, is the opposite process—reducing the number of VMs. Recognizing sprawl is essential for administrators to implement policies that keep virtual environments organized and efficient.
Q3. A server has four virtual machines but only two physical Ethernet ports. Which strategy best ensures each VM can communicate externally while minimizing performance impact?
📖 Explanation: The correct answer is B because a software bridge (or virtual switch) can multiplex the two physical NICs, allowing all VMs to send and receive traffic while the hypervisor handles packet forwarding efficiently. Option A leaves most VMs isolated, which defeats the purpose. Option C requires hardware that does not exist, and Option D unnecessarily disables needed network access. Using a bridge mirrors real‑world data‑center practices where limited NICs are shared safely among many guests.
Q4. Why does a virtual machine manager typically free disk space before removing configuration files when deleting a VM?
📖 Explanation: The correct answer is D because deleting configuration files first could orphan the virtual disks, causing unused storage to remain allocated and waste capacity. Option A oversimplifies the priority; while disk space is important, the order matters. Option B is inaccurate; configuration files can be removed independently of power state. Option C misstates snapshot behavior—snapshots are linked to the disk, not the config. Proper deletion order mirrors best practices in cloud environments, preventing hidden storage bloat.
Q5. An administrator clones a production web server VM to create a test instance. Which action is essential after cloning to avoid network conflicts?
📖 Explanation: The correct answer is B because a cloned VM retains the original IP address, leading to duplicate IP conflicts on the network; assigning a new address and updating DNS resolves this. Option A alone is insufficient—most hypervisors automatically generate a new MAC. Option C would eliminate the source VM, which is unnecessary. Option D changes storage size but does not affect networking. Real‑world cloning workflows always include IP reconfiguration to keep test and production environments separate.
Q6. If a hypervisor must support six guest VMs but only three physical NICs are available, which configuration provides the most balanced solution?
📖 Explanation: The correct answer is B because mapping each physical NIC to a virtual switch and attaching two VMs per switch distributes bandwidth evenly and provides redundancy. Option A sacrifices network connectivity for half the VMs. Option C creates a single bottleneck, leading to high contention. Option D is impractical and introduces latency due to USB overhead. Data‑center administrators often employ virtual switches to maximize limited NIC resources while maintaining acceptable performance for all guests.
Q7. How does implementing a hypervisor as a type 0 hardware feature affect I/O device isolation compared to a type 2 software hypervisor?
📖 Explanation: The correct answer is A because a type 0 hypervisor runs directly on hardware, allowing the firmware to partition I/O devices so each guest can have its own dedicated path, enhancing isolation. Option B is false; type 0 reduces emulation overhead. Option C misrepresents type 2 behavior—dynamic allocation often incurs performance costs. Option D is incorrect because even with hardware partitioning, sharing may still be required when devices are scarce. This hardware‑level isolation is why many high‑performance systems prefer type 0 solutions.
Q8. Design an I/O allocation plan for five VMs on a host with two physical NICs, ensuring that at least three VMs have guaranteed bandwidth of 100 Mbps. Which plan satisfies this requirement?
📖 Explanation: The correct answer is B because grouping VMs under virtual NICs that share a physical NIC allows the administrator to apply traffic‑shaping rules, ensuring the three critical VMs receive at least 100 Mbps each. Option A leaves one VM without dedicated bandwidth and cannot guarantee the required rate. Option C adds hardware that does not exist in the scenario. Option D lacks shaping, so no bandwidth guarantee can be enforced. Real‑world deployments often rely on shaping policies to meet service‑level agreements for specific workloads.
Q9. A cloud provider notices rapid VM sprawl across its data center. Which policy combination is most effective at curbing uncontrolled VM proliferation?
📖 Explanation: The correct answer is A because requiring strong authentication reduces unauthorized VM creation, and periodic reviews of unused VMs help identify and delete unnecessary instances, directly tackling sprawl. Option B limits resources but does not stop users from creating many VMs. Option C hampers backup and recovery practices without addressing the root cause. Option D may discourage excessive VMs but does not prevent their creation. Effective sprawl control combines access controls with regular housekeeping, mirroring industry best practices.
Q10. Why do guests in a type 0 hypervisor environment believe they have dedicated hardware resources?
📖 Explanation: The correct answer is B because a type 0 hypervisor leverages hardware partitioning, allocating distinct CPU cores, memory regions, and I/O channels to each guest, so the guest OS sees those resources as exclusive. Option A describes software emulation typical of type 2 hypervisors. Option C ignores the underlying hardware allocation. Option D mischaracterizes the role of the host OS, which is not involved in a type 0 scenario. Recognizing this hardware partitioning explains why guests experience performance comparable to bare metal.
Q11. What is the main challenge when sharing a limited number of I/O devices among many virtual machines in a type 0 hypervisor setup?
📖 Explanation: The correct answer is B because limited I/O devices must be multiplexed among guests, and the hypervisor must schedule access to avoid bandwidth bottlenecks and latency spikes. Option A is a driver‑management issue, not a sharing challenge. Option C is unrelated, as BIOS settings are not typically virtualized per VM. Option D concerns security, which is important but secondary to the fundamental contention problem. In practice, administrators use QoS and throttling to mitigate this contention.
Q12. After deleting a VM, an administrator notices that the allocated storage is still reported as used. What is the most likely cause?
📖 Explanation: The correct answer is B because if the virtual disk file remains attached or is not explicitly deleted, the storage it occupies continues to be reported as in use. Option A would affect only configuration metadata, not storage consumption. Option C is not a typical behavior of modern hypervisors. Option D describes a power‑state issue, which does not affect disk usage. Understanding this helps administrators ensure proper cleanup procedures after VM removal to reclaim valuable storage.
Q13. How can uncontrolled VM sprawl negatively affect I/O performance in a data center?
📖 Explanation: The correct answer is B because as more VMs are created without proper management, they compete for the same physical I/O channels, causing queues to grow and latency to rise, which degrades overall performance. Option A addresses CPU resources, not I/O. Option C is false; sprawl does not disable interfaces. Option D misstates hypervisor types—sprawl does not change the hypervisor mode. Data‑center operators monitor VM counts to prevent I/O bottlenecks and maintain service‑level expectations.