Xen虚拟机在CentOS 5.5 GUI下的安装和配置
一、安装Xen虚拟机
一、用yum自动安装xen虚拟机软件包
# yum –y install xen*//用yum安装解决依赖问题
安装XEN需要的服务
# yum -y install kernel-xen*
安装XEN的相关内核
二、检查启动选项是否使用xen内核启动
1、检查xen内核文件
安装是否正常:文件位于/boot
# ls –lh /boot
total 9.5M
-rw-r–r– 1 root root 61K Mar 16 08:19 config-2.6.18-8.el5
-rw-r–r– 1 root root 60K Mar 16 09:27 config-2.6.18-8.el5xen
drwxr-xr-x 2 root root 1.0K Aug 15 14:47 grub
-rw——- 1 root root 1.5M Aug 13 17:18 initrd-2.6.18-8.el5.img
-rw——- 1 root root 1.5M Aug 15 14:47 initrd-2.6.18-8.el5xen.img
drwx—— 2 root root 12K Aug 13 17:15 lost+found
-rw-r–r– 1 root root 79K Apr 1 22:49 message
-rw-r–r– 1 root root 82K Mar 16 08:20 symvers-2.6.18-8.el5.gz
-rw-r–r– 1 root root 83K Mar 16 09:28 symvers-2.6.18-8.el5xen.gz
-rw-r–r– 1 root root 865K Mar 16 08:19 System.map-2.6.18-8.el5
-rw-r–r– 1 root root 848K Mar 16 09:27 System.map-2.6.18-8.el5xen
-rw-r–r– 1 root root 1.7M Mar 16 08:19 vmlinuz-2.6.18-8.el5
-rw-r–r– 1 root root 2.0M Mar 16 09:27 vmlinuz-2.6.18-8.el5xen
-rw-r–r– 1 root root 269K Mar 16 07:51 xen.gz-2.6.18-8.el5
-rwxr-xr-x 1 root root 595K Mar 16 09:43 xen-syms-2.6.18-8.el5
2、检查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 have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda3
# initrd /initrd-version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-8.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-8.el5
module /vmlinuz-2.6.18-8.el5xen ro root=LABEL=/
module /initrd-2.6.18-8.el5xen.img
title CentOS (2.6.18-8.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/
initrd /initrd-2.6.18-8.el5.img
修改其中的default=1为default=0,启用xen内核
3、reboot重新启动计算机
4、重启后登录系统,检查XEN是否正常
5、 执行# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 3919 4 r—– 16.9
出现上述结果表示xen启动正常
6、检查log:
#ls -lh /var/log/xen
total 8.0K
-rwxr-xr-x 1 root root 36 Aug 15 15:43 xend-debug.log
-rw-r–r– 1 root root 1.8K Aug 15 15:43 xend.log
# cat /var/log/xen/xend-debug.log
Nothing to flush.
Nothing to flush.
表示一切正常