分类: LINUX
2011-08-17 15:16:33
首先最小化安装 CentOS,然后安装编译 Xen 和 Linux xen kernel 所需要的软件包:
# yum groupinstall "Development Tools"到 下载最新的 Xen 源代码,然后解开、编译、安装,标准的 Linux 软件源码安装动作:
$ tar zxvf xen-4.0.0.tar.gz上面 make stubdom 的时候会从网上自动下载一些东西,所以如果是用代理上网的话需要在自己根目录下的 .wgetrc 里加上代理服务器,以便 wget 能通过代理正常下载:
$ vi .wgetrc加入到启动脚本:
# /sbin/chkconfig --add xend下载 Linux 内核后给内核打 xen 补丁:
$ cd配置带xen的Linux内核: $make menuconfig Processor type and features ---> [*] Enable Xen compatible kernel Networking support ---> Networking options ---> <*> 802.1d Ethernet Bridging Device Drivers ---> XEN ---> [*] Privileged Guest (domain 0) Backend driver support Block-device backend driver Block-device tap backend driver Block-device tap backend driver 2 Network-device backend driver PCI-device backend driver SCSI backend driver USB backend driver <*> Block-device frontend driver <*> Network-device frontend driver SCSI frontend driver USB frontend driver <*> Framebuffer-device frontend driver <*> Keyboard-device frontend driver [*] Disable serial port drivers <*> Export Xen attributes in sysfs Xen version compatibility (3.3.0 and later) ---> 3.3.0 and later(不是3.4.0) 配置好内核参数以后,保存并退出,开始编译Linux内核: $make $make modules #make modules_install #make install #/sbin/depmod 2.6.31.8 更新grub: # vi /boot/grub/menu.lst ... title CentOS (2.6.31.8-xen) root (hd0,0) kernel /xen-4.1.0.gz module /vmlinuz-2.6.31.8 ro root=/dev/VolGroup00/LogVol00 module /initrd-2.6.31.8.img ... 然后配置xend的配置文件/etc/xen/xend-config.sxp 加入下列行: (xend-http-server yes) (xend-unix-server yes) (xend-unix-path /var/lib/xend/xend-socket) (xend-port 8000) 删掉如下行: (xend-relocation-server yes) 配置好内核参数以后,保存并退出,开始编译Linux内核: $make $make modules #make modules_install #make install #/sbin/depmod 2.6.31.8 更新grub: # vi /boot/grub/menu.lst ... title CentOS (2.6.31.8-xen) root (hd0,0) kernel /xen-4.1.0.gz module /vmlinuz-2.6.31.8 ro root=/dev/VolGroup00/LogVol00 module /initrd-2.6.31.8.img ... 重启系统,确认Xen安装成功: #reboot #uname -a Linux localhost.localdomain 2.6.31.8 #2 SMP Tue Apr 20 11:19:19 SAST 2010 x86_64 GNU/Linux #xm list Name ID Mem VCPUs State Time(s) Domain-0 0 3713 4 r----- 36.0