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 installed VirtualBox on my Windows 7 machine. Through VirtualBox, I installed Ubuntu 9.10 with apache2. I can view http://localhost from Ubuntu, but is there anyway I can view it from my windows machine too? i.e. run the apache server on ubuntu, and view it from windows? I figured it would open a port or something that would be visible to my whole computer regardless of its virtualness, but I guess not. How do I get around this?

share|improve this question

Open port 80 in the VM, then go to the IP address of the VM in your browser.

share|improve this answer
how do I open port 80? – mpen Apr 5 '10 at 17:02
I don't actually know Ubuntu well enough to be able to tell you. Take a look under System | Administration. – Ignacio Vazquez-Abrams Apr 5 '10 at 17:04
According to the tutorial I found, I had to do it through the host OS/Windows actually... – mpen Apr 5 '10 at 17:16

While the Virtualbox is powered down, create a secondary network connection of type "host only".

Power up your Virtualbox and run ifconfig from the command line.

The IP address you are looking for is in the second paragraph (mine is

Optional: Add the following to your Windows hosts file: ubuntu

Now you can go straight to http://ubuntu/.

share|improve this answer
up vote 0 down vote accepted

Edit: I should elaborate a bit. Here's the important bit from the tutorial. You need to run this on your Windows host OS.

cd C:\Program Files\Sun\xVM VirtualBox
VBoxManage setextradata MyLinux "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort" 8888
VBoxManage setextradata MyLinux "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort" 80
VBoxManage setextradata MyLinux "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" TCP
share|improve this answer

You must log in to answer this question.

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