Appendix A. Lab 1

Appendix A. Lab 1

Appendix A. Lab 1

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.

  1. To determine if your CPU has PAE support, type:

        grep pae /proc/cpuinfo
       
  2. 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.

  1. Use the virt-install command to start install your Red Hat Enterprise Linux 5 beta 2 Xen guest.virt-install

  2. When prompted to install a fully virtualized guest, enter 'no'.

  3. Enter rhel5b2-pv1 for your virtual machine name.

  4. Enter 500 for your RAM to be allocated.

  5. Enter /xen/rhel5b2-pv1.img for your disk (guest image).

  6. Enter 6 for the size of your disk (guest image).

  7. Enter yes to enable graphics support.

  8. Enter nfs:server:/path/to/rhel5b2 for your install location.

  9. The installation will then commence. Proceed as normal with the installation.

  10. After installation, edit /etc/xen/rhel5b2-pv1, and make the following changes:#vnc=1#vncunused=1sdl=1

  11. 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.

  1. Use the virt-manager command to start install your Red Hat Enterprise Linux 5 beta 2 Xen guest.

    virt-manager

  2. On the 'Open connection' screen, select Local Xen host, and click on Connect.

  3. On the 'Virtual Machine Manager' screen, click on New.

  4. Click on Forward.

  5. Enter rhel5b2-pv2 for your system name, and click on Forward.

  6. Select Paravirtualized, and click Forward.

  7. Enter nfs:server:/path/to/rhel5b2 for your install media URL, and click Forward.

  8. Select Simple File, enter /xen/rhel5b2-pv2.img for your file location. Choose 6000 MB, and click Forward.

  9. Choose 500 for your VM Max and Startup Memory, and click Forward.

  10. Click Finish.

  1. 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.

  1. To determine if your CPU has Intel-VT or AMD-V support, run the following command:egrep -e 'vmx|svm' /proc/cpuinfo

  2. 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

  3. To determine if your system has enabled Intel-VT or AMD-V support, run the following command:cat /sys/hypervisor/properties/capabilities

  4. 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.

  1. Use the virt-install command to start install your Red Hat Enterprise Linux 5 beta 2 Xen guest.virt-install

  2. When prompted to install a fully virtualized guest, enter 'yes'.

  3. Enter rhel5b2-fv1 for your virtual machine name.

  4. Enter 500 for your RAM to be allocated.

  5. Enter /xen/rhel5b2-fv1.img for your disk (guest image).

  6. Enter 6 for the size of your disk (guest image).

  7. Enter yes to enable graphics support.

  8. Enter /dev/cdrom for the virtual CD image.

  9. 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]

  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.

  1. Use the virt-manager command to start install your Red Hat Enterprise Linux 5 beta 2 Xen guest.virt-manager

  2. On the 'Open connection' screen, select Local Xen host, and click on Connect.

  3. On the 'Virtual Machine Manager' screen, click on New.

  4. Click on Forward.

  5. Enter rhel5b2-fv2 for your system name, and click on Forward.

  6. Select Fully virtualized, and click Forward.

  7. 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.

  8. Select Simple File, enter /xen/rhel5b2-fv2.img for your file location. Choose 6000 MB, and click Forward.

  9. Choose 500 for your VM Max and Startup Memory, and click Forward.

  10. Click Finish.

  11. 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.

  1. 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.

  1. 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.

  1. Use the virt-manager command to start install your Windows XP Xen guest.virt-manager

  2. On the 'Open connection' screen, select Local Xen host, and click on Connect.

  3. On the 'Virtual Machine Manager' screen, click on New.

  4. Click on Forward.

  5. Enter winxp for your system name, and click on Forward.

  6. Select Fully virtualized, and click Forward.

  7. 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.

  8. Select Simple File, enter /xen/winxp.img for your file location. Choose 6000 MB, and click Forward.

  9. Choose 1024 for your VM Max and Startup Memory, and 2 for VCPUs. Click Forward.

  10. Click Finish.

  11. The 'Virtual Machine Console' window will pop up. Proceed as normal with the installation.

  12. 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.

  13. 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

  14. Restart the Xen guest manually:xm create -c winxp

  15. Select winxp Xen guest from 'Virtual Machine Manager' and click Open.

  16. The 'Virtual Machine Console' window will pop up. Proceed as normal with the installation.

  17. 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.

  18. If the Xen guest console freezes, click shutdown, make the following changes in /etc/xen/winxp:#vnc=1#vncunused=1sdl=1#vcpus=2

  19. Repeat step 14 and proceed as normal with the installation.



[1] VNC port 5900 refers to the first Xen guest that is running on vnc. If it doesn't work, you might need to use 5901, etc.

[2] This is to fix a problem that you may face in the later part of the Windows installation.