之前已经写过一篇 Fedora25下源码安装Xen4.8 。但是由于条件受限,实验需要在CentOS7的环境下进行。本来想着这两者应该差不多,但是在CentOS7上源码安装时却出现了很多问题。挣扎了近一个星期,现在将这些错误总结一下。
1. /etc/grub2.cfg文件的修改
在之前,安装完Xen和Domain0以后,会自动生成Fedora, with Xen hypervisor的启动选项。进入以后就没有问题了。在CentOS7下,安装完以后没有with xen hypervisor的选项,因此需要手动添加。添加过程其实很简单,但是之前不敢改。先看看可以启动的一些列表是怎么写的。下面是能正常启动的,内核版本为4.9.13的centos系统,也是Domain0系统。
(我遇到的很多问题都是因为xen hypervisor服务没有起来, Domain0是正常的)
# less /etc/grub2.cfg
***
menuentry 'CentOS Linux (4.9.13) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.9.13-advanced-ed7325d2-37d5-47ac-b284-6c03eb2b0c4f' {
load_video
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 8bc8dcdd