Xen Guest Installation
Goal: To install RHEL 3, 4, 5 and Windows XP Xen guests.
Requirements: A workstation installed with Red Hat Enterprise Linux 5.0 with
Virtualization component.
In this lab, you will configure and install RHEL 3, 4, and 5 and Win
XP Xen guests using various virtualization tools.
Lab Sequence 1: Checking for PAE support
You must determine whether your system has PAE support. Red Hat Virtualization supports x86_64
or ia64 based CPU architectures to run para-virtualized guests. To run i386 guests the system
requires a CPU with PAE extensions. Many older laptops (particularly those based on Pentium Mobile or Centrino)
do not support PAE.
-
To determine if your CPU has PAE support, type:
grep pae /proc/cpuinfo
-
The following output shows a CPU that has PAE support. If the command returns
nothing, then the CPU does not have PAE support. All the lab exercises require
a i386 CPU with PAE extension or x86_64 or ia64 in order to proceed.flags :
fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat clflush dts acpi
mmx fxsr sse sse2 ss tm pbe nx up est tm2
Sequence 2: Installing RHEL5 beta 2 Xen para-virtualized guest using
virt-install
In this sequence, we will install a Red Hat Enterprise Linux 5 beta 2 Xen guest
using virt-install.
-
Use the virt-install command to start install your Red Hat Enterprise Linux 5
beta 2 Xen guest.virt-install
-
When prompted to install a fully virtualized guest, enter 'no'.
-
Enter rhel5b2-pv1 for your virtual machine name.
-
Enter 500 for your RAM to be allocated.
-
Enter /xen/rhel5b2-pv1.img for your disk (guest image).
-
Enter 6 for the size of your disk (guest image).
-
Enter yes to enable graphics support.
-
Enter nfs:server:/path/to/rhel5b2 for your install location.
-
The installation will then commence. Proceed as normal with the installation.
-
After installation, edit /etc/xen/rhel5b2-pv1, and make the following
changes:#vnc=1#vncunused=1sdl=1
-
Also, edit /etc/inittab, add in the following changes, and type init
5.#id:3:initdefault:id:5:initdefault:
Sequence 3: Installing RHEL5 beta 2 Xen para-virtualized guest using
virt-manager
In this sequence, we will install a Red Hat Enterprise Linux 5 beta 2 Xen guest
using virt-manager.
-
Use the virt-manager command to start install your Red Hat Enterprise Linux 5
beta 2 Xen guest.
virt-manager
-
On the 'Open connection' screen, select Local Xen host, and click on Connect.
-
On the 'Virtual Machine Manager' screen, click on New.
-
Click on Forward.
-
Enter rhel5b2-pv2 for your system name, and click on Forward.
-
Select Paravirtualized, and click Forward.
-
Enter nfs:server:/path/to/rhel5b2 for your install media URL, and click
Forward.
-
Select Simple File, enter /xen/rhel5b2-pv2.img for your file location. Choose
6000 MB, and click Forward.
-
Choose 500 for your VM Max and Startup Memory, and click Forward.
-
Click Finish.
-
The 'Virtual Machine Console' window will pop up. Proceed as normal with the
installation.
Sequence 4: Checking for Intel-VT or AMD-V support
In this sequence, we will determine if your system has enabled Intel-VT or AMD-V
support. Your system has to be using a Intel-VT or AMD-V enabled CPU in order to
install fully virtualized guest operating systems. Xen uses a generic 'HVM'
layer to support both CPU vendor.
-
To determine if your CPU has Intel-VT or AMD-V support, run the following
command:egrep -e 'vmx|svm' /proc/cpuinfo
-
The following output shows a CPU that has Intel-VT support. If the command
returns nothing, then the CPU does not have Intel-VT or AMD-V support.flags :
fpu tsc msr pae mce cx8 apic mtrr mca cmov pat clflush dts acpi mmx fxsr sse
sse2 ss ht tm pbe constant_tsc pni monitor vmx est tm2 xtpr
-
To determine if your system has enabled Intel-VT or AMD-V support, run the
following command:cat /sys/hypervisor/properties/capabilities
-
The following output shows that Intel-VT support has been enabled in the BIOS.
If the command returns nothing, then go into the BIOS Setup Utlility and look
for a setting related to 'Virtualization', i.e. 'Intel(R) Virtualization
Technology' under 'CPU' section on a IBM T60p. Enable and save the setting and
do a power off to take effect. xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p
Sequence 5: Installing RHEL5 beta 2 Xen fully virtualized guest using
virt-install
In this sequence, we will install a Red Hat Enterprise Linux 5 beta 2 Xen guest
using virt-install.
-
Use the virt-install command to start install your Red Hat Enterprise Linux 5
beta 2 Xen guest.virt-install
-
When prompted to install a fully virtualized guest, enter 'yes'.
-
Enter rhel5b2-fv1 for your virtual machine name.
-
Enter 500 for your RAM to be allocated.
-
Enter /xen/rhel5b2-fv1.img for your disk (guest image).
-
Enter 6 for the size of your disk (guest image).
-
Enter yes to enable graphics support.
-
Enter /dev/cdrom for the virtual CD image.
-
VNC viewer will pop up with the installation window. If there is an error
messages that says “main: Unable to connect to host: Connection refused
(111)”, then type the following command to proceed:vncviewer
localhost:5900[1]
-
The installation will then commence. Proceed as normal with the installation.
Sequence 6: Installing RHEL5 beta 2 Xen fully virtualized guest using
virt-manager
In this sequence, we will install a Red Hat Enterprise Linux 5 beta 2 Xen guest
using virt-manager.
-
Use the virt-manager command to start install your Red Hat Enterprise Linux 5
beta 2 Xen guest.virt-manager
-
On the 'Open connection' screen, select Local Xen host, and click on Connect.
-
On the 'Virtual Machine Manager' screen, click on New.
-
Click on Forward.
-
Enter rhel5b2-fv2 for your system name, and click on Forward.
-
Select Fully virtualized, and click Forward.
-
Select CD-ROM or DVD and the Path to install media if you have the CD-ROM or
DVD. Select ISO Image location if you choose to install from ISO image. Click
Forward.
-
Select Simple File, enter /xen/rhel5b2-fv2.img for your file location. Choose
6000 MB, and click Forward.
-
Choose 500 for your VM Max and Startup Memory, and click Forward.
-
Click Finish.
-
The 'Virtual Machine Console' window will pop up. Proceed as normal with the
installation.
Sequence 7: Installing RHEL3 Xen fully virtualized guest using virt-manager
In this sequence, we will install a Red Hat Enterprise Linux 3 Xen guest using
virt-manager.
-
The same instructions for Sequence 6 applies here.
Sequence 8: Installing RHEL4 Xen fully virtualized guest using virt-manager
In this sequence, we will install a Red Hat Enterprise Linux 4 Xen guest using
virt-manager.
-
The same instructions for Sequence 6 applies here.
Sequence 9: Installing Windows XP Xen fully virtualized guest using virt-manager
In this sequence, we will install a Windows XP Xen fully virtualized guest using
virt-manager.
-
Use the virt-manager command to start install your Windows XP Xen
guest.virt-manager
-
On the 'Open connection' screen, select Local Xen host, and click on Connect.
-
On the 'Virtual Machine Manager' screen, click on New.
-
Click on Forward.
-
Enter winxp for your system name, and click on Forward.
-
Select Fully virtualized, and click Forward.
-
Select CD-ROM or DVD and the Path to install media if you have the CD-ROM or
DVD. Select ISO Image location if you choose to install from ISO image. Click
Forward.
-
Select Simple File, enter /xen/winxp.img for your file location. Choose 6000
MB, and click Forward.
-
Choose 1024 for your VM Max and Startup Memory, and 2 for VCPUs. Click
Forward.
-
Click Finish.
-
The 'Virtual Machine Console' window will pop up. Proceed as normal with the
installation.
-
Choose to format the C:\ partition in FAT file system format. Red Hat
Enterprise Linux 5 does not come with NTFS kernel modules. Mounting or writing
files to the Xen guest image may not be as straight-forward if you were to
format the partition in NTFS file system format.
-
After the first reboot, fix the winxp guest image:losetup /dev/loop0
/xen/winxp.imgkpartx -av /dev/loop0mount /dev/mapper/loop0p1 /mntcp -prv
$WINDOWS/i386 /mnt/[2]umount /mnt
-
Restart the Xen guest manually:xm create -c winxp
-
Select winxp Xen guest from 'Virtual Machine Manager' and click Open.
-
The 'Virtual Machine Console' window will pop up. Proceed as normal with the
installation.
-
Whenever a 'Files Needed' dialog box appears, change the path
GLOBALROOT\DEVICE\CDROM0\I386 to C:\I386. Depending on your installation, you
may or may not see this problem. You may be prompted for missing files
numerous times. Changing the path to C:\I386 will fix this problem.
-
If the Xen guest console freezes, click shutdown, make the following changes
in /etc/xen/winxp:#vnc=1#vncunused=1sdl=1#vcpus=2
-
Repeat step 14 and proceed as normal with the installation.