?
首先建安裝源
?(如果沒(méi)按apache先安apache?
?yum install httpd
然后打開/etc/httpd/conf.d/welcome.conf,把所有行都注釋掉
?/etc/init.d/httpd?start)??
mount -t iso9660 -o loop CentOS-5.5.iso /var/www/html
?關(guān)閉防火墻(如果不關(guān)防火墻可能會(huì)出現(xiàn) Unable to retrieve ...的問(wèn)題)
?/etc/init.d/iptables stop
上面使用的是http,可以使用ftp,nfs等其他的方式。
?
?
1. 創(chuàng)建 Xen 虛擬系統(tǒng)安裝樹
與 EMC VMware 和微軟 Virtual Server 一樣,Xen 在完全虛擬化的環(huán)境中可以支持從 ISO 光盤鏡像文件或物理光驅(qū)作為安裝源來(lái)引導(dǎo)安裝系統(tǒng),但在半虛擬化環(huán)境中必須使用安裝樹進(jìn)行安裝。安裝樹是一個(gè)包含所有系統(tǒng)安裝文件及相關(guān)程序的目錄,這個(gè) 目錄通過(guò) HTTP、FTP、NFS 進(jìn)行發(fā)布。
這里我們將要在 Xen 半虛擬化環(huán)境下安裝一個(gè) RHEL5 系統(tǒng),以 RHEL5 為例介紹制作 HTTP安裝樹的方法:
A. 安裝并啟動(dòng) Apache 服務(wù)
Apache 的安裝過(guò)程省略,這里假定 Apache 網(wǎng)頁(yè)存放目錄為/var/www/html
B. 將 RHEL5 安裝映像文件復(fù)制到 Linux 系統(tǒng)中
將 RHEL5.iso 文件復(fù)制到/tmp/iso/下
C. 將 RHEL5 安裝映像文件掛載到 Apache 根目下
[root@xen ~]# mv /tmp/iso/rhel-server-5.4-i386-dvd.iso /tmp/iso/RHEL5.iso [root@xen ~]# mount -o loop /tmp/iso/RHEL5.iso /var/www/html |
2. 使用字符工具 virt-install 創(chuàng)建 Xen 虛擬系統(tǒng)
A. 創(chuàng)建塊設(shè)備文件存儲(chǔ)目錄
[root@xen ~]# mkdir /vmdisk |
B. 執(zhí)行 virt-install 安裝程序
[root@xen ~]# virt-install --prompt |
3. 配置虛擬系統(tǒng)環(huán)境
運(yùn)行 virt-install 程序后將進(jìn)入 Xen 的字符引導(dǎo)安裝界面,按提示信息輸入虛擬系統(tǒng)配置
[root@xen ~]# virt-install --prompt What is the name of your virtual machine? vmrhel5 How much RAM should be allocated (in megabytes)? 200 What would you like to use as the disk (file path)? /vmdisk/vmrhel5 How large would you like the disk (/vmdisk/vmrhel5) to be (in gigabytes)? 4 What is the install URL? http://192.168.0.1 開始安裝...... 搜索文件 .treeinfo...... | 437 B 00:00 搜索文件 .treeinfo...... | 437 B 00:00 搜索文件 .treeinfo...... | 437 B 00:00 搜索文件 vmlinuz...... | 2.1 MB 00:00 搜索文件 initrd.img...... | 6.6 MB 00:00 創(chuàng)建存儲(chǔ)文件...... | 4.0 GB 00:00 創(chuàng)建域...... | 0 B 00:03 連接到域 vmrhel5 換碼符為 ^] Linux version 2.6.18-164.el5xen (mockbuild@x86-002.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Tue Aug 18 16:06:30 EDT 2009 . . . |
輸入內(nèi)容可參照:
1) 輸入 Xen 虛擬系統(tǒng)的名稱
What is the name of your virtual machine? vmrhel5
2) 輸入需要分配給虛擬系統(tǒng)的內(nèi)存
How much RAM should be allocated (in megabytes)? 300
3) 輸入虛擬塊設(shè)備的路徑
What would you like to use as the disk (path)? /vmdisk/vmrhel5
4) 輸入塊設(shè)備的大小
How large would you like the disk (/vmdisk/vmrhel5) to be (in gigabytes)? 6
5) 是否使用圖形安裝界面
Would you like to enable graphics support? (yes or no) no
6) 輸入安裝樹路徑
What is the install location?
http://192.168.0.1?
(不可以是127.0.0.1 你可以/sbin/ifconfig查一下)
4. 安裝 RHEL5 系統(tǒng)
A. 選擇安裝向?qū)дZ(yǔ)言
字符界面下只支持英文,所以保持默認(rèn)選項(xiàng)“English”,直接回車
B. 設(shè)定 TCP/IP 選項(xiàng)
手動(dòng)設(shè)定設(shè)定 IPv4 網(wǎng)絡(luò)設(shè)定,這個(gè)步驟非常關(guān)鍵,如果 IP 設(shè)置不正確,將無(wú)法連接到安裝樹,導(dǎo)致無(wú)法安裝系統(tǒng)
C. 進(jìn)入 Linux 字符安裝向?qū)?
根據(jù)安裝向?qū)崾荆O(shè)置 RHEL5 安裝選項(xiàng),安裝過(guò)程與在真實(shí)硬件環(huán)境的安裝過(guò)程一致
5. 使用圖形工具 virt-manager 創(chuàng)建 Xen 虛擬系統(tǒng)
A. 打開 virt-manager 管理工具
B. 連接 Xen 服務(wù)器(上面已經(jīng)連接)
C. virt-manage 圖形管理界面
D. 啟動(dòng)創(chuàng)建新虛擬向?qū)?
E. 命名虛擬系統(tǒng)
F. 選擇虛擬化方式
G. 選擇要安裝的操作系統(tǒng)類型
H. 指定安裝樹路徑
I. 分配存儲(chǔ)空間
J. 分配內(nèi)存和 CPU
K. 選擇網(wǎng)絡(luò)連接類型
L. Xen 虛擬系統(tǒng)設(shè)置完成
M. 啟動(dòng) RHEl5 安裝引導(dǎo)程序
本文出自 “ 賈蕓斐 ” 博客,請(qǐng)務(wù)必保留此出處 http://jiayf.blog.51cto.com/1659430/353028
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元
