CentOS6.4 X86_64最小化安装 VMware9.0环境 内核版本为3.2.63 Xen版本为4.4.1
安装Xen需要的包
常用的包
yum install gcc gcc-c++ vim wget lrzsz ntpdate sysstat dstat wget man tree -y
开发环境
yum groupinstall "Development tools" "Compatibility libraries" -y
其他安装包
yum install transfig 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 hmaccalc zlib-devel libtool-ltdl yajl yajl-devel readline-devel gcc-gfortran flex pcre-devel blas-devel lapack-devel curl-devel bison gperf gnuplot texinfo-tex tetex-dvips libvirt git -y
与桌面有关的包
yum install xorg-x11-drv-evdev xorg-x11-drv-fbdev xorg-x11-drv-i810-devel xorg-x11-drv-via-devel xorg-x11-proto-devel xorg-x11-server-sdk xorg-x11-xtrans-devel libuuid-devel -y
Xen4.4.1下载且安装
关闭selinux步骤省略
#Xen下载页面http://www.xenproject.org/downloads/xen-archives/xen-44-series/xen-441.html
wget http://bits.xensource.com/oss-xen/release/4.4.1/xen-4.4.1.tar.gz tar -xzf xen-4.4.1.tar.gz cd xen-4.4.1 ./configure make -j4 xen tools stubdom make install-xen install-tools install-stubdom #Xen配置文件 /etc/sysconfig/xendomains /sbin/chkconfig --add xencommons /sbin/chkconfig --add xendomains /sbin/chkconfig xendomains on /sbin/chkconfig xencommons on
编译内核
编译linux长期维护版内核linux-3.2.63
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.2.63.tar.xz
tar xf linux-3.2.63.tar.xz
cd linux-3.2.63 #编译安装后此文件夹为5.4G,请提前准备磁盘空间
make menuconfig
1,进入 Processor type and features ---> Paravirtualized guest support --->[*] Xen guest support
2,进入Device Drivers ---> Block devices ---> <*> Xen virtual block device support
<*> Xen block-device backend driver
Device Drivers --->Xen driver support 把下面的都选上
3, Device Drivers ---> Network device support ---> <*> Xen network device frontend driver
<*> Xen backend network device
保存并开始安装
# 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=128 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_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
make -j4 bzImage make -j4 modules make -j4 modules_install make -j4 install #sh /root/linux-3.2.63/arch/x86/boot/install.sh 3.2.63 arch/x86/boot/bzImage #System.map "/boot" #ERROR: modinfo: could not find module vmware_balloon #这个错误可以忽略不管
cp -a .config /boot/config-3.2.63 depmod -a cat > /etc/ld.so.conf.d/libxl.conf <<eof /usr/local/lib eof ldconfig -v|grep libxl libxlutil.so.4.3 -> libxlutil.so.4.3.0
修改grub.conf
vim /boot/grub/grub.conf
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title (3.2.63.centos.alt.x86_64)
root (hd0,0)
kernel /xen.gz dom0_mem=1024M,max:1024M loglvl=all guest_loglvl=all
module /vmlinuz-3.2.63 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
module /initramfs-3.2.63.img
#default=1
#timeout=5
#splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
#title CentOS (3.2.63)
#root (hd0,0)
#kernel /vmlinuz-3.2.63 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
#initrd /initramfs-3.2.63.img
title CentOS (2.6.32-358.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-358.el6.x86_64.img
# ls /boot/
config-2.6.32-358.el6.x86_64 symvers-2.6.32-358.el6.x86_64.gz xen-4.4.1.gz
config-3.2.63 System.map xen-4.4.gz
efi System.map-2.6.32-358.el6.x86_64 xen-4.gz
grub System.map-3.2.63 xen.gz
initramfs-2.6.32-358.el6.x86_64.img vmlinuz xen-syms-4.4.1
initramfs-3.2.63.img vmlinuz-2.6.32-358.el6.x86_64
lost+found vmlinuz-3.2.63
编译安装完成后重启进入系统
查看Xen版本
[root@localhost ~]# xl info
host : localhost.localdomain
release : 3.2.63
version : #1 SMP Tue Oct 14 20:21:53 CST 2014
machine : x86_64
nr_cpus : 4
max_cpu_id : 63
nr_nodes : 1
cores_per_socket : 1
threads_per_core : 1
cpu_mhz : 3392
hw_caps : 0fabfbff:28100800:00000000:00007f00:b4ba2223:00000000:00000001:00000281
virt_caps : hvm
total_memory : 2047
free_memory : 998
sharing_freed_memory : 0
sharing_used_memory : 0
outstanding_claims : 0
free_cpus : 0
xen_major : 4
xen_minor : 4
xen_extra : .1
xen_version : 4.4.1
xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler : credit
xen_pagesize : 4096
platform_params : virt_start=0xffff800000000000
xen_changeset :
xen_commandline : dom0_mem=1024M,max:1024M loglvl=all guest_loglvl=all
cc_compiler : gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
cc_compile_by : root
cc_compile_domain :
cc_compile_date : Tue Oct 14 17:59:32 CST 2014
xend_config_format : 4
ok,Xen安装完成,开始你的虚拟化吧
原文地址:http://bbotte.blog.51cto.com/6205307/1564187