Networking – Cannot connect to VMWare virtual machine through NAT

networkingsshvmware

I am currently reading Yahoo's Hadoop tutorial in here. I have installed VMWare player and running a virtual machine, as instructed by the tutorial. However, I cannot connect to my Guest machine from Host, no matter what I try.

The default is NAT mode. When I try to run ifconfig, I get the following address:

192.168.187.128

Attempting to ping it from within the guest results in success, but any attempt to ping it from the host results in failure. I am using Windows 7 (Host) and Ubuntu (Guest).


I tried changing the networking mode of VMWare to "Host-only". In this case, it looks like there is a failure in the initialization of the netowrking part of the virtual machine:

DHCPRequest of 192.168.187.128 on eth10 to 255.255.255.255 port 67
DHCPRequest of 192.168.187.128 on eth10 to 255.255.255.255 port 67
DHCPDiscover on eth10 to 255.255.255.255 port 67 interval 3
DHCPDiscover on eth10 to 255.255.255.255 port 67 interval 4
DHCPDiscover on eth10 to 255.255.255.255 port 67 interval 11
DHCPDiscover on eth10 to 255.255.255.255 port 67 interval 9
DHCPDiscover on eth10 to 255.255.255.255 port 67 interval 15
DHCPDiscover on eth10 to 255.255.255.255 port 67 interval 9
DHCPDiscover on eth10 to 255.255.255.255 port 67 interval 9
No DHCPOffers received

Trying recorder lease 192.168.187.128
PING 192.168.187.2 (192.168.187.2) 56(84) bytes of data.

--- 192.168.187.2 ping statistics ---
1 packets transmited, 0 recieved, +1 errors, 100% packet loss ,time 0ms

And once again, pinging from the host fails.
Using "Bridged" mode results in similar scenario.

Any idea?

Best Answer

I've run into similar issues when setting up domains. By default Windows 7 is set to reject PING requests as well as other requests. Depending on your Linux distribution it may be set to reject as well. (but doesn't seen to be in this case if I'm reading your post correctly)

If you really want to see a response from Windows you need to take down the firewall (Not advised but for the purpose of testing this is fine). Go into Windows Firewall with Advanced Security, then turn off the corresponding firewall for your network (or all of them if you can't figure it out).

As another option, you can create an exception for PINGs in the inbound/outbound rules.

Bridged mode has the VMware client "share" the network connection with the host and it acts as if it is a machine on the same LAN. It requests an IP address and everything. Then communication between the two "machines" goes through your router.
(http://www.vmware.com/support/ws4/doc/network_bridged_ws.html)

By using NAT mode, VMware uses your host PC as a "router" of sorts and assigns it an IP address inside that LAN. So all communication is direct in this case. But it actually does do full translation of IP addresses/everything when attempting to access outside the network (can access internet).
(http://www.vmware.com/support/ws55/doc/ws_net_configurations_nat.html)

Host mode creates a direct connection between the two computers that cannot go beyond that. By default no DHCP is enabled so you need to set that up manually.

Any should work for your purposes but it's important to be aware of the differences in how messages are transferred and IP addresses are assigned.

Related Question