Virtualization · Topic 1 of 1

Virtualization and Mainstream Technologies

Learn virtualization terms and features, Type 1 and Type 2 hypervisors, CPU, memory and I/O virtualization, and the Xen and KVM architectures for H13-511.

  • 5 min
In a nutshell
  • Features: partitioning, isolation, encapsulation, hardware independence.
  • Type 1 runs on bare metal; Type 2 runs on a host OS.
  • CPU virtualization: full (binary translation), paravirtualization (hypercalls, modified guest), hardware assisted (VT-x, AMD-V).

What it is

Virtualization abstracts physical resources so several virtual machines (VMs) can share one physical computer. Each VM has its own virtual CPU, memory, disks and NICs, and runs its own OS as if it had a whole machine.

The software that does this is the hypervisor, also called the VMM (virtual machine monitor).

Physical hostCPU, memory, disks, NICsHypervisorshares and isolatesVM 1guest OS and appsVM 2guest OS and apps

How it works

Key terms

The physical server is the host machine and each VM is a guest machine running a guest OS. The hypervisor sits between them.

Features of virtualization

FeatureMeaning
PartitioningOne physical server is divided into several VMs, each with its own share of resources
IsolationA fault, crash or attack in one VM does not affect the others
EncapsulationA whole VM is stored as files, so it can be copied, moved and backed up easily
Hardware independenceA VM sees standard virtual hardware, so it can run on any host with the same hypervisor

Hypervisor types

TypeWhere it runsExamplesNotes
Type 1 (bare metal)Directly on the hardwareXen, Microsoft Hyper-VBetter performance; used in data centers
Type 2 (hosted)As an application on a host OSOracle VirtualBoxEasy to install on a PC; extra layer costs performance

KVM is built into the Linux kernel: loading its module turns Linux itself into the hypervisor.

CPU virtualization

x86 CPUs have privilege rings. The OS kernel runs in ring 0 with full rights and applications in ring 3. A guest OS expects ring 0 too, but the hypervisor must keep it.

The classic method is trap and emulate: a privileged guest instruction traps to the hypervisor, which emulates it. Old x86 CPUs had some sensitive instructions that did not trap, so three solutions appeared.

ApproachHow it worksGuest OS change
Full virtualizationThe hypervisor uses binary translation to replace problem instructions at run timeNone
ParavirtualizationThe guest kernel is modified to call the hypervisor directly with hypercallsModified guest kernel
Hardware-assisted virtualizationThe CPU adds a root mode for the hypervisor and a non-root mode for guests (Intel VT-x, AMD-V)None

Hardware assistance is the standard today.

Memory virtualization

A VM believes it owns contiguous physical memory starting at address 0. The hypervisor maps this guest physical memory onto real host physical memory.

Early hypervisors kept shadow page tables in software. Modern CPUs do this translation in hardware, with Intel EPT and AMD NPT, which cuts the overhead.

I/O virtualization

MethodHow it worksPerformance
Full emulationSoftware (such as QEMU) emulates a real device; the guest uses its normal driverLowest
Paravirtualized I/OThe guest uses special front-end drivers, such as virtio, that talk to back-end drivers on the hostHigh
Device passthroughA physical device or SR-IOV virtual function is given to one VMHighest, but harder to migrate

Xen

Xen is a Type 1 hypervisor that runs directly on the hardware. The first VM it starts, Domain 0 (Dom0), is privileged. Dom0 holds the real device drivers and the management tools, and handles I/O for the other VMs.

Ordinary VMs are Domain U (DomU). Xen supports paravirtualized guests (PV) with modified kernels and hardware virtualized guests (HVM) on CPUs with VT-x or AMD-V.

KVM

KVM (Kernel-based Virtual Machine) is a module in the mainline Linux kernel: kvm.ko plus kvm-intel.ko or kvm-amd.ko. It needs hardware-assisted virtualization.

PartRole
KVM kernel moduleVirtualizes CPU and memory using VT-x or AMD-V
QEMURuns in user space and emulates devices such as disks and NICs
virtioParavirtualized drivers for fast disk and network I/O
libvirtManagement API and tools such as virsh

Each KVM VM is an ordinary Linux process (QEMU), and each vCPU is a thread scheduled by the Linux kernel. Huawei FusionCompute CNA hosts use KVM based virtualization.

grep -E 'vmx|svm' /proc/cpuinfo   # CPU supports Intel VT-x (vmx) or AMD-V (svm)
lsmod | grep kvm                  # KVM modules are loaded
virsh list --all                  # list VMs managed by libvirt
virsh or management toollibvirtQEMU processone per VMKVM modulein the Linux kernelCPUhardware assistance

A worked example

A team runs 20 Linux VMs on one server. Partitioning gives each its own vCPUs and memory, and isolation contains a crash in one VM.

On a KVM host, each VM appears in ps as a QEMU process. Installing virtio drivers in the guests replaces emulated disks and NICs and raises I/O performance.

How the exam asks about this

  • "Which virtualization approach requires a modified guest OS kernel?" → Paravirtualization.
  • "In Xen, which domain holds the physical device drivers?" → Domain 0.
  • "Which component of a KVM platform emulates I/O devices?" → QEMU.

What to remember for the exam

  • Features: partitioning, isolation, encapsulation, hardware independence.
  • Type 1 runs on bare metal; Type 2 runs on a host OS.
  • CPU virtualization: full (binary translation), paravirtualization (hypercalls, modified guest), hardware assisted (VT-x, AMD-V).
  • Xen: Dom0 privileged with drivers, DomU guests, PV and HVM modes.
  • KVM: Linux kernel module, needs VT-x or AMD-V, QEMU for devices, libvirt for management.
Watch out

KVM does not emulate devices by itself. The kernel module handles CPU and memory; QEMU, or virtio drivers with their back ends, handle disk and network I/O.

Common mistakes

Mixing up paravirtualization and hardware assistance. Paravirtualization changes the guest kernel. Hardware assistance changes the CPU and leaves the guest unchanged.

Thinking isolation means no shared hardware. VMs share the same physical CPUs and memory. Isolation means one VM cannot see or harm another, not that each has dedicated hardware.

Treating Domain 0 as an ordinary VM. Dom0 is the privileged management domain. If it fails, the guests that rely on it for I/O fail too.

Check yourself

  • What does encapsulation mean in virtualization?

    The whole VM is stored as a set of files, so it can be copied, moved, backed up or turned into a template easily.

  • What is the difference between Type 1 and Type 2 hypervisors?

    A Type 1 hypervisor runs directly on the hardware. A Type 2 hypervisor runs as an application on top of a host OS.

  • Why does KVM need Intel VT-x or AMD-V?

    KVM relies on hardware-assisted virtualization to run guest code in the CPU's non-root mode instead of emulating privileged instructions in software.

Topic 1 of 1 in Virtualization

Test yourself on Virtualization

The full Huawei H13-511 question bank has 600 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Huawei. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.