CentOS6編譯核心安裝Xen4.4

來源:互聯網
上載者:User

標籤:編譯核心   centos   安裝 xen   

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.gztar -xzf xen-4.4.1.tar.gzcd xen-4.4.1./configuremake -j4 xen tools stubdommake 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

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/4C/74/wKioL1Q90cXz5bxBAAYwyuRpv4o101.jpg" title="QQ20141014181740.jpg" alt="wKioL1Q90cXz5bxBAAYwyuRpv4o101.jpg" />650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/4C/74/wKiom1Q90fGi_khQAAK4Af5xupE944.jpg" title="QQ20141014181800.jpg" alt="wKiom1Q90fGi_khQAAK4Af5xupE944.jpg" />

2,進入Device Drivers  ---> Block devices  --->  <*>   Xen virtual block device support

                                                                         <*>   Xen block-device backend driver 

           Device Drivers  --->Xen driver support  把下面的都選上

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/4C/74/wKioL1Q90u7TItQMAAXxMWZnbpQ395.jpg" title="QQ20141014181853.jpg" alt="wKioL1Q90u7TItQMAAXxMWZnbpQ395.jpg" />

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/4C/75/wKioL1Q906mjLv1mAAMt6efpu6M056.jpg" title="QQ20141015095127.jpg" alt="wKioL1Q906mjLv1mAAMt6efpu6M056.jpg" />

3, Device Drivers  ---> Network device support  ---> <*>   Xen network device frontend driver

                                                                                   <*>   Xen backend network device

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/4C/75/wKioL1Q91CXQkA-vAAVshgXCNOY833.jpg" title="QQ20141015095428.jpg" alt="wKioL1Q91CXQkA-vAAVshgXCNOY833.jpg" />

儲存並開始安裝

# cat .config |grep XENCONFIG_XEN=yCONFIG_XEN_DOM0=yCONFIG_XEN_PRIVILEGED_GUEST=yCONFIG_XEN_PVHVM=yCONFIG_XEN_MAX_DOMAIN_MEMORY=128CONFIG_XEN_SAVE_RESTORE=yCONFIG_XEN_DEBUG_FS=yCONFIG_PCI_XEN=yCONFIG_XEN_PCIDEV_FRONTEND=yCONFIG_XEN_BLKDEV_FRONTEND=yCONFIG_XEN_BLKDEV_BACKEND=yCONFIG_NETXEN_NIC=mCONFIG_XEN_NETDEV_FRONTEND=yCONFIG_XEN_NETDEV_BACKEND=yCONFIG_INPUT_XEN_KBDDEV_FRONTEND=yCONFIG_HVC_XEN=y# CONFIG_XEN_WDT is not setCONFIG_XEN_FBDEV_FRONTEND=yCONFIG_XEN_BALLOON=yCONFIG_XEN_BALLOON_MEMORY_HOTPLUG=yCONFIG_XEN_SCRUB_PAGES=yCONFIG_XEN_DEV_EVTCHN=yCONFIG_XEN_BACKEND=yCONFIG_XENFS=yCONFIG_XEN_COMPAT_XENFS=yCONFIG_XEN_SYS_HYPERVISOR=yCONFIG_XEN_XENBUS_FRONTEND=yCONFIG_XEN_GNTDEV=yCONFIG_XEN_GRANT_DEV_ALLOC=yCONFIG_SWIOTLB_XEN=yCONFIG_XEN_PCIDEV_BACKEND=y


make -j4 bzImagemake -j4 modulesmake -j4 modules_installmake -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.63depmod -acat > /etc/ld.so.conf.d/libxl.conf <<eof/usr/local/libeofldconfig -v|grep libxllibxlutil.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版本

[[email protected] ~]# 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


650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/4C/74/wKiom1Q90RnyuMs8AACGow-brdU626.jpg" title="QQ20141015094140.jpg" alt="wKiom1Q90RnyuMs8AACGow-brdU626.jpg" />

ok,Xen安裝完成,開始你的虛擬化吧

CentOS6編譯核心安裝Xen4.4

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.