How-To: Xen Guest for Red Hat Enterprise Linux 4
by the editorial team
This how-to article was edited and republished from the original source.
by Rik van Riel
|
Caution |
This HOWTO is for testing purposes only. The RHEL4 Xen paravirtualized kernels are ready, but there is no installer support yet. This temporary HOWTO describes how to turn a fully virtualized RHEL4 guest into a paravirt Xen guest. Proper installation of RHEL4 guests will be available in Anaconda sometime around the end of April 2007. |
Requirements:
- FC6 or RHEL5 Beta dom0 as the host OS
- A fully virtualized guest image, which can be created using:
- Xen with Intel VMX or AMD AMD-V CPU, or
- QEMU
- The RHEL4 paravirtualized kernels from http://people.redhat.com/~jbaron/rhel4/RPMS.kernel/
Procedure
- Install RHEL4 as a fully virtualized guest, using either Xen w/ HVM or QEMU.
- In the RHEL4 guest, modify
/etc/modprobe.confso it only contains:alias eth0 xennet alias scsi_hostadapter xenblk
- Install the RHEL4 paravirtualized kernel RPM for the system’s architecture. The changes in
modprobe.confensure thatmkinitrdchecks that thexenblkdriver is loaded on bootup. - Create a config file for the RHEL4 Xen guest in
/etc/xen. If the fully virtualized system was a Xen guest too, keep the vif MAC address and the UUID the same as before.cat /etc/xen/rhel4 # My RHEL4 Xen guest name = "RHEL4" memory = "256" uuid = "13db28ea-8536-53dc-3646-1f20fcc1199b" disk = [ 'phy:/dev/VolGroup00/RHEL4,xvda,w' ] # disk = [ 'file:/path/to/disk/image,xvda,w' ] vif = [ 'bridge=xenbr0,mac=00:16:3e:xx:xx:xx' ] bootloader="/usr/bin/pygrub" # vcpus = 2
If the guest is file backed and not LVM backed, fill in the second
disk =line and comment out the first one.To make an SMP guest, comment out the
vcpus = 2line, and set the number to the number of vcpus the guest needs.Note
Change the MAC address from the one used in this example.
If everybody uses the same MAC address, there will be network problems, guaranteed… however, the first 3 MAC address numbers (
00:16:3e) should stay intact. That is the official Xen MAC address range. - Start the Xen guest. Make sure to choose the correct kernel in the
pygrubmenu, because anything except the paravirtualized kernel will fail to boot. Use the following command, replacing rhel4 with the name of the Xen guest configuration file:xm create -c rhel4
- Found a bug? Please check bugzilla to see if a bug has been filed already. If the bug is new, please file the bug and the development team will try to fix it.
Important Notes
- Only i686 guests run on i686 hosts, or x86-64 guests on x86-64 hosts. Do not try to mix and match, it does not work.
- In order to get better system call and NPTL performance on i686, upgrade the
glibcto the RPMS in the directory http://people.redhat.com/riel/glibc/. Thisglibcadds thenosegnegcvariant, which avoids negative segment accesses for TLS. Use of thisglibcvariant has increased performance by double digit percentages for a number of workloads. - Herbert Xu’s network segmentation offload could not be backported to RHEL4 without destabilizing the network layer for non-Xen kernels too, so network performance in RHEL4 Xen guests will not be as good as that in RHEL5.
- If QEMU is used to install, make sure the MAC address that is put into the Xen config file matches what is in the guest in
/etc/sysconfig/network-scripts/ifup-eth0, otherwise the initscripts refuse to bring up the guest’s network.
More resources
Email: https://www.redhat.com/mailman/listinfo/nahant-list
RC: irc.oftc.net, #xen
About the author
Rik van Riel is a Linux kernel developer by day and an anti-spam activist by night. For some values of “day” and “night,” Rik works as a senior software engineer at Red Hat, Inc.
Copyright (C) 2006, 2007 by Rik van Riel and others. This article is licensed under a Creative Commons Attribution-ShareAlike 2.0 License (CC BY-SA). Attribution must include a link to the original source at http://people.redhat.com/riel/RHEL4-Xen-HOWTO.





