yum -y install xen* yum -y install kernel-xen*
2.验证安装
#ls -lh /boot
-rw-r--r-- 1 root root 2.1M 06-01 02:33 vmlinuz-2.6.18-238.12.1.el5xen
-rw-r--r-- 1 root root 412K 06-01 01:15 xen.gz-2.6.18-238.12.1.el5
-rwxr-xr-x 1 root root 956K 06-01 03:27 xen-syms-2.6.18-238.12.1.el5
3.检查grub配置
#cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-238.12.1.el5xen)
root (hd0,0)
kernel /boot/xen.gz-2.6.18-238.12.1.el5
module /boot/vmlinuz-2.6.18-238.12.1.el5xen ro root=LABEL=/
module /boot/initrd-2.6.18-238.12.1.el5xen.img
title CentOS (2.6.18-164.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-164.el5 ro root=LABEL=/
initrd /boot/initrd-2.6.18-164.el5.img
修改其中的default=1为default=0,启用xen内核
4、检查XEN是否正常
重新启动计算机
1)执行
# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 7531 4 r----- 17.5
出现上述结果表示xen启动正常
2)检查log
#ls -lh /var/log/xen
drwx------ 2 root root 4.0K 05-10 05:30 console
-rw-r--r-- 1 root root 36 06-25 01:20 xend-debug.log
-rw-r--r-- 1 root root 2.0K 06-25 01:20 xend.log
# cat /var/log/xen/xend-debug.log
Nothing to flush.
Nothing to flush.
表示一切正常,我们的CentOS5中的XEN服务已经成功启动。
至此,我们的CentOS5的宿主机已经安装就绪。