CentOS下xen以及DomU的安裝相關教程

來源:互聯網
上載者:User

CentOS下xen以及DomU的安裝相關教程

一:安裝環境

CentOS6.5 核心版本:2.6.32-431.el6.x86_64 VMware-Workstation

二:xen的安裝使用

[root@node1~]#cat/proc/cpuinfo|grepflagflags:fpuvmedepsetscmsrpaemcecx8apicsepmtrrpgemcacmovpatpse36clflushdtsacpimmxfxsrssesse2sssyscallnxrdtscplmconstant_tscuparch_perfmonpebsbtsxtopologytsc_reliablenonstop_tscaperfmperfunfair_spinlockpnipclmulqdqssse3cx16sse4_1sse4_2popcnthypervisorlahf_lmaratepbxsaveoptplnptsdts

出現‘pae’表示cpu支援半虛擬化。

[root@node1~]#yuminstallcentos-release-xen[root@node1~]#yumupdate[root@node1~]#yuminstallxen-y(修改了/etc/grub.conf)[root@node1~]#yuminstalllibvirtvirt-manager(libvirt是一個服務)

安裝xen後grub資訊已經被修改了(xen4.4.2自動修改了grub的資訊,不用手動修改)

由於Dom0隻能運行於2.6.37以後的版本,因此安裝xen的同時自動地安裝了3.10.68的核心版本。kernel用的是xen而我們新安裝的核心被當作模組來運行了。

裝完重啟後就會發現系統啟動的是xen的核心。

[root@node1 xen]# cat /proc/xen/capabilities

control_d

出現control_d表示我們的xen已經可以正常使用。

三:安裝DomU

安裝xen的DomU,我們可以使用三種方式安裝,nfs,ftp,http,這裡使用nfs方式安裝;

現將CentOS6.5的系統硬碟掛載指系統:

[root@node1~]#mount/dev/cdrom/media/cdrom[root@node1~]#mkdir/mnt/centos/[root@node1~]#cp-r/media/cdrom/*/mnt/centos/[root@node1~]#chmod777/mnt/centos/.treeinfo[root@node1~]#vim/mnt/centos/.treeinfo為如下:[general]family=CentOStimestamp=1385726532.68variant=totaldiscs=1version=6.5discnum=1packagedir=arch=x86_64[images-x86_64]initrd=images/pxeboot/initrd.img[images-xen]kernel=images/pxeboot/vmlinuz//增加這一行initrd=images/pxeboot/initrd.img[stage2]mainimage=images/install.img

安裝nfs服務並掛載

[root@node1~]#yuminstallnfs-utils-y(3.10.68啟動nfs的時候直接使用servicenfsstart)[root@node1~]#echo'/mnt/centos/*(ro)'>>/etc/exports[root@node1~]servicenfsstart[root@node1centos]#showmount-elocalhostExportlistforlocalhost:/mnt/centos*

以上說明nfs安裝成功。

安裝DomU命名為Dom2:

[root@node1~]#virt-install-nDom2-r512--vcpus=1--prompt--diskpath=/dev/sdb--nographics-lnfs:10.43.2.11:/mnt/centos/我們將Dom2安裝在另一塊硬碟/dev/sdb上。1.Startinginstall...Retrievingfile.treeinfo...|616B00:00...Retrievingfilevmlinuz...|7.9MB00:00...Retrievingfileinitrd.img...|64MB00:08...Creatingdomain...|0B00:03ConnectedtodomainDom2Escapecharacteris^]Initializingcgroupsubsyscpuset………Greetings.anacondainstallerinitversion13.21.215startingmounting/procfilesystem...doneWelcometoCentOSforx86_64┌────────┤ChooseaLanguage├────────┐│││Whatlanguagewouldyouliketouse││duringtheinstallationprocess?││││Catalan↑││Chinese(Simplified)││Chinese(Traditional)││Croatian││Czech││Danish││Dutch││English↓││││┌────┐│││OK│││└────┘出現上邊資訊安裝普通的安裝作業系統走下去即可。

橋接器組態管理工具安裝:(迷你安裝的CentOS6.x需要此操作)

yuminstall-ybridge-utils

啟動xend與libvirt並讓其開機自啟動

servicexendstartservicelibvirtstartchkconfigxendonchkconfiglibvirton

至此我們的xen中的Dom2已經安裝完成。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.