How to install KVM on Ubuntu Server 20.04 LTS ?

KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). It consists of a loadable kernel module, kvm.ko, that provides the core virtualization infrastructure and a processor specific module, kvm-intel.ko or kvm-amd.ko.

Run the below command to check whether the system supports virtualization:

    # egrep -c  '(vmx|svm)' /proc/cpuinfo
      16

If the above count is non zero, that indicates that system supports virtualization.

Install 'cpu-checker' to make sure that your system is supported for KVM based virtualization.

    # apt-get install cpu-checker -y








Install all required package to configure KVM:

    # apt-get install -y qemu qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager

  • qemu-kvm: A software that provides hardware emulation for the kvm hypervisor.
  • libvirt-daemon: A virtualization daemon that manages the lifecycle of the vm.
  • bridge-utils: This is used to configure the kvm bridge in the hypervisors. 
  • virt-manager: Its a GUI interface to manage the virtual machines in the kvm host.

Start and enable the libvirtd daemon:

    # systemctl  start libvirtd
    # systemctl enable libvirtd





If you need to access the virt-manage tool from non-root user(lets say 'ubuntu'), then add it to libvirt & kvm group using the below command:

    $ sudo usermod -aG libvirt $USER
    $ sudo usermod -aG kvm $USER

Now reboot the system and once its back, it should be ready to use.






Comments

Popular posts from this blog

How to build Ubuntu Server 20.04 LTS OVA with vAPP Properties ?

VNC Configuration using Ansible in CentOS 7

LVM Configuration using Ansible in CentOS 7