Ubuntu – Accessing apache in ubuntu 10 virtualbox guest from ubuntu 10 host

networkingUbuntuubuntu-10.04virtualboxvirtualization

I did the following:

  1. installed VirtualBox 3.1.6 OSE in ubuntu 10 desktop.
  2. installed ubuntu 10 server on a virtual machine in VirtualBox.
  3. select "LAMP server" and "OpenSSH server" options during the ubuntu server installation.
  4. leave network "adapter 1" of virtual machine as "NAT".
  5. use "VBoxManage" described in manual to setup port forwarding on the host (Protocol: TCP, GuestPort: 80, HostPort: 8080).
  6. verify "ExtraDataItem" have been added to "ubuntuServer1.xml" (my virtual machine name) correctly.
  7. run command "pgrep apache" in ubuntu server in virtual machine to ensure apache is running.

Everything went well. But, when I try to access the apache from the browser on the host with "http://localhost:8080/", it just continue fetching with no response.

Now, I'm struck! Please help!

Many many thanks in advance!

Best Answer

Are you going to localhost:8080 from the Host (Ubuntu 10 desktop) or from Ubuntu 10 server?

if you are trying from the host (ubuntu 10 desktop) then it won't work as its trying to see if something is running on port 8080 in ubuntu 10 desktop.

you will need to use the ip address of the guest VM, for example if your ubuntu 10 server has an ip of 192.160.0.5 then you need to use http://192.168.0.5:8080 from the host (ubuntu 10 desktop)

hope this helps.

Luma