# 从RedHat网站下载srpm wget rpm -i python-virtinst-0.500.5-3.el6.src.rpm cd ~/rpmbuild/SPECS/ rpmbuild -bb python-virtinst.spec cd ~/rpmbuild/RPMS/noarch/ rpm -Uvh --force python-virtinst-*.rpm
7. 编译安装内核# 从github下载内核 wget https://github.com/jsgf/linux-xen/tarball/xen-2.6.32.46 -O kernel-xen-2.6.32.46.tar.gz # 下载config wget # 可以先修改config里面的CONFIG_LOCALVERSION项, 给这个内核起个别名, 比如-dom0-xen, 以下为没有修改的情况 tar xzf kernel-xen-2.6.32.46.tar.gz cp config-2.6.32.43-pvops-dom0-xen-stable-x86_64 jsgf-linux-xen-1c3f03c/.config cd jsgf-linux-xen-1c3f03c make oldconfig make -j4 bzImage make -j4 modules make modules_install depmod -a 2.6.32.46 cp -a arch/x86/boot/bzImage /boot/vmlinuz-2.6.32.46 cp -a System.map /boot/System.map-2.6.32.46 cp -a .config /boot/config-2.6.32.46 cd /boot/ dracut --force initramfs-2.6.32.46.img 2.6.32.46 # 关闭ksm, 跟xen不兼容 chkconfig ksm off chkconfig ksmtuned off
8. 编辑/boot/grub/menu.lst, 添加title Xen 4.0 with Linux 2.6.32.46 root (hd0,0) kernel /xen.gz dom0_mem=2048M loglvl=all guest_loglvl=all module /vmlinuz-2.6.32.46 ro root=/dev/sda2 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM KEYBO ARDTYPE=pc KEYTABLE=us SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 nomodeset module /initramfs-2.6.32.46.img
9. 编辑/etc/xen/xend-config.sxp, 按自己的需求修改...... (xend-http-server yes) (xend-unix-server yes) (xend-tcp-xmlrpc-server yes) ...... (xend-relocation-server yes) ...... (xend-tcp-xmlrpc-server-address '0.0.0.0') (xend-tcp-xmlrpc-server-port 8006) ...... (xend-relocation-port 8002) ...... (xend-address localhost) ...... (xend-relocation-address '0.0.0.0') ...... ...... ......
10. 配置libvirtdgroupadd libvirt vi /etc/libvirt/libvirtd.conf unix_sock_group = "libvirt" unix_sock_ro_perms = "0777" unix_sock_rw_perms = "0770"
11. 重启, 启动Xen的内核12. 把上面做的事情, 写成一套脚本