Web services for accessing VMware virtual machines from outside the network
GraybullPosted @ January 04, 2013 16:50 in VMware with tags vmware NAT port forwarding TFS Web access, 4534 read
A Linux or Windows virtual machine is installed on the Vmware,vmware installed on the host. I wanted to have the virtual machine provide a Web service outside, so I opened IIS (Windows) on it. This article explains how to get my host and extranet users to access the IIS Web site.
My scenario is this: Hosts (Windows 7) reside on the LAN, install Windows 7 virtual machines on the host computer, install team Foundation Server2010 on the virtual machine, and provide access to the TFS Web site to other LAN users. This is broken down into several steps.
- Network topology
- Principle explanation
- Nat settings for VMware
- Ports forwarding (port Forwarding)
- Router and firewall settings
- Network test
Network topology
the network topology under this premise has 3 kinds of main types: Home ADSL, corporate LAN and host computer room public network. My scene is the second.
Principle explanation
With the topology, you need to understand the three network connectivity modes of VMware, differentiate bridging (bridged), Nat, and Host-only. Bridge mode, which can be regarded as the host and the virtual machine with the hub connection. NAT is an important technology of local area network, the detailed explanation can see the encyclopedia. Nat mode, can be seen as the host is the gateway, the virtual machine inside the network, all communication with the virtual machine must pass through the gateway. Host-only mode, as the host and the virtual machine is connected by twisted pair, they can be separate network segments.
The company LAN uses domain management, that is, the virtual machine does not (apply) in the domain, and the host is within the domain. So I can only use NAT mode, otherwise the virtual machine does not have access to the network (or access) permissions.
Nat settings for VMware
- Right click on the virtual machine, select "Setting";
- Select Network Adapter in the Hardware tab of the left column;
- Select Nat in the right column, such as:
Ports forwarding (port Forwarding)
After the NAT setting is complete, the virtual machine can access the external network (other users of the LAN and the Internet). However, the virtual machine cannot be accessed from the external network. This is because NAT is shielding the internal network details from the outside. To enable external access to the virtual machine, you need to set up port forwarding.
- View the virtual machine's IP address
- Select Vitual Network Editor under VMware's menu item, select NAT networks above, choose NAT below (shared host's IP address with VMs), click Nat Settings;
- Click Add to append port forwarding;
The host port is the ports of the hosts, that is, requests from the external network to access the host port are forwarded to the virtual machine;
Type specifies the transport protocol, where TCP and UDP are added (HTTP generally uses TCP only);
Vitual Machine IP address fills in the IP addresses and ports of the virtual machines, because Web services are required here, so you should complete the Web port (set in the Windows IIS Web site);
Router and firewall settings
- If there is a router between the external network and the host, you need to set the port mapping;
- Shut down the firewall on the host, or set the firewall's port allow rules;
Network test
- The IIS Web site for TFS has been built;
- Open the browser on the other user's computer on the LAN, Access Http://
Assume that the host's IP is 10.1.1.1, and the browser accesses http://10.1.1.1:8080. Normally, the access request is forwarded to the virtual machine, that is, the http://192.168.75.134:8080 is actually accessed by the request.
- If the Web site is open normally, the test passes.
- Related articles
- Global related articles
- VMware Three network connectivity modes (bridged, NAT, host-only)
Comments (2)1 [Reply] Zhang Yuheng says:
January 12, 2013 18:49
I did the same thing, with VBox.
I share a practice in home hosting Win7,vbox inside Ubuntu
The port forwards the transmission port of Ubuntu to the host port, then opens the virtual server on the router, and transfers the host's port to the public address port again, so that in other places, such as the company can use the Web graphical interface, The transmission that controls Ubuntu is downloaded.
2[Reply]Duan says:
January 12, 2014 03:42
@ Zhang Yuheng: Hello, can you give a specific step? Thanks, man.
Guide for virtual machine to host Web server communication