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、重新启动计算机
4、重启后登录系统,检查XEN是否正常
4.1 执行# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 3919 4 r----- 16.9
出现上述结果表示xen启动正常
4.2 检查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.
表示一切正常,我们的CentOS5中的XEN服务已经成功启动。至此,我们的CentOS5的宿主机已经安装就绪。
三、安装XEN的Linux客户机系统—CentOS 5.x
2.2 开始安装客户机
# virt-install -n centos5 -r 512 --vcpus=2 --file=centos5.img --file=swap.img --nographics -lhttp://192.168.0.11/yum/ba...(你自己搭建的yum源的地址)
此时如果机器CPU支持VT技术会询问是否需要开启VT支持,一般选择no,如果支持的话选择yes,此时会要求输入光驱或光盘之类。
Would you like a fully virtualized guest (yes or no)? This will allow you to run unmodified operating systems. no
Starting install...
4、安装windows
安装前述步骤准备好磁盘镜像文件,传输win的iso文件后执行
#virt-install -n mini -r 768 --vcpus=2 --file=mini.img --vnc -v -c /opt/yum/pwinxp.iso
应该出现以下提示:
Starting install...
Unable to connect to graphical console; DISPLAY is not set. Please connect to localhost:5900
Domain installation still in progress. You can reconnect to the console to complete the installation process.
!!请注意此种方式比较适合宿主机开启xwin图形系统并且在宿主机上操作。