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
[[email protected] ~]# virt-install --prompt --network bridge=br0 --virt-type=xen --vnc --noautoconsole
Would you like a fully virtualized guest (yes or no)? This will allow you to run unmodified operating systems.
What is the name of your virtual machine?
How much RAM should be allocated (in megabytes)?
What would you like to use as the disk (file path)?
<-- /var/lib/libvirt/images/vm03.img (you can as well specify a logical volume here, see chapter 4.2)
How large would you like the disk (/var/lib/libvirt/images/vm03.img) to be (in gigabytes)?
What is the install CD-ROM/ISO or URL?
<-- /dev/cdrom (you can also specify an iso file here, e.g. /var/lib/libvirt/images/CentOS-6.2-x86_64-bin-DVD1.iso)
Creating domain... | 0 B 00:01
Domain installation still in progress. You can reconnect to
the console to complete the installation process.
[[email protected] ~]#
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.