Linux下部署Vmware Server(下)

 

一、深入理解Vmware Server常用的網絡類型: 

    首先介紹VMware 的幾個虛擬設備: 

 VMnet0:這是VMware 用於虛擬橋接網絡下的虛擬交換機; 
 VMnet1:這是VMware 用於虛擬Host-Only 網絡下的虛擬交換機; 
 VMnet8:這是VMware 用於虛擬NAT 網絡下的虛擬交換機; 
 VMware Network Adapter VMnet1:這是Host 用於與Host-Only 虛擬網絡進行通信的虛擬網卡; 
 VMware Network Adapter VMnet8:這是Host 用於與NAT 虛擬網絡進行通信的虛擬網卡; 

    1. 橋接網絡 

    橋接網絡是網絡連接的一種類型,其中虛擬機顯示爲和主機在同一個物理以太網上的一臺額外的計算機。說得更專業一些,虛擬機通過一個虛擬網絡適配器(在它的配置中,它連接到主機上的一塊以太網卡)直接連接到以太網。如果在你的 PC 上有一塊以太網卡並且在一個局域網(LAN)上,你可以使用這種網絡類型。 一臺橋接的虛擬機可以透明地使用它被橋接到的網絡上的任何可用服務: 
打印機、文件服務器網關以及其他服務。同樣,當一臺虛擬機被橋接後,配置使用橋接網絡的任何物理主機或者其他虛擬機可以使用該虛擬機上的資源。如果使用橋接網絡,你的虛擬機需要在網絡上有它自己的身份。例如,在一個 TCP/IP 網絡上,虛擬機需要有它自己的 IP 地址。你的網絡管理員會告訴你虛擬機的 IP 地址是否可用以及在客戶操作系統中你應該使用什麼網絡設置。一般來說,你的客戶操作系統可以從一臺動態主機配置協議(DHCP)服務器上自動獲取一個 IP 地址和其他網絡細節,如果不是這樣,你可能需要在客戶操作系統中手動設置 IP 地址和其他細節。說明: 如果你的主機安裝了一個無線 NIC,你不能使用橋接網絡。如果你希望在一臺使用無線 NIC 的主機上運行虛擬機,你需要配置你的虛擬機使用 NAT。圖5是橋接網絡拓撲圖。 

圖5橋接網絡拓撲圖 

    要設置一臺虛擬機使用橋接網絡,你需要按照下面這些步驟進行: 
    添加一個虛擬網絡適配器 到你的虛擬機,它連接到橋接(VMnet0)網絡。 
    爲虛擬網絡適配器配置操作系統支持,然後要麼爲它指定一個固定的網絡地址,要麼使用 DHCP 或者 BOOTP 激活使用動態地址分配。 
    打開虛擬機。 

    2. 僅主機網絡。

    僅爲主機網絡是一種網絡連接的類型,其中虛擬機通過虛擬私有網絡連接到你的 PC 上的主機操作系統。所有配置爲使用僅爲主機網絡的虛擬機通過一個虛擬網絡適配器或者對於主機操作系統可見的 交換機 連接到該私有網絡。儘管也可以使用其它通訊協議,在這個虛擬私有網絡上的所有成員典型地使用 TCP/IP 協議。正常情況下,虛擬私有網絡在主機以外不可見,如果你需要建立一個隔離的虛擬網絡,這非常有用;例如,一個隔離的虛擬網絡可以用於測試網絡
軟件。僅爲主機網絡允許你的虛擬機互相通訊以及和主機通訊,即使在你的 PC 中並沒有一塊網卡。 必須爲主機的虛擬私有網絡上的每一臺虛擬機指定一個唯一的網絡地址。一臺使用僅爲主機網絡的虛擬機可以從運行在主機上的 VMware Workstation DHCP 服務器上動態獲取它的網絡地址。否則,你可以指定一個靜態的網絡地址到虛擬機。在這兩種情況下,沒有必要聯繫你的網絡管理員。圖6是僅主機網絡拓撲圖。 

圖6僅主機網絡拓撲圖 

    要設置一臺虛擬機使用僅爲主機網絡,你需要按照下面這些步驟進行: 
    添加一個虛擬網絡適配器 到你的虛擬機,它連接到僅爲主機(VMnet1)網絡。 
    爲虛擬網絡適配器配置操作系統支持,然後爲它指一個固定的網絡地址,或者使用 DHCP 或 BOOTP.啓用動態地址分配。>>有關指定網絡地址的更多信息 
    打開虛擬機。 
    說明:對於僅爲主機網絡,如果不使用一臺代理服務器,虛擬機 不能 與主機以外的任何系統通訊。>>有關使用一臺代理服務器的更多信息 

    3. 網絡地址翻譯(NAT)。

    NAT 爲虛擬機通過到主機的幾乎任何可用的網絡連接類型使用大多數客戶端應用程序提供一種簡單的方式。唯一的要求是網絡連接必須支持 TCP/IP。 當你擁有一個有限的 IP 地址供應或者通過一個非以太網絡適配器連接到網絡時,NAT 非常有用。NAT 通過將在一個私有 VMnet 網絡中的虛擬機的地址翻譯爲主機的地址進行工作。當一臺虛擬機發送一個訪問網絡資源的請求時,對於網絡資源而言,這個請求好像來自主機。 NAT 使用主機自身的網絡資源連接到外部網絡。這樣,主機可以訪問到的任何 TCP/IP 網絡資源通過 NAT 連接應該可用。 NAT 主要的優點在於,它爲虛擬機獲得對於網絡資源的訪問提供一種透明的、容易配置的方式。圖7是NAT網絡拓撲圖。 

