Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I set up a web server in a virtual machine, will localhost/ be the same on both the virtual and the host machine?

share|improve this question

Most likely if /etc/hosts isn't changed on either of them.

Note that is an address given to the loopback interface, i.e it never leaves the machine.

Read more:

share|improve this answer
+1 and adding: So assuming the non-modified version of /etc/hosts, locallhost of a vm will be different than localhost of its host. If you want to access host's service from vm, you can use bridged networking or a host only interface, i believe. – Shoaibi Dec 9 '10 at 18:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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