Libvirt is a CLI (command line interface) tool to use to run virtual machines on linux. On linux the hypervisor kvm is built into the kernel and allows support for full hardware virtualization. This guide is for installing Virt-Manager on Ubuntu Systems.

Prerequisites

Make sure your computer can run virtual machines by using the “kvm-ok” command in a terminal. Also note you may need to enable virtual machine support in the BIOS. usually that setting is enabled by default, but it’s good to check there if these commands below don’t work.

$ kvm-ok

If KVM is enabled on your machine. You will see something similar

$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

You may need to install the cpu-checker program if you receive an error message trying to run kvm-ok. You can do that by running these commands below:

$ sudo apt update
$ sudo apt install cpu-checker

Installation

I installed all of the necessary CLI tools by installing the graphical tool virt-manager. Choosing that route allows installs the necessary files the CLI tools use.

An advantage of this is you’ll have access to a graphical software incase you need to visualize beyond the command line. You can install by typing in a terminal:

$ sudo apt install virt-manager

Libvirt should now be installed after that command finishes installing.

You can give your user account access to manipulate the virtual machines without using sudo. To do so you’ll need to add your user account to the kvm group and libvirt group.

(Note: using $USER variable holds name of current logged in user. so if you’re not logged in as the user you’d like to have access replace $USER with the correct username. )

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

Now you can search for “Virtual Machine Manager” in your list of programs and create virtual machines using a GUI.

CLI Guide is coming soon

Stay tuned for PT 2. of this guide. Which will cover how to use the CLI to install and edit virtual machines.