圖7NAT網絡拓撲圖 

    要設置一臺虛擬機使用 NAT 網絡,你需要按照下面這些步驟進行: 
    添加一個虛擬網絡適配器 到你的虛擬機,它連接到 NAT 網絡。 
    爲虛擬網絡適配器配置操作系統支持,爲它指一個固定的網絡地址,或者使用 DHCP 或 BOOTP.啓用動態地址分配。 
    打開虛擬機。 

    4. 用於虛擬私有網絡的網絡地址 

    無論你正在使用僅爲主機、網絡地址翻譯(NAT)還是橋接網絡,必須爲每一臺虛擬機分配一個 IP 地址。對於僅爲主機網絡,也必須爲主機分配一個 IP 地址。注意,對於每一個虛擬私有網絡,使用顯示在下表中的規範將可用的 IP 地址分割爲幾個部分,其中 <net> 是分配給你的僅爲主機或者 NAT 網絡的網絡數字。VMware sever 總是爲僅爲主機和 NAT 網絡使用一個 C 類地址。如下表。 

    上面這裏我們詳細介紹Vmware Server常用的網絡類型,後邊將要使用。
二、開始爲Linux 服務器安裝Vmware Server 

    安裝程序會提問一些問題,並同時給出缺省的答案。 

    1. 切換到超級用戶權限 

    $ su - 
    Password: 
    [root@localhost root]# cd vmware-server-distrib 

    2. 開始安裝 

    #./vmware-install.pl 

    3. 選擇二進制文件安裝路徑 

     # Creating a new installer database using the tar3 format. 
    Installing the content of the package. 
    In which directory do you want to install the binary files? 
    [/usr/bin] 
    What is the directory that contains the init directories (rc0.d to rc6.d)? 
    [/etc/rc.d] #選擇初始化目錄安裝路徑 
    What is the directory that contains the init scripts? 
    [/etc/rc.d/init.d] #選擇初始化腳本文件安裝路徑 
    In which directory do you want to install the daemon files? 
    [/usr/sbin] 
    In which directory do you want to install the library files? 
    [/usr/lib/vmware] 

    4. 選擇相關文件安裝路徑

    #The path “/usr/lib/vmware” does not exist currently. This program is going to 
    create it, including needed parent directories. Is this what you want? 
    [yes] 
    In which directory do you want to install the manual files? 
    [/usr/share/man] #選擇操作手冊頁面文件安裝路徑 
    In which directory do you want to install the documentation files? 
    [/usr/share/doc/vmware] #選擇文檔文件安裝路徑 

    5. 安裝結束 

    #The path “/usr/share/doc/vmware” does not exist currently. This program is going 
    to create it, including needed parent directories. Is this what you want? 
    [yes] 
    The main install is now complete and you should see something similar to what follows: 
    The installation of VMware Server <build number> for Linux competed successfully. 
    You can decide to remove this software from your system at any time by invoking thefollowing command:     “/usr/bin/vmware-uninstall.pl”. #安裝結束 

    6. 啓動vmware 配置 

    # Before running VMware Server for the first time, you need to configure it by 
    invoking the following command: “/usr/bin/vmware-config.pl”. Do you want this 
    program to invoke the command for you now? [yes] 
    此時系統會自動關閉現有的Vmware服務守護進程,如圖 8 。 

圖8 系統會自動關閉現有的Vmware服務守護進程 

    7. 選擇圖標文件安裝路徑 

    In which directory do you want to install the mime type icons? 
    [/usr/share/icons] 
    What directory contains your desktop menu entry files? These files have a .desktop 
    file extension. [/usr/share/applications] 
    In which directory do you want to install the application’s icon? 
    [/usr/share/pixmaps] 

    8. 閱讀接受終端用戶許可協議 

    Do you accept? (yes/no) yes #接受許可協議 

    9. 安裝相關模塊

    Trying to find a suitable vmmon module for your running kernel. 
    The module bld-2.6.9-5.EL-i686-RHEL4 loads perfectly in the running kernel. 
    Trying to find a suitable vmmon module for your running kernel. 
    None of the pre-built vmmon modules for VMware Server is suitable for your running 
    kernel. Do you want this program to try to build the vmmon module for your system 
    (you need to have a C compiler installed on your system)? [yes] #安裝虛擬網絡模塊 

    10. 配置網絡 

    Do you want networking for your virtual machines? (yes/no/help) [yes] yes 
 選擇網絡接口名稱 

    Your computer has multiple Ethernet network interfaces available: eth0, eth1. 
    Which one do you want to bridge to vmnet0? [eth0] 
 配置vmnet0 
    The following bridged networks have been defined: 
