Table of Contents

libvirt

libvirt is an open source API, daemon and management tool for managing platform virtualization. It can be used to manage KVM, Xen, VMware ESX, QEMU and other virtualization technologies. These APIs are widely used in the orchestration layer of hypervisors in the development of a cloud-based solution.

Sparse image

qemu-img create -f qcow2 /var/lib/libvirt/images/test.qcow2 64G

Resize image

qemu-img resize /var/lib/libvirt/images/test.qcow2 +10G

and then resize partition table and filesystem.

Installation

virt-install -r 4096 --accelerate -n test \
-f /var/lib/libvirt/images/test.qcow2 \
--cdrom /CentOS-6.5-x86_64-bin-DVD1.iso \
--network=type=direct,source=eth0 \
--graphics vnc,listen=0.0.0.0,password=somepass \
--noautoconsole

(connect using vnc client to server IP to finish installation)

Deleting guest

virsh
destroy test
undefine test

Autostart

virsh autostart test

Changing guest configuration (config file)

virsh edit test