I am using VMware Player 7.1 on a Windows 7 machine that connects to my router via WiFi and DHCP. I have set up Ubuntu using VMWare Player. I have kept the Network adapter as Bridge. I am able to access internet from both of my physical and Virtual systems but now the IP addresses vary whenever I am connecting to the Internet. I am also able to access Ubuntu from Windows and Windows from Ubuntu through IP addresses.

Now I want to use Hostname rather than IP addresses to connect, so that I won't need to change addresses everytime I reboot. Can anybody help me regarding this? Please let me know if you need any further information.

When I am doing hostname on both the system it is showing: hostname with IP as network this name is not appearing for the actual IP)

Thanks, Debashis

  • Have you tried setting the network to NAT instead of bridged in VMWare Player? – farosch May 12 '15 at 9:15
  • On most computer systems, "localhost" resolves to the IP address, which is the most commonly used IPv4 loopback address So is just a loopback device that can be used on nearly all OS to access your own computer. So nothing to worry about here. Also check THIS – farosch May 12 '15 at 9:25
  • 1
    You'll need a mixture of DHCP server and running your own DNS, or if not DNS a correctly configured hosts file on each machine. – shawty May 12 '15 at 9:27

If i understand it correctly, your wifi router is giving out IP addresses to both your physical and virtual interfaces. The solution would be:

Determine a working pair of IP addresses - when both your physical and virtual machines are connected, determine IPs of each of them. In Windows 7 enter


and look for the IP address assigned to the physical host. In your Ubuntu virtual machine enter


and locate the address.

On both physical and virtual machines, set those IP addresses as static (you'll also have to set the gateway (your wifi router's IP) and DNS (whatever you use now - check with

nslookup google.com

this will show you DNS in use)) - now, you'll always have the same IP on both physical and virtual machine. After that, you will just need to setup your hosts file on both physical and virtual machine. In Ubuntu, edit


Add a line like this:

IP-of-physical-machine        physical

In Windows 7, edit:


I'm not sure about the syntax of that file, but you should be able to determine it from existing entries in the hosts file. Add your virtual machine IP and give it a hostname (physical, let's say).

Now you should be able to access your Ubuntu virtual machine from WIndows 7 using "virtual" hostname and access your Windows 7 machine using "physical" hostname.

Just to make it complete: You should be able to control what IP a client gets from the wifi router too.

  • Thanks for this information. Can you please help me to setup the static IPs in both the systems. Secondly, how can I able to control "hat IP a client gets from the wifi router"? Just to repeat that I want to do all this setup as a permanent one not for a particular run! – Debashis May 28 '15 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.