Linux KVM and Ubuntu

In this post, I explain Linux KVM in simple terms and show how to download and use ISO of your choice in this case Ubuntu Satanic Edition.


What Is a Linux KVM?

A KVM, or Kernel-based Virtual Machine, is a Linux kernel module that turns your operating system into a hypervisor — a platform that can run multiple virtual machines (VMs) on the same hardware.

KVM supports both Intel and AMD processors with hardware virtualization extensions (Intel VT-x or AMD-V). With KVM, your Linux system can manage and run isolated operating systems, sharing physical hardware resources.

If you’re unfamiliar, a hypervisor is software that allows multiple operating systems to run on a single machine while sharing the CPU, RAM, disk, and other resources.

        +----------------+     +----------------+     +----------------+
        |   App A1       |     |   App B1       |     |   App C1       |
        |   App A2       |     |   App B2       |     |   App C2       |
        +----------------+     +----------------+     +----------------+
        |    OS A        |     |    OS B        |     |    OS C        |
        +----------------+     +----------------+     +----------------+
                  \               |               /
                   \              |              /
                    \             |             /
                     \            |            /
                    +----------------------------------+
                    |           Hypervisor             |
                    |  (Virtual Machine Monitor, VMM)  |
                    +----------------------------------+
                    |      Shared Physical Hardware     |
                    |  - CPU                            |
                    |  - RAM                            |
                    |  - Disk / Storage                 |
                    |  - Network Interfaces             |
                    |  - GPU / I/O Devices              |
                    +----------------------------------+

The hypervisor is essential, without it, you wouldn’t be able to run VMs on your machine. The amazing thing is that with KVM, your Linux kernel becomes the hypervisor itself, no need for external software like VMware or VirtualBox (although those are fine options too).

As long as you’re using a Linux distro and have a compatible Intel or AMD CPU, you’re good to go!


🔧 Key KVM Components

To install them:

sudo apt install qemu-system-x86 libvirt-daemon-system virtinst \
virt-manager virt-viewer ovmf swtpm qemu-utils guestfs-tools \
libosinfo-bin tuned

Instructions

lscpu | grep Virtualization

zgrep CONFIG_KVM /boot/config-$(uname -r)

Output should be this.

CONFIG_KVM_GUEST=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_COMPAT=y
CONFIG_KVM_XFER_TO_GUEST_WORK=y
CONFIG_KVM=m
CONFIG_KVM_WERROR=y
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_KVM_AMD_SEV=y

sudo usermod -aG kvm YOURUSER

sudo systemctl start libvirtd && sudo systemctl enable libvirtd

Step1

Step3

Step2

Step3

Step4

Ubuntu