codeblock

2016年3月8日 星期二

Virtual Machine setup


Got a new homework as below:

1. 從官方網站下載"Oracle VM VirtualBox" 或 "VMware Workstation Player"
2. 從官方網站下載linux作業系統,可選 ubuntu、centos 或其他你熟悉的
3. 新增一個虛擬機器,至少要有兩張虛擬網卡,第一張使用nat功能,第二張指定成內部網路。接著設定一台虛擬光碟機,並將光碟檔案指定為在第二步下載的光碟映像檔。



4. 虛擬機器開機,依指示安裝linux。
5. 設定linux的第一張網路卡,使它可以對外連線。
6. 虛擬機器關機。
7. 在檔案總管裡找到儲存這個虛擬機器的資料夾,把這整個資料夾複製到另一顆硬碟上,或是其他資料夾裡。
8. 在hypervisor裡同時啟動原來的、新複製的虛擬機器。
9. 設定這兩台linux的第二張網卡,使它們可以ping等對方。

-----------------------------------------------------------------------------------------------------------

First of all, download VMware workstation player from https://www.vmware.com/tw and install it.



Then, download Ubuntu iso file from http://www.ubuntu-tw.org/

Create a virtual machine, and select the OS iso file.



















Choose Customize Hardware, and add another new network adapter. One adapter choose to be NAT, and another choose to be host-only. We can adjust the hardware setting according to the computer limitation.



















Start to install OS, and then make a copy of whole document to create a new virtual machine. (could also do the same procedure to install the second virtual machine)
Turn on the two virtual machine and check the network connection setting.

P.S. VMware 12 is so powerful that we could connect to Internet without any setting here.

Below is the network configuration of my host machine.























According to Adding and Modifying Virtual Network Adapters, VMnet0, VMnet1, and VMnet8 are reserved for network-bridged, host-only and NAT configurations, respectively. Compare to the network configuration of the virtual machines we set up.





















It is not difficult to find that the first network adapter is for NAT, and the second adapter is for host-only networking. If we disable the first network adapter(VMnet8) of a virtual machine here, then the machine can no longer connect to Internet. However, in such a situation, these two virtual machines still could connect to each other through host-only network(VMnet1).

If we do not allocate the IP address manually, the IP address will be assigned by the DHCP server which is initially installed while the VMware workstation is set up. According to DHCP on the NAT Network, the DHCP server automatically assign IP address of these two machines as <net>.128 and <net>.129, where <net> is 192.168.92 in NAT and is 192.168.229 in host-only network. Note that VMware allows only 125 virtual machines which is commented in vmnetdhcp.config.

The details of network setting information of host computer and two virtual machine are as follows.

NAT

host-only




















We can understand more about NAT(network address translation) and host-only networking in VMware support file.




沒有留言:

張貼留言