VMware Linux virtual machine configuration recording-shared windows connection

Source: Internet
Author: User
Author: fbysss
MSN: jameslastchina@hotmail.com
Blog: blog.csdn.net/fbysss
Disclaimer: This article is original from fbysss. for reprinting, please indicate the source
Keywords: Virtual Machine Internet sharing
Purpose:Linux virtual machines share the Internet through windows. At the same time, you want to retain the IP address of the local Nic.

1. Install Vmware
The process of installing VMware is very simple and is not described here. After VMware is installed, create a virtual machine and start it. The problem is that the system cannot start itself because it does not read the CD. Later, we found that the system has an additional virtual optical drive, and the default CD of this virtual machine is set to a virtual Optical Drive. Select Virtual Machine nodes in virtual machine settings on the left of the VMware main interface, right-click-> Settings, select CD-ROM in hardware, select the correct drive letter in the use physical driver drop-down box, and click OK.
2. install linux
During the installation process, please note that you should not forget to press F2 in the virtual machine to enter the bios and set the drive-first boot drive.
After the installation, a prompt "the partition table on the device hda cannot be read. When creating a new partition, you must initialize it, resulting in loss of all data on the drive. This operation goes beyond all previous installation options for the drive to be ignored. Do you want to initialize this drive and delete all data? "It looks scary, but you don't have to worry about it. operations on the virtual machine are limited to the disk space specified for the virtual machine. OK. Otherwise, you have to repeat it again.
3. Windows Settings
Open the network connection and find two more connections, one is vmnet1 and the other is vmnet8. The addresses are 192.168.239.1 and 192.168.150.1 respectively. Select Local Connection and double-click. On the properties page, click "advanced ", select "allow other network users to connect through the Internet connection of this computer", and then confirm. If everything works, the address of vmnet1 will be changed to 192.168.0.1. Of course, it doesn't matter how you change the address.
4. Virtual Machine Settings
On the Virtual Machine node settings, select the NIC and select network connection as Nat.
5.Linux network settings
In the Linux GUI, use "automatically obtain IP Address Settings Using DHCP. The allocated address is 192.168.150.128,
In/etc/sysconfig/network-scripts/ifcfg-eth0, the gateway is 192.168.0.1 and DNS should be manually configured correctly.
However, through the route command, the gateway is 192.168.150.1. In my opinion, the actually used gateway should be the latter.
After testing, there is a strange phenomenon: manually set the address to 192.168.150.128, the gateway to 192.168.150.1 and 192.168.150.2, both of which can access the Internet normally, and 192.168.150.3 or above will not work, however, if the route command shows 192.168.150.3 and is set to a non-150 CIDR Block, the route will not be accessed at all. At least, everything is related to vmnet8.
At the same time, I noticed that no matter how I set it in Windows network connection, the vmnet1 and vmnet8 subnet in virtual network settings in the edit menu of the virtual machine will not change.
Summary:But the real mysteries of the VM network have not been fully understood. For further research.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.