Reputation: 10586
I am trying to access a virtual machine url in browser of android emulator to build an application. But I keep getting this error
The webpage at
https://virtualmachinehost.name.com:1443/myserviceurl
net:ERR_NAME_NOT_RESOLVED
I did some google search also. I can access any other website on this browser. I also tried to add the ip address of this virutal machine with its hostname in hosts file. But nothing has helped.
Network Setup: Host machine IP - 10.X.X.130 VM IP - 172.X.X.238 emulator client IP - 192.X.X.102
Upvotes: 3
Views: 13137
Reputation: 3704
"If I ping domain name, I get unknown host. But if I ping ip addess of that VM, it is correctly pinging that VM"
This indicates that the /etc/hosts
modification you made is not working. If it was working correctly then the domain name would map to the ip address and you would be fine. I noticed that you are using a hierarchical domain name (IE: top level domain is com
, subdomain is virtualmachinehost
, and hostname is name
). This has to be in the hosts file also in order to work, but there may be an easier solution.
May recomend that you simplify your hosts
file and url by doing the following:
machinename <IP address>
. do not add a domain or subdomainhttps://machinename:1443/myserviceurl
Upvotes: 2
Reputation: 2255
Your problem is that there is no direct route from your emulator to your virtual machine through your host machine. You need to setup a routing table on the host machine to translate the addresses.
A quick and simple solution would be to have both the emulator and VM be NAT-ed with the host machine.
More info on NATing: https://www.vmware.com/support/ws55/doc/ws_net_configurations_nat.html
Upvotes: 1