I think every body knows What is Xen®?. Now i am directly going to the topic of the installation and configuring the Xen Virtualization in Centos. CentOS is a free operating system based on Red Hat Enterprise Linux (RHEL). It exists to provide a free enterprise class computing platform and strives to maintain 100% binary compatibility with its upstream distribution.
So no worry about getting the CentOS for the installation.
- Xen 3.0 rpm for Installation.
- Xen – Kernel for booting
- Virt-Manager for Managing the Xen Virtualization
- Virt-Viewer for getting the console of the Guest opertating system.
This guide only for the person that who didn’t installed the Xen and Xen – Kernel during installation of CentOS. If you have installed the CentOS with Xen already, you scan skip to Step 5.
PS: Here i am showing the fully virtualized platform. I used Win XP as Guest Operating System.
Step 1: First need to check, in which kernel you have logged or booted.
Step 2: From the above you can find that the system not booted with Xen kernel, check whether Xen and Xen – kernel installed on the CentOS or not.
Step 3: From the above, confirmed that the Xen and Xen – kernel haven’t installed on the machine, So you can install it using the following command, i used the YUM Repo for installing RPM’s. Include the Virt-Manager and Virt-Viewer also.
Step 4: Once the Xen and Xen – Kernel installed, Make the changes in the /etc/grub.conf to boot the Xen – Kernel by default. Other wise You have to select the Menu from Splash screen during booting. So edit /etc/grub.conf.
The following one is before editing the /etc/grub.conf. You can look at the default field = 1, it means by default it will boot from the second kernel ie Normal El5 Kernel. Numbers starts from 0,1 and so on.
After edit the /etc/grub.conf, Default field changed to 0 for booting Xen – kernel by default.
Step 5: Reboot the Server, As from the above the server should boot with Xen – Kernel. Check it using the following command.
Step 6: Create the directory for storing the virtual machine data. like below.
Step 7: Next is to create the Virtual Machine in command line mode. virt-install command will be used for creating the Virtual Machines. It has two modes of creation.
- Interactive Mode
- Non – Interactive Mode.
in this mode the command you will have to put –prompt at the end. When you give a command, it will prompt you to asking the specification of the virtual machine that you want to create. The following was the sample command for creating fully virtualized Windows XP guest os with RAM of 256MB, HDD of 2GB using the Disk image file of /vm/winxp.dmg and will start the installation of os from CD ROM drive /dev/hdc. At the end of execution of the command, the virtual machine viewer will starts automatically for providing the console of the guest operating system.This mode will be very easy to create the VM.
Non – Interactive Mode:
In this mode you have enter options manually, it will not prompt you for anything. The following command will create the new VM as identical as interactive mode. in the end of execution of command, virtual machine will start to begin to install win xp.
The above are the command for installing the Guest OS on the Xen. For managing the Xen you can use the virt-manager.