Install KVM on Ubuntu 14.04/16.04

This post will guide you how to install and configure KVM and create a virtual machines on Ubuntu 14.04/16.04 Linux. How to install and setup KVM on Ubuntu 18.04 to create a VM guest.

What is KVM?


Kernel Virtual Machine 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. Using KVM, one can run multiple virtual machines running unmodified Linux or Windows images. Each virtual machine has private virtualized hardware: a network card, disk, graphics adapter, etc.

KVM Installation


#1 Pre-installation Checklist

You need to check that you CPU supports hardware virtualization, and you need to make sure that you Intel or AMD CPU have developed extensions for their processors, deemed respectively Intel VT-x  and AMD-V. Type the following command to check the compatibility:

# egrep –c ‘(vmx|svm)’ /proc/cpuinfo

If the output of this command is 1 or greather than 1, and it indicates that you system can be used to create VM guest with KVM virtualization technology.

#2 Install KVM Packages

Type the following command:

$ sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils

#3  Verify KVM installation

Type the following command:

# kvm-ok

Or

#virsh –c qemu:///system list

Outputs:

[root@devops ~]# virsh -c qemu:///system list

Id    Name                           State

----------------------------------------------------

#4 install Virtual Machine Manager

You can install an virtual machine manager which is a desktop application to manage the KVM virtual machines through libvirt.

Type the following command:

# apt install virt-manager

After you have installed virt-manager package, just run the following command to startup virtual manager application.

# virt-manager

Then you can follow the guide to create a new virtual machine.

 

You might also like:

Sidebar



back to top