Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I have an Ubuntu guest VM operating inside Windows 7 host (VirtualBox with Bridged Networking enabled). In my VM, instead of browsing to http://localhost/somesite I set up virtual directories in apache to point to http://somesite. This is fine for when I'm working within Ubuntu, but I need to try to connect to the site from my Windows 7 host. If I enter in my browser address bar, I do indeed see the apache welcome page, but how can I browse to my Virtual Directory/Site?

share|improve this question
up vote 2 down vote accepted

I don't know the Virtual Directory/Site feature, but if it is similar to the Virtual Hosts feature in WebSphere, setting up a hostname "somesite" with IP in the Windows hosts file (default: C:\Windows\System32\drivers\etc\hosts) should work.

The entry would just look like this: somesite

Please note that you need Administrator rights to edit this file in Windows 7. Easiest solution might be to open Notepad with those rights (right click -> run as Administrator) and then open the file from that editor.

Basically you need to instruct your browser to use that hostname for the Host field in the HTTP request (that is sent to the IP after resolving the hostname anyway) like this:

GET / HTTP/1.1
Host: somesite
share|improve this answer
Are you referring to the hosts file on Ubuntu? I'm sure that Apache is unaware of what IP the machine is on gets handed out. EDIT: just tried creating a new entry under /etc/hosts -> somesite, and still cannot connect to it from Win7 if I type in that IP address – Shalan Sep 12 '11 at 13:36
No, I mean the hosts file on the Windows machine (therefore provided the default Windows hosts file location). If you just use the browser with the IP address, Apache won't know which (virtual) hostname to use, as the browser won't provide one. – BennyInc Sep 12 '11 at 13:39
facepalm....right, of course I knew that you meant the hosts file under Windows....let me give it a bash – Shalan Sep 12 '11 at 13:39
ok, edited it, but think I may need to restart my PC for the changes to take effect – Shalan Sep 12 '11 at 13:43
Editing the hosts file should not reed a restart - you can verify this by using ping somesite and checking the IP that gets pinged. – BennyInc Sep 12 '11 at 13:44

I guess is Ubuntu VM's IP address on the LAN. If you want to browse, you can use If you don't want to be using, AFAIK you need to redirect those requests using DNS (that is, translating somesite to

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .