VMware remote access to the local virtual machine, vmware Remote Access
Sometimes some server programs are installed in the vmwarevm, and then they need to be accessed in the LAN or Internet. At this time, VMware provides us with a good solution. Currently, there are two feasible solutions: the bridge mode and the NAT mode.
Bridging ModeIn the bridge mode, the system virtualized by VMware is like an independent host in the LAN. It has an IP address in the network and can access each other on the network. In general, you need to manually configure IP addresses and subnet masks for virtual machines in bridging mode. Later versions of VMware can copy the information of the current host.Explain this step:Right-click the VM and select "configuration". The pop-up panel is as follows:
Then modify the network configuration of the virtual machine. Here we use centos as an example. Three configuration files are involved:/etc/sysconfig/network-scripts/ifcfg-eth0/etc/resolv. conf
Modify/etc/sysconfig/network as follows:
NETWORKING = yesHOSTNAME = localhost. localdomainGATEWAY = 192.168.0.1 # specify the gateway address, which is the same as the local Nic.
Then, modify/etc/sysconfig/network-scripts/ifcfg-eth0 as follows:
DEVICE = "eth0" BOOTPROTO = "static" IPADDR = 192.168.0.25 # specify the IP address NETMASK = 255.255.255.0ONBOOT = "yes" TYPE = "Ethernet" DNS1 = 192.168.0.100 # specify the DNS address, it is the same as the local Nic. This parameter must be specified. Otherwise, domain name resolution cannot be performed.
Note: Except for the preceding items, the original settings remain unchanged.
Finally, configure/etc/resolv. conf as follows:
nameserver 192.168.0.100
You can restart the virtual machine. The test method is to ping the host and virtual machine.
If you cannot access the ping local host, you may need to configure the NIC option for the Bridge Mode for multiple Nic machines. Click "edit"-> "Virtual Network Editor", click "Bridge Mode", and select the correct Nic.
In NAT mode, the virtual system needs to use the NAT (Network Address Translation) function to access the public network through the network of the host machine. The biggest advantage of using the NAT mode is that it is very simple for the virtual system to access the LAN and the public network. You do not need to perform any other configuration, but only need the host machine to access the Internet. However, in NAT mode, the LAN cannot directly access your virtual machine. You need to set port ing as follows: 1. Click "edit"-> "VPC Editor". click "NAT mode" and then "NAT Settings"
2. In the pop-up NAT settings panel, click "add ":
3. Open the Add panel, set the Virtual Machine IP address and port information, and set the local listening port information
In this way, you do not need to restart the virtual machine. Access to port 8888 of the local machine through the LAN is equivalent to access to port 8888 of the virtual machine.
Reference: http://blog.csdn.net/mycwq/article/details/48314365
Copyright Disclaimer: This article is an original article titled "no blooming trees" and cannot be reproduced without the consent of the blogger.