1,320 瀏覽數

RHEL5 – virt-install 指令安裝 Guest 的方法

Linux 的傳統就是指令集,所以不能避免的就是安裝 Guest 也可以用指令 "virt-install" 方式如下所示:

[root@benjr xen]# virt-install 
Would you like a fully virtualized guest (yes or no)?  This will allow you to run unmodified operating systems. no

yes 為 fully virtualized guest,no 為 para-virtualized guest

What is the name of your virtual machine? rhel4.6
[/PHP]
給這個虛擬機一個名稱.
[PHP]
How much RAM should be allocated (in megabytes)? 256

要指定多少記憶體空間給 Guest. 單位為 MBs

What would you like to use as the disk (file path)? /var/lib/xen/images/rhel4.6.img

虛擬磁碟(virtual disk) ,disk 或是 image 皆可! 要使用 nonsparse image disk 請先加入參數 virt-install -nonsparse.

How large would you like the disk (/var/lib/xen/images/rhel4.6.img) to be (in gigabytes)? 8

虛擬磁碟(virtual disk) 空間大小

Would you like to enable graphics support? (yes or no) yes

是否要圖形介面

What is the install location? nfs:192.8.1.1:/var/ftp/rhel4-as-u6-64

NFS : nfs:主機IP:Linux 實際可以安裝的目錄
WWW : http://主機IP/可以安裝的目錄
FTP : ftp://主機IP/可以安裝的目錄

Starting install…
Creating storage file…                                | 8.0 GB     00:00    
Creating domain…                                      |    0 B     00:00    
Domain installation still in progress. You can reconnect to
the console to complete the installation process.

note:
由 FTP 來安裝,請確定 ftp 的服務已經開預設路徑為 /var/ftp,並且目錄 /var/ftp/rhel4-as-u6-64/ 存放著 RHEL4 光碟的所有內容.

[root@benjr ~]# service vsftpd restart

由 NFS 來安裝,編輯 "/etc/exports" 並將 "/var/ftp/as3u2" 目錄分享(因為我們將把光碟內的檔案放在此目錄下,此為FTP預設的分享目錄)

[root@benjr ~]# vi /etc/exports
/var/ftp/ 192.8.1.*(ro,all_squash)
[root@benjr ~]# service nfs start

由 HTTP 來安裝
編輯 "/etc/httpd/conf/httpd.conf" 並將 Document 設為 /var/ftp(因為我們將把光碟內的檔案放在此目錄下,此為FTP預設的分享目錄)

[root@benjr ~]# vi /etc/httpd/conf/httpd.conf
Document Root "/var/ftp"
[root@benjr ~]# service httpd restart

2 個網友的想法 “RHEL5 – virt-install 指令安裝 Guest 的方法

  1. 自動參照通知: RHEL5 XEN – Naming your virtual system | Benjr.tw

  2. 自動參照通知: KVM -Virtual Machine Creation | Benjr.tw

發表迴響