2 Virtualization
Gytis Repečka edited this page 2026-04-22 09:13:34 +03:00

There are three main types of virtualization.

Full virtualization

Virtualization artifacts are called Virtual Machines (VMs). VMs uses their own Kernel Space and User Space, devices are virtual.

It is, however, common for hypervisors to allow directly sharing selected host's USB devices to a VM.

flowchart TB    
    subgraph vm[Virtual Machine]
        vm_user[User Space]
        vm_kernel[Kernel Space]
    end
    
    abstraction[Layer of Abstraction]
        
    hypervisor[Hypervisor]
        
    vm --- abstraction --- hypervisor

Examples: VirtualBox, QEMU/KVM.

Containerization

Virtualization artifacts are called Containers. Containers reuse host's Kernel Space and uses their own User Space.

Devices are not virtualized - depending on hypervisor, devices of the host may be made available to a container.

flowchart TB    
    subgraph container[Container]
        container_user[User Space]
        
    end
    
    abstraction[Layer of Abstraction]
    
    kernel[Kernel Space]
    
    hypervisor[Hypervisor]
        
    container --- abstraction --- kernel --- hypervisor

Examples: Docker, LXC, OpenVZ.

Note: there is distinction whick Kernel is used by a container depending how Docker is run: if through Docker Desktop, it actually runs a VM and all containers in it - hence QEMU is visible in process list and Kernel of that VM is used. However, if Docker is ran as system service, container uses host's Kernel as normal container would.

Application level isolation

Virtualization artifacts are called jailed applications, which share the same User Space and the same Kernel Space of the host.

Examples: chroot, SELinux.