Virtualization With KVM On A CentOS 6.3 Server - Page 3

6 Creating A Debian Squeeze Guest (Image-Based) From The Desktop With virt-manager

Instead of creating a virtual machine from the command line (as shown in chapter 4), you can as well create it from the Fedora desktop using virt-manager (of course, the virtual machine will be created on the CentOS 6.3 KVM host - in case you ask yourself if virt-manager is able to create virtual machines on remote systems).

To do this, click on the following button:

The New VM dialogue comes up. Fill in a name for the VM (e.g. vm11), select Local install media (ISO image or CDROM), and click on Forward:

Next select Linux in the OS type drop-down menu and Debian Squeeze in the Version drop-down menu, then check Use ISO image and click on the Browse... button:

Select the debian- image that you created in chapter 4 and click on Choose Volume:

Now click on Forward:

Assign memory and the number of CPUs to the virtual machine and click on Forward:

Now we come to the storage. Check Enable storage for this virtual machine, select Create a disk image on the computer's hard drive, specify the size of the hard drive (e.g. 12GB), and check Allocate entire disk now. Then click on Forward:

Now we come to the last step of the New VM dialogue. Go to the Advanced options section. Select Host device vnet0 (Bridge 'br0'); that is the name of the bridge which we created in chapter 2. Click on Finish afterwards:

The disk image for the VM is now being created:

Afterwards, the VM will start. Type in the root password of the CentOS 6.3 KVM host:

You should now be connected to the graphical console of the guest and see the Debian installer:

Now install Debian as you would normally do on a physical system.

Share this page:

4 Comment(s)

Add comment


From: Dim at: 2012-08-30 19:00:45

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

From: at: 2012-11-06 19:14:59

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
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

From: Anonymous at: 2012-11-20 05:38:08

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

From: Anonymous at: 2012-11-22 04:17:22

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.

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.