• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to install KVM on Ubuntu 16.04 LTS Desktop

February 17, 2017 by Sharad Chhetri

KVM ( Kernel-based Virtual Machine ) is free and open source virtualisation software. You can create multiple VM (virtual machines) , each VM has its own private virtualised hardware like disk, CPU, RAM etc. It was included in Linux kernel mainline in kernel version 2.6.20.

In case you are looking for some alternate of VirtualBox, we will strongly suggest KVM to use. We are also personally using this awesome virtualisation software.

Prerequisites

For installing the KVM you must have following prerequisites.

1. Enable Virtualisation in your system BIOS.
2. Check your system CPU if it supports virtualisation. Run the given below command.

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

When you get the output from above command either 1 or more it means CPU supports the virtualisation else 0 or less means it does not support.

3. Check Ubuntu 16.04 LTS architecture by running one command i.e

arch

x86_64 represents 64 bit kernel.
i386, i486, i586 or i686 represents 32 bit kernel.

The 32-bit OS are limited to 2GB RAM at maximum for a given Virtual Machine.
32-bit kernel will only host 32-bit guest kernel whereas 64-bit kernel can host both 32-bit and 64-bit guest O.S.

Follow steps to install KVM on Ubuntu

In this section we will write down the steps to install the KVM. In our previous post we have learned to install KVM on Ubuntu 14.04 LTS Desktop.

1. Install KVM and other dependencies packages

In Ubuntu 16.04 LTS, you can use the command apt or apt-get both.There will be no differences in packages installed via apt or apt-get command so you are good here.

sudo apt update
sudo apt install qemu-kvm libvirt-bin bridge-utils

2. Know about new users and group for KVM software

Once you installed the packages, some addition will happen in number of users and group.

(a) Two users will be created.
– libvirt-qemu
– libvirt-dnsmasq

sharad@linuxworld:~$ tail -2 /etc/passwd
libvirt-qemu:x:64055:129:Libvirt Qemu,,,:/var/lib/libvirt:/bin/false
libvirt-dnsmasq:x:121:130:Libvirt Dnsmasq,,,:/var/lib/libvirt/dnsmasq:/bin/false
sharad@linuxworld:~$

(b) Two groups will be created.

– kvm
– libvirtd

sharad@linuxworld:~$ tail -2 /etc/group
kvm:x:129:
libvirtd:x:130:sharad
sharad@linuxworld:~$ 

You may have noticed the used called ‘sharad’ is member of group ‘libvirtd’. It means this user can use the KVM.

3. Verify KVM installation

This is quite easy to verify the KVM installation. Run the command –

virsh -c qemu:///system list

First time, it will show the error.

sharad@linuxworld:~$ virsh -c qemu:///system list
error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied
sharad@linuxworld:~$

To solve this, you should logout and login back in your desktop. Means the currently login user should re-login in system.

Once you are login back, re-run the command. This time you should get the output as given below. It is blank because no VM is created.

sharad@linuxworld:~$ virsh -c qemu:///system list
 Id    Name                           State
----------------------------------------------------

sharad@linuxworld:~$ 

4. Install Virtual Machine Manager

Here we are using Virtual Machine Manager which is a desktop application to manage the KVM virtual machines through libvirt.

Run this command to install Virtual Machine Manager.

sudo apt install virt-manager

You can open the Virtual Machine Manager by typing the same in Dash Home.Click the icon , it will open the application.

virtual machine manager

To open the Virtual Machine Manager through command line, type –

virt-manager

virt-manager

Earlier when we installed KVM in Ubuntu 14.04 LTS Desktop, we have faced problem while creating first VM where we solved it as well. In Ubuntu 16.04 LTS Desktop, we have not found as such any issue.

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Install KVM on Ubuntu 14.04 LTS Desktop
  2. Install KVM on Ubuntu 20.04 LTS Desktop
  3. Create desktop launcher in Unity Desktop Ubuntu 16.04 LTS
  4. Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)
  5. How to Upgrade Ubuntu 14.04 to 16.04 LTS Desktop
  6. Fixing Kazam crash on Ubuntu 20.04 LTS Desktop
  7. Install OpenShot 2.2 on Ubuntu 16.04 LTS Desktop
  8. Install Shotcut on Ubuntu 16.04 LTS desktop
  9. Install Eclipse Oxygen on Ubuntu 16.04 LTS desktop
  10. Install XFCE Desktop in Ubuntu through command line

Filed Under: Linux Tagged With: kvm, ubuntu, ubuntu 16.04 LTS, virtualization

Reader Interactions

Comments

  1. Skip says

    July 25, 2019 at 4:30 am

    Thank you for posting this. It is useful.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

Install and optimize the png file by using optipng

How to backup and restore iptables on Linux systems

safest method to remove softlink in linux

The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form

error command ‘gcc’ failed with exit status 1 in Ubuntu

How to encode and decode the strings with base64

WordPress host IP changed not able to open wp-admin and site page looks scattered

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy