Page 1 of 1

how can I see my apache web server

Posted: 17. Dec 2008, 23:01
by grownler
Hello, I have one virtual machine (Debian Lenny) running under Windows Vista (host).

On my VM I have Apache Web Server installed. Inside the VM, typing http://10.0.2.15/ or http://localhost/ in the web browser I can access my webpage. But how can I access it from my HOST? If I type the same address in the HOST doesn't work.


I have one folder (C:\Users\Advocacia SA\Downloads) between these two systems (host and guest), where I can see the files by the dir. /mnt/Downloads.

Somethings that maybe can help:

(FROM MY HOST):
C:\Users\Advocacia SA>ipconfig

Configuração de IP do Windows

Adaptador Ethernet Conexão local:

Sufixo DNS específico de conexão . :
Endereço IPv6 de link local . . . . . : fe80::759c:a024:988b:b86%8
Endereço IPv4. . . . . . . . . . : 192.168.1.6
Máscara de Sub-rede . . . . . : 255.255.255.0
Gateway Padrão . . . . . . . . : 192.168.1.1

(FROM THE GUEST):
eth0 Link encap:Ethernet Endereço de HW 08:00:27:3f:52:eb
inet end.: 10.0.2.15 Bcast:10.0.2.255 Masc:255.255.255.0
(...)




network settings is marked as NAT in virtualbox.

Sorry about this english...
I have looked for documentation on my language for this problem but I didn't find, and there isn't good forums about virtualbox in my language too... however, thanks!

Posted: 17. Dec 2008, 23:53
by stephanecharette
Download & read the VB user manual.

If you want to keep using NAT, then look at:

"Configuring port forwarding with NAT", section 6.4.1

VB 2.1: page 79
VB 2.0.6: page 74

Otherwise, other alternatives exist such as bridge networking, which if I understand correctly (haven't tried it yet) is much easier to setup in VB 2.1.

Stéphane Charette

Posted: 19. Dec 2008, 01:40
by grownler
I run these commands on my Windows (host), and everything right.

VBoxManage setextradata "Debian" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/seamlessrdp/UDP" 0
VBoxManage setextradata "Debian" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/seamlessrdp/GuestPort" 80
VBoxManage setextradata "Debian" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/seamlessrdp/HostPort" 3389

now, how can I see my apache web server?

Posted: 19. Dec 2008, 01:48
by grownler
I tried http://10.0.2.15:3389/ and didn't work... = (

Posted: 19. Dec 2008, 01:56
by stephanecharette
grownler wrote:I tried http://10.0.2.15:3389/ and didn't work...
Is your host address really 10.0.2.15? Or did you mix up your guest's IP on the internal VB network?

Otherwise, from the host, try http://localhost:3389/

Stéphane

Posted: 19. Dec 2008, 02:19
by grownler
sorry! I made wrong, I just copy&paste some commands, but now I deleted the modifications of these commands on my XML file from my VM and did:

VBoxManage setextradata "Debian" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestapache/TCP"
VBoxManage setextradata "Debian" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestapache/GuestPort" 80
VBoxManage setextradata "Debian" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestapache/HostPort" 8080

I think it's right now. But keep don't working. And now I tried: http://localhost:8080/ on the host... in the guest I access normally by http://localhost/

Look at somethings of my xml file:
<ExtraData>
<ExtraDataItem name="GUI/SaveMountedAtRuntime" value="yes"/>
<ExtraDataItem name="GUI/LastCloseAction" value="powerOff"/>
<ExtraDataItem name="GUI/LastWindowPostion" value="8,28,720,443"/>
<ExtraDataItem name="GUI/Fullscreen" value="off"/>
<ExtraDataItem name="GUI/Seamless" value="on"/>
<ExtraDataItem name="GUI/AutoresizeGuest" value="on"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestapache/GuestPort" value="80"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestapache/HostPort" value="8080"/>

<ExtraDataItem name="GUI/InfoDlgState" value="400,450,normal"/>
</ExtraData>

Posted: 18. Jan 2009, 02:52
by carver
I'm having the same problem. I set the ports to forward from my Host OS (Windows XP) to my Guest OS (Ubuntu server 8.04), but I still can't access from my Host. (Using VBox 2.1.0)

netstat on host and guest show that the ports are open and listening (and that they were closed before I set up the port forward).

I can access the server from within the Guest OS using `wget http://localhost/`. But if I try to access it from the Host OS using http://localhost:8888/`, I get "Failed to Connect" from Firefox.

I get the same problem with SSH (although I haven't tried ssh localhost, that just seems like a bad idea...)

Additionally, I can access the internet from within the Guest OS.

I set up the Windows Firewall to open up the port. No help.

Any ideas what is going on? I have heard whispers that old versions of VBox require you to set up a network bridge or something. Is that what I should be looking at next?

Posted: 18. Jan 2009, 03:55
by TerryE
There is a bug in 2.1.0 NAT port forwarding, but since the Host IF model is now very much like the VMWare on (you just select Host IF in the setttings and VBox does everything else), I've pretty much stopped using NAT for my LAMP guest VMs.

Posted: 18. Jan 2009, 19:48
by carver
Cool, so the manual pretty much says what you said: "Turn on Host Interface and you're done"

But it's not working. Now my port forwards are gone, and no new ports are opened up. I can access http://localhost/ from within my guest os (Ubuntu) but not from my host os (Win xp).

What should be the expected functionality? Should I be able to just go to http://localhost/ from my host OS? ie~ should i be using a different port to access it from my host, or should it be the same port?

I tried removing the old port forwarding settings, rebooted the guest os, but I still can't access ssh or http. Any ideas?

Posted: 18. Jan 2009, 20:49
by Sasquatch
What is the IP of the Guest? Use that in the browser from the Host.

Posted: 19. Jan 2009, 02:02
by carver
Thanks for everyone's help!

It worked in the end to access the guest os server from a host os browser by using the IP address as returned from inside the guest os.

(I was making the mistake of trying to figure out the ip address from the host os side)

Re: how can I see my apache web server

Posted: 22. Feb 2011, 17:22
by jhardin
What I found fixed the issue for me was making sure that the windows VirtualHost-Only adapter was set to the .1 address for the ip range so my virtual box host only adapter was 192.168.58.20 but the ip for the Windows adapter is 192.168.58.1