.     vmnet0 is bridged to eth0 
    Do you wish to configure another bridged network? (yes/no) [no] 
 配置vmnet8 
    Configuring a NAT network for vmnet8. 
    Do you want this program to probe for an unused private subnet? (yes/no/help) [yes] 
 探測DHCP 子網,自動探測,隨機選擇 
    Probing for an unused private subnet (this can take some time)... 
    The subnet 172.16.127.0/255.255.255.0 appears to be unused. 
    The following NAT networks have been defined: 
.   vmnet8 is a NAT network on private subnet 172.16.127.0. 
    Do you wish to configure another NAT network? (yes/no) [no] 
 配置host-only 網絡環境 
    Do you want to be able to use host-only networking in your virtual machines? 
    [yes] 
    Configuring a host-only network for vmnet1. 
    Do you want this program to probe for an unused private subnet? (yes/no/help) [yes] 
    Probing for an unused private subnet (this can take some time)... 
    The subnet 172.16.183.0/255.255.255.0 appears to be unused. 
    The following host-only networks have been defined: 
  . vmnet1 is a host-only network on private subnet 172.16.183.0. 
    Do you wish to configure another host-only network? (yes/no) [no] 

    11. 安裝內核模塊 

    Trying to find a suitable vmnet module for your running kernel. 
    The module bld-2.6.9-5.EL-i686-RHEL4 loads perfectly in the running kernel. 
    The module loads perfectly in the running kernel. 

    12. 選擇遠程服務端口 

    Please specify a port for remote console connections to use. [902] 

    13. 建立perl腳本文件 

    Building the VMware VmPerl Scripting API. 
    Using compiler “/usr/bin/gcc”. Use environment variable CC to override. 
    Installing the VMware VmPerl Scripting API. 
    The installation of the VMware VmPerl Scripting API succeeded. 

    14. 生成SSL證書文件 

    Generating SSL Server Certificate 
    In which directory do you want to keep your virtual machine files? 
   [/var/lib/vmware/Virtual Machines] 

    15. 輸入註冊時獲得的20位產品序列號如圖9. 。 

圖9 輸入註冊時獲得的20位產品序列號 

    16.如果配置過程和序列號正確,系統會完成配置並且啓動Vmware
服務器。如圖10 。 

圖10 Vmware Server配置成功界面 

    17. 系統會自動在系統工具菜單建立一個:“Vmware Service Console”服務控制檯的子選項。如圖 11 。 

圖11 系統工具中的Vmware Service Console 
三、安裝 VMware Server Management Interface on Linux
    安裝好此軟件包後,可以通過瀏覽器(以加密SSL方式)控制機器(可以進行重啓,關機等操作,默認使用8333端口)。安裝程序會提問一些問題,並同時給出缺省的答案。 

    1. 切換到超級用戶權限 

    $ su - 
    Password: 
    [root@localhost root]# cd vmware-server-distrib 

    2. 開始安裝 

    #wget http://download3.vmware.com/software/vmserver/VMware-mui-1.0.2-39867.tar.gz 
    #tar VMware-mui-1.0.2-39867.tar.gz ;cd /tmp/vmware-mui-distrib 
    #./vmware-install.pl 

    3. 閱讀接受終端用戶許可協議 

    Do you accept? (yes/no) yes #接受許可協議 

    4. 選擇二進制文件安裝路徑 

    # In which directory do you want to install the binary files? 
    [/usr/bin] 
    What is the directory that contains the init directories (rc0.d/ to rc6.d/)? 
    [/etc/rc.d] #選擇初始化目錄安裝路徑 
    What is the directory that contains the init scripts? 
    [/etc/rc.d/init.d] #選擇初始化腳本文件安裝路徑 
    In which directory do you want to install the VMware Management Interface files? 
    [/usr/lib/vmware-mui] 
    The path “/usr/lib/vmware-mui” does not exist currently. This program is going tocreate it, including needed parentdirectories. Is this what you want? [yes] 
    In which directory would you like to install the documentation files? 
    [/usr/lib/vmware-mui/doc] #選擇文檔文件安裝路徑 
    The path “/usr/lib/vmware-mui/doc” does not exist currently. This program is going 
    to create it, including needed parent directories. Is this what you want? [yes] 

    5.設置vmware-config-mui.pl配置文件 

    Before running VMware Management Interface for the first time, you need to 
    configure it by invoking the following command: 
    “/usr/bin/vmware-config-mui.pl”. Do you want this program to invoke the command 
    for you now? [yes] 

    6. 設置最大閒置時間單位分種 

    Set the number of minutes before an http session times out. (This is the length 
    of time before someone connecting to VMware Management Interface will be logged 
    out) [60] 

    7.安裝成功

    如果系統設定成功會出現圖12 界面。 


12 VMware Server Management Interface設定成功界面 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章