[Solved] Access Guest machine via ssh works; http doesn't

Discussions related to using VirtualBox on Windows hosts.
Post Reply
dca
Posts: 5
Joined: 28. Aug 2009, 19:21
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Fedroa 11

[Solved] Access Guest machine via ssh works; http doesn't

Post by dca »

Hello,

I'm new to VirtualBox and I'm having some problems connecting to my guest HTTP server

I'm running the following:

Host: Windows XP Pro
VirtualBox: 3.0.4
Guest: Fedora 11
Linux Guest Additions
Networking: PCNet (Attached to NAT)
Apache is working (serves pages in VirtualBox;)

Code: Select all

C:\Program Files\Sun\xVM VirtualBox>VBoxManage getextradata Fedora11 enumerate
VirtualBox Command Line Management Interface Version 3.0.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Key: GUI/SaveMountedAtRuntime, Value: yes
Key: GUI/ShowMiniToolBar, Value: yes
Key: GUI/MiniToolBarAlignment, Value: bottom
Key: GUI/LastCloseAction, Value: powerOff,discardCurState
Key: GUI/LastWindowPostion, Value: 651,58,720,442
Key: GUI/Fullscreen, Value: off
Key: GUI/Seamless, Value: off
Key: GUI/AutoresizeGuest, Value: on
Key: GUI/MiniToolBarAutoHide, Value: on
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort, Value: 8888
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort, Value: 80
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol, Value: TCP
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort, Value: 2222
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort, Value: 22
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol, Value: TCP
I can connect to the guest ssh using putty (Host Name: localhost, port 2222)

Doing a port scan on localhost shows ports 2222 and 8888 are open.

When I try to use Firefox to go to http://localhost:8888/ it won't connect.

Any help would be greatly appreciated
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Access Guest machine via ssh works; http doesn't

Post by vbox4me2 »

Is apache configured to listen on all interfaces?
dca
Posts: 5
Joined: 28. Aug 2009, 19:21
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Fedroa 11

Re: Access Guest machine via ssh works; http doesn't

Post by dca »

I believe so.
httpd.conf shows:
Listen 80
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Access Guest machine via ssh works; http doesn't

Post by vbox4me2 »

Then try wget and see if the apache logfiles show any access.
dca
Posts: 5
Joined: 28. Aug 2009, 19:21
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Fedroa 11

Re: Access Guest machine via ssh works; http doesn't

Post by dca »

The apache log files don't show any access for wget, just the tests I've done from within VirtualBox

When I run wget from my host this is the result:

Code: Select all

--2009-08-28 14:13:52--  (try: 1)  http://localhost:8888/
Connecting to localhost|127.0.0.1|:8888... connected.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in
 headers.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Access Guest machine via ssh works; http doesn't

Post by Sasquatch »

Set a second NIC for the Guest, and attach it to Host-Only. Then, in the main VB preferences, configure the interface and enable the DHCP server. Start the VM, check it's Host-Only IP address and connect to there from the Host. What do you get then?
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
dca
Posts: 5
Joined: 28. Aug 2009, 19:21
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Fedroa 11

Re: Access Guest machine via ssh works; http doesn't

Post by dca »

I can't connect at all to the IP

I don't think I configured it right. How do I configure it properly?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Access Guest machine via ssh works; http doesn't

Post by Sasquatch »

Using something like this as the config in the VB prefs, then use DHCP on the Guest to obtain an IP address which you can use to access the webserver from the Host. You can use any IP range you like, the default VB presents you will do (192.168.56.1, netmask 255.255.255.0).
Attachments
IP settings Host-Only adapter
IP settings Host-Only adapter
Screenshot-1.png (17.03 KiB) Viewed 2583 times
DHCP Server settings
DHCP Server settings
Screenshot-2.png (18.61 KiB) Viewed 2582 times
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
dca
Posts: 5
Joined: 28. Aug 2009, 19:21
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Fedroa 11

Re: Access Guest machine via ssh works; http doesn't

Post by dca »

I *think* I might have figured out what was happening.

The firewall in Fedora wasn't configured to allow HTTP traffic. So I ran system-config-firewall and enabled it.

I can now view pages served from the Guest on the Host.

Thanks for the help!
Post Reply