Installing KVM Guests With virt-install On Ubuntu 11.10 Server - Page 3
6 Creating A CentOS 6.0 Guest (Image-Based) From The Desktop With virt-manager
Ubuntu 11.10 Desktop:
Instead of creating a virtual machine from the command line (as shown in chapter 4), you can as well create it from the Ubuntu desktop using virt-manager (of course, the virtual machine will be created on the Ubuntu 11.10 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 Red Hat Enterprise Linux 6 in the Version drop-down menu, then check Use ISO image and click on the Browse... button:
Select the CentOS-6.0-x86_64-bin-DVD1.iso 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 Specify shared device name; the Bridge name field will then appear where you fill in the name of your bridge (if you have used the Virtualization With KVM On Ubuntu 11.10 guide to set up the KVM host, this is br0). Click on Finish afterwards:
The disk image for the VM is now being created:
Afterwards, the VM will start. If you use a remote KVM host, type in the root password of the KVM host:
You should now be connected to the graphical console of the guest and see the CentOS installer:
Now install CentOS as you would normally do on a physical system.
7 Cloning Guests
Ubuntu 11.10 KVM Host:
The python-virtinst package comes with a second tool, virt-clone, that lets you clone guests. To clone vm10 and name the clone vm12 with the disk image /var/lib/libvirt/images/vm12.img, you simply run (make sure that vm10 is stopped!)
sudo virt-clone --connect qemu:///system -o vm10 -n vm12 -f /var/lib/libvirt/images/vm12.img
Afterwards, you can start vm12 with virt-manager or like this...
sudo virsh --connect qemu:///system
... and connect to it using virt-manager.