Haha, today my VM can access the Internet.
My situation: the company uses a gateway: 192.168.0.1, and each computer in the company has an IP address.
My host is win7 [192.168.2.52], and the virtual machine is XP
Solution:
The Network Mode of virtual machines is net, which may not be applicable to everyone. If you have similar problems, please refer to it.
1. Set the local connection of the win7 host to share. Click the share tab of "Local Connection ".
2. After you press OK, the system will automatically prompt you to share with "local connection 5" (network connection 5 is the net Nic of the Virtual Machine) and set the IP address of local connection 5 to 192.168.137.1.
3. I need network management to go out here, so set the local connection 5 (NAT Nic) DNS to 192.168.0.1. OK, save.
Note: Local Connection 3 and local connection 5 are shared and do not need to be in the same network segment.
4. Enter the virtual machine to set the TCP/IP of the local connection of the virtual machine, as shown in. The IP address must be in the same CIDR block as your Nat Nic. The default IP address is 192.168.137.1.
Enter 192.168.0.1 for DNS, and save. Try it and check whether your VM can access the Internet.
Virtual Machine XP Local connection settings:
IP: 192.168.137.9
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.137.1
Preferred DNS: 192.168.0.1