Title: Install KVM software
Course: CIS 208: Linux/UNIX III: Intermediate System Administration, Networking, and Security ~ For IGNITE Review > Section: Learning Modules

The Kernel Virtual Machine (KVM) is actually implemented in the kernel.  This means that the software to run virtual machines are either included in the kernel or are loadable modules.  However it is still necessary to install software to manage the virtual environment.

yum groupinstall @virtualization*
yum install dejavu-lgc-* xorg-x11-xauth tigervnc \
libguestfs-tools policycoreutils-python bridge-utils

Ensure that the CPU is capable of running  libvirt.  If there is no output from the following command, the CPU does not support virtualization extensions which are required.

egrep'svm|vmx' /proc/cpuinfo

The main command is virsh, and it has many options.  Simply running virsh will enter an interactive mode where further subcommands can be typed.  In the following examples, options will be given to virsh so that it is not run interactively.

A virtual host is called a "domain".  Here is some of the output of the "help domain" subcommand.

# virsh help domain
Domain Management (help keyword 'domain'):
autostart                         autostart a domain
change-media                  Change media of CD or floppy drive
console                           connect to the guest console
create                            create a domain from an XML file
define                            define (but don't start) a domain from an XML file
destroy                          destroy (stop) a domain
edit                               edit XML configuration for a domain
managedsave                  managed save of a domain state
managedsave-remove      Remove managed save of a domain
reboot                           reboot a domain
reset                            reset a domain
restore                         restore a domain from a saved state in a file
resume                         resume a domain
save                             save a domain state to a file
screenshot                     take a screenshot of a current domain console and store it into a file
shutdown                       gracefully shutdown a domain
start                              start a (previously defined) inactive domain
suspend                         suspend a domain
undefine                        undefine a domain
#

Help is also available for the network keyword (for virtual networks), the pool keyword (for storage pools) and the volume keyword (for storage volumes).  Do not let the number of available subcommands startle you.  It is possible to learn how to manage systems using a few well-chosen commands with the default settings.

There is a management tool named virt-manager which provides most of the same options in a graphical environment.  Many people prefer to work with this tool instead of the command line.  However it is good to be aware of the command line methods, since they can be included in scripts.