aboutsummaryrefslogtreecommitdiffstats

KVM

GPLv3
KVM by Jean-Christophe Manciot is licensed under a GPLv3 License.

Table of Contents

Preliminary Checks

First off, you should make the following checks:

  • your system must be compatible:
    • sudo kvm-ok
    • INFO: /dev/kvm exists
    • KVM acceleration can be used
  • Then the following will give you the number of vCPUs available on your system:
    • sudo egrep -c '(vmx|svm)' /proc/cpuinfo
    • 8 (for instance)
  • If you intend to use nested acceleration (KVM in KVM VM):
    • sudo cat /sys/module/kvm_intel/parameters/nested
    • Y

KVM Packages

The following packages are necessary tu run KVM and its manager, along with some Optional guest VM tools.

Qemu

  • edk2: UEFI firmware for 64-bit x86 virtual machines. The source code comes from the official Debian repository.
  • libosinfo: Library for managing information about operating systems and hypervisors. The source code comes from the official Debian repository.
  • osinfo-db: osinfo-db provides the database files for use with the libosinfo library. The source code comes from the official Debian repository.
  • osinfo-db-tools: This package contains a set of tools to assist administrators and developers in managing the osinfo-db database. The source code comes from the official Debian repository.
  • qemu: Generic and open source machine emulator and KVM Hypervisor. The source code comes from the official Debian repository.
    • It might be necessary to change the permissions of the qemu binaries with:
    • chown -v root:libvirt-qemu /usr/bin/kvm /usr/bin/qemu\*
  • seabios: SeaBIOS is an open source implementation of a 16bit X86 BIOS. SeaBIOS can run in an emulator or it can run natively on X86 hardware with the use of coreboot. SeaBIOS is the default BIOS for qemu and kvm. The source code comes from the official Debian repository.

Libvirt

1) libsys-virt-perl: [Optional] Libvirt Perl bindings. The source code comes from the official Debian repository.

2) libvirt: Library for interfacing with hypervisors such as KVM/Qemu - VirtualBox - VMware - ESX - OpenVZ - LXC... The source code comes from the official Debian repository.

  • It is necessary to configure the security driver in /etc/libvirt/qemu.conf as one of the following drivers:
    • none
    • apparmor
    • selinux
  • In the case where Apparmor has not been chosen, it might also be necessary to disable Libvirt Apparmor profiles with:
    • ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
    • apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
    • ln -s /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper /etc/apparmor.d/disable/
    • apparmor_parser -R /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper
    • aa-status | grep -i libvirt

3) libvirt-glib: Mapping of the libvirt API and XML to GLib/GObject. The source code comes from the official Debian repository.

4) libvirt-python: Libvirt Python bindings. The source code comes from the official Debian repository.

5) ocaml-libvirt: [Optional] Libvirt OCAML bindings. The source code comes from the official Debian repository.

Libguestfs

Spice

Virt-Manager

Virtual Machine Manager Screenshots


alt Main Menu


Virtual Networks Settings

alt Virtual Networks Settings


Virtual Storage Settings

alt Virtual Storage Settings


Virtual Machine Settings

alt Virtual Machine Settings


Notes

  • all technical details about KVM (Kernel Virtual Machine) are available here.
  • to get the best performances, I recommend to adjust the CPU settings of your VMs in VM Manager to either "Copy host CPU configuration" or "host-passthrough".
  • If you encounter some incompatibilities, you may need to disable Network Manager:
    • sudo systemctl stop NetworkManager
    • sudo systemctl disable NetworkManager
    • Configure your /etc/network/interfaces with auto interface-name & iface interface-name inet(6) dhcp|auto|static statements; cf. for example http://unix.stackexchange.com/questions/128439/good-detailed-explanation-of-etc-network-interfaces-syntax
    • sudo systemctl stop ifup-wait-all-auto
    • sudo systemctl disable ifup-wait-all-auto
    • sudo systemctl mask ifup-wait-all-auto otherwise you won't be able to boot if a single interface does not come up.