只需要简单的命令即可:yum install xen kernel-xen
安装完成后编辑/boot/grub/menu.lst文档,修改启动项为xen # 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/VolGroup00/LogVol00# initrd /initrd-version.img#boot=/dev/sdadefault=0timeout=5splashimage=(hd0,0)/grub/splash.xpm.gzhiddenmenutitle CentOS (2.6.18-164.6.1.el5xen) root (hd0,0) kernel /xen.gz-2.6.18-164.6.1.el5
module /vmlinuz-2.6.18-164.6.1.el5xen ro root=/dev/VolGroup00/LogVol00 module /initrd-2.6.18-164.6.1.el5xen.imgtitle CentOS (2.6.18-164.el5) root (hd0,0) kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.18-164.el5.img
然后用virt-install工具安装
创建目录vm:mkdir vm, 可以在其他目录中。
virt-install --prompt,根据向导创建。
注意,这这里第一步是否全虚拟化,选择no
内存大小最小为256M Would you like a fully virtualized guest (yes or no)? This will allow you to run unmodified operating systems. <-- no
What is the name of your virtual machine? <-- vm01 How much RAM should be allocated (in megabytes)? <-- 256 What would you like to use as the disk (file path)? <-- /vm/vm01.img
How large would you like the disk (/vm/vm01.img) to be (in gigabytes)? <-- 4
Would you like to enable graphics support? (yes or no) <-- no
What is the virtual CD image, CD device or install location? <--
ftp://x.x.x.x/pub 至此可以安装centos。
virt-install 建立了一个 vm01 的配置文件 /etc/xen/vm01