The KVM hypervisor requires: An Intel processor with the Intel VT-x and Intel 64 virtualization extensions for x86-based systems or An AMD processor with the AMD-V and the AMD64 virtualization extensions. Virtualization extensions (Intel VT-x or AMD-V) are required for full virtualization. Enter the following commands to determine whether your system has the hardware virtualization extensions, and that they are enabled.
Execute the following command in host machine
grep -E 'svm|vmx' /proc/cpuinfo
Sample output:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts md_clear flush_l1d
The output contains a vmx entry, indicating an Intel processor with the Intel VT-x extension or an svm entry is sufficient for virtualization.
lsmod | grep kvm
Sample output:
kvm_intel 372736 104
kvm 1032192 1 kvm_intel
If the output includes kvm_intel or kvm_amd, the kvm hardware virtualization modules are said to be loaded.
To see supported CPU models for an architecture type, execute:
ls /usr/share/libvirt/
The qemu-img package is installed as a dependency of the qemu-kvm package.
apt install qemu-kvm libvirt
virsh: The virtual shell, or virsh, is a flexible command-line utility for managing virtual machines (VMs) controlled by libvirt, which is a toolkit and API to manage virtualization platforms. It’s the default management tool for Linux kernel-based virtual machines (KVMs), and it also supports Xen, VMware, and other platforms.
virt-install: This package provides the virt-install command for creating virtual machines from the command line.
libvirt-python: This package contains a module that permits applications written in the Python programming language to use the interface supplied by the libvirt API.
virt-manager: This package provides the virt-manager tool, also known as Virtual Machine Manager. This is a graphical tool for administering virtual machines. It uses the libvirt-client library as the management API.
libvirt-client: This package provides the client-side APIs and libraries for accessing libvirt servers. The libvirt-client package includes the virsh command-line tool to manage and control virtual machines and hypervisors from the command line or a special virtualization shell.
We mostly use virsh
, virt-install
utilities to create and manage virtual machines and this virtual architecture.
install virt-install libvirt-python virt-manager virt-install libvirt-client
To install cockpit:
apt install cockpit
By default, cockpit listens on port 9090
on host system. One can access from browser using the url :9090. You can login using your host machine’s username and password to manage the server from browser.
To install:
apt install cockpit-machines