Comments on Virtualization With KVM On A CentOS 6.3 Server

Virtualization With KVM On A CentOS 6.3 Server This guide explains how you can install and use KVM for creating and running virtual machines on a CentOS 6.3 server. I will show how to create image-based virtual machines and also virtual machines that use a logical volume (LVM). KVM is short for Kernel-based Virtual Machine and makes use of hardware virtualization, i.e., you need a CPU that supports hardware virtualization, e.g. Intel VT or AMD-V.

5 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Dim

You are missing DELAY=0 in the bridge ifcfg script. Without it an incoming migrating VM will lose several seconds of network connectivity

By:

I had the following error occur and was able to fix it thanks to another site.
 
# virsh -c qemu:///system list
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
error: failed to connect to the hypervisor
 
Fix: 
yum -y install avahi
/etc/init.d/messagebus restart
/etc/init.d/avahi-daemon restart
/etc/init.d/libvirtd restart
/sbin/chkconfig messagebus on
/sbin/chkconfig avahi-daemon on
 
 Source: http://quags.net/archives/53

By: Anonymous

Thanks for the great write-up. Makes for an impressive virtual lab for home or work use. 

By: Anonymous

You don't have to worry about SELinux. Leave it enabled. I have centos 6.2 running with a similar sort of setup.

On the host, if you leave SELinux on, it is better. Each virtual machine will run under it's own svirt process meaning that the virtual machine is essentially block from reaching the host. This is important because it makes it much more difficult for a compromised virtual machine to act as an attack vector for the virtual host. It essentially seperates everything nicely.

See redhat admin docs, they are applicable to CentOS as well.

https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/index.html

https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/index.html

https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Security_Guide/index.html

The documentation is not the most detailed I have ever seen, you won't get hand holding but they are good for nudging you in the right direction.

By: Adrian Rincon

Very useful and clear tutorial! Thank you so much! However, I followed Part 8 looking to create the VMs in their respective LV, unfortunatelly, when the VM guest linux system is installing, I get stuck in the partition part with a message such as "Failed to create a file system" ext4... has it happened to anyone?

My best regards