# yum install kvm qemu-kvm python-virtinst libvirt libvirt-python virt-manager libguestfs-tools
Post installation steps: turn on libvirtd service
The libvirtd program is the server side daemon component of the libvirt virtualization management system. Type the following chkconfig command to turn it on:
# chkconfig libvirtd on
Start the libvirtd service by typing the following service command:
# service libvirtd start
You can verify the libvirtd service by tying the following commands:
# service libvirtd status libvirtd (pid 31128) is running... # virsh -c qemu:///system list Id Name State ----------------------------------------------------
Virt-manager
virt-manager (http://virt-manager.org/) uses libvirt to create pretty flexible and powerful enough GUI interface that allows you to creewate an manage VMs.
It is the most populatr GUI-frontend for libvirt, allowing users to create and manage guest virtual machines on libvirt-supported hypervisors such as QEMU/KVM or Xen.
virt-manager can control a host-local hypervisor as well as remote host's hypervisor (over SSH), giving users a location-transparent management interface for virtual machines. For remote desktop access on guest operating systems, virt-manager offers integrated remote desktop sessions via VNC and Spice.
6.3. Creating Guests with virt-manager - Red Hat Customer Portal
when you start your VM, a separate qemu-kvm
process is launched by libvirtd
at the request of system management
utilities, such as virsh
and virt-manager
. The properties of the virtual machines (number of CPUs, memory
size, I/O device configuration) are stored in XML files, which are located in the directory /etc/libvirt/qemu
.
virsh -- command line interface to libvirt
The command line client interface of libvirt is the binary called virsh
. libvirt is also used by other higher-level
management tools.
Most people think that libvirt is restricted to a single node or local node where it is running; it's not true. libvirt has remote
support built into the library. So, any libvirt tool (for example virt-manager) can remotely connect to a libvirt daemon over the network,
just by passing an extra –connect
argument. One of libvirt's clients (the virsh
binary provided by the libvirt-client
package) is shipped with Red Hat.
The goal of the libvirt library is to provide a common and stable layer to manage VMs running on a hypervisor. In short, as a management
layer it is responsible for providing the API that does management tasks such as virtual machine provision, creation, modification,
monitoring, control, migration, and so on. In Linux, you will have noticed some of the processes are deamonized. The libvirt process
is also deamonized, and it is called libvirtd
. As with any other daemon process, the libvirtd provides services to its
clients upon request. Let us try to understand what exactly happens when a libvirt client such as virsh or virt-manager requests a service
from libvirtd
. Based on the connection URI (discussed in the following section) passed by the client, libvirtd opens a
connection to the hypervisor. This is how the clients virsh or virt-manager ask the libvirtd to start talking to the hypervisor. In
the scope of this book, we are aiming at KVM virtualization technology. So, it would be better to think about it in terms of a QEMU/KVM
hypervisor instead of discussing some other hypervisor communication from libvirtd. You may be a bit confused when you see QEMU/KVM
as the underlying hypervisor name instead of either QEMU or KVM. But don't worry, all will become clear in due course. The connection
between QEMU and KVM is discussed in the following. For now just know that there is a hypervisor that uses both the QEMU and KVM technologies.
the connection URI, which has been passed from the client has, strings of "QEMU", or will have the following skeleton when passed to libvirt to open a connection:
driver[+transport]://[username@][hostname][:port]/[path][?extraparameters]
A simple command line example of a virsh
binary for a remote connection would be as follows:
$ virsh --connect qemu+ssh://[email protected]/system list --all
libvirtd
uses the details from these XML files to derive the argument list that is passed to the qemu-kvm
process.
Here is an example:
qemu 14644 9.8 6.8 6138068 1078400 ? Sl 03:14 97:29
/usr/bin/qemu-system-x86_64 -machine accel=kvm -name guest1 -S -machine pc--m 4196 -realtime mlock=off -smp 4,sockets=4,cores=1,threads=1 -uuid 7a615914-ea0d-7dab-e709-0533c00b921f -no-user-config -nodefaults -chardev socket,id=charmonitor-drive file=/dev/vms/hypervisor2,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=native -device id=net0,mac=52:54:00:5d:be:06
Here, an argument similar to -m 4196
forms a 4 GB memory for the virtual machine, --smp = 4
points to a
4 vCPU that has a topology of four vSockets with one core for each socket.
Recommended Links
Google matched content |
Softpanorama Recommended
Top articles
Sites
Introduction to KVM
https://www.youtube.com/watch?v=u_Z0Uwz9HLsRed Hat Developer Red Hat Enterprise Linux Hello-world RHEL7 based tutotiral
Setting up KVM on Red Hat Enterprise Linux - Red Hat Developer Blog
A brief introduction to KVM technology. For more info, visit www.raritantraining.com.
Install & Configure KVM Virtualization On CentOS 6.X - RHEL 6.X