xen虚拟机搭建
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Domain0操作系统安装:
E:\utorrent\CentOS-6.5-x86_64-bin-DVD1to2\CentOS-6.5-x86_64-bin-DVD1.iso
配置yum代理:
/etc/yum.conf
proxy=http://192.168.150.49:3128
/etc/profile
export http_proxy=http://192.168.150.49:3128
安装必要软件:
yum install transfig dracut wget texi2html libaio-devel dev86 glibc-devel e2fsprogs-devel gitk mkinitrd iasl xz-devel bzip2-devel pciutils-libs
pciutils-devel SDL-devel libX11-devel gtk2-devel bridge-utils PyXML
qemu-common qemu-img mercurial texinfo libuuid-devel openssl-devel python-twisted python python-devel ncurses-devel glibc-devel.i686 yajl
yajl-devel.x86_64 bridge-utils
下载linux内核,xen源码
linux-3.13.6.tar.gz xen-4.4.0.tar.gz
编译linux内核3.13.6:
yum install gcc ncurses-devel.x86_64
make menuconfig
Processor type and features->
Linux guest support->
Device Drivers->
Block devices->
Device Drivers->
Xen driver support->
Device Drivers->
Network device support->
确认配置选项
cat ./.config | grep xen
CONFIG_XEN=y
CONFIG_XEN_DOM0=y
CONFIG_XEN_PRIVILEGED_GUEST=y CONFIG_XEN_PVHVM=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=500 CONFIG_XEN_SAVE_RESTORE=y
CONFIG_XEN_DEBUG_FS=y
CONFIG_PCI_XEN=y
CONFIG_XEN_PCIDEV_FRONTEND=y CONFIG_XEN_BLKDEV_FRONTEND=y CONFIG_XEN_BLKDEV_BACKEND=y CONFIG_NETXEN_NIC=m
CONFIG_XEN_NETDEV_FRONTEND=y CONFIG_XEN_NETDEV_BACKEND=y CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_HVC_XEN=y
CONFIG_HVC_XEN_FRONTEND=y
# CONFIG_TCG_XEN is not set
# CONFIG_XEN_WDT is not set
CONFIG_XEN_FBDEV_FRONTEND=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
CONFIG_XEN_SCRUB_PAGES=y
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XEN_BACKEND=y
CONFIG_XENFS=y
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_XEN_GNTDEV=y
CONFIG_XEN_GRANT_DEV_ALLOC=y
CONFIG_SWIOTLB_XEN=y
CONFIG_XEN_PCIDEV_BACKEND=y
CONFIG_XEN_PRIVCMD=y
CONFIG_XEN_ACPI_PROCESSOR=y
CONFIG_XEN_MCE_LOG=y
CONFIG_XEN_HAVE_PVMMU=y
编译安装linux内核:
make –j8 bzImage
make –j8 modules
make modules_install
make install
用新的内核重启,确保内核安装成功
源码编译安装xen:
添加超级调用:
/usr/src/kernels/xen-4.2.5/xen/arch/x86/x86_64/entry.S
/usr/src/kernels/xen-4.2.5/xen/common/kernel.c
/usr/src/kernels/xen-4.2.5/xen/include/public/xen.h
/usr/src/kernels/xen-4.2.5/xen/include/xen/hypercall.h
编译安装:
./configure --enable-githttp --libdir=/usr/lib64
make xen
make tools
make stubdom
cd dist/install
cp -R * /
ln -s /etc/init.d/xendomains /etc/rc0.d/S10xendomains