Virtualization With Xen On CentOS 6.2 (x86_64) (Paravirtualization & Hardware Virtualization) - Page 4
5 Full Virtualization (Hardware Virtualization)
The process for creating a fully virtualized guest is not that much different from that for creating a paravirtualized guest, except that for full virtualization, you need virt-manager (installation cannot be completed on the command line) and installation media (CD/DVD or an .iso image).
5.1 Creating A Fully Virtualized Guest On The Command Line
Because we need installation media, you can now either put your CentOS 6.2 DVD (the first one) into your DVD drive, or you download the CentOS 6.2 iso file and put it in the /var/lib/libvirt/images/ directory (it must be in the /var/lib/libvirt/images/ directory because later on I will show how to create virtual machines through virt-manager from your Fedora desktop, and virt-manager will look for ISO images in the /var/lib/libvirt/images/ directory). IT is also possible to create an iso file from the DVD as follows:
dd if=/dev/cdrom of=/var/lib/libvirt/images/CentOS-6.2-x86_64-bin-DVD1.iso
The guest installation can be started as follows:
virt-install --prompt --network bridge=br0 --virt-type=xen --vnc --noautoconsole
[root@server1 ~]# virt-install --prompt --network bridge=br0 --virt-type=xen --vnc --noautoconsole
That's it! Now you must open virt-manager and complete the guest installation, as shown in chapter 4.3.
5.2 Creating A CentOS 6.2 Guest (Image-Based) From The Desktop With virt-manager
Instead of creating a virtual machine from the command line, 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.2 Xen host - in case you ask yourself if virt-manager is able to create virtual machines on remote systems).
(I have tried this for a paravirtualized guest as well, but got an error after initrd.img got loaded - therefore this chapter is only for fully-virtualized guests.)
To do this, click on the following button:
The New VM dialogue comes up. Fill in a name for the VM (e.g. vm07), select Local install media (ISO image or CDROM), and click on Forward:
Next check Use ISO image and click on the Browse... button:
Select the CentOS-6.2-x86_64-bin-DVD1.iso image and click on Choose Volume:
Now select Linux in the OS type drop-down menu and RedHat Enterprise Linux 6 in the Version drop-down menu, then 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. 10GB), 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 and then specify br0 in the Bridge name field; 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.2 Xen 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.