0

I’m having troubles connecting to Apache web server that is running inside my VirtualBox Fedora guest OS.

This is my set up:

  • Host: Mac OS X
  • Guest: Fedora 22
  • Network adapter: NAT
  • Apache web server: running on Fedora guest under localhost:8090

On the Mac OS host, I do a netstat:

sebastian$ netstat
Active Internet connections
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)    
tcp4       0      0  172.26.6.51.49515      10.0.2.15.8090         SYN_SENT   
tcp4       0      0  172.26.6.51.49514      10.0.2.15.8090         SYN_SENT   
tcp4       0      0  172.26.6.51.49513      a23-46-123-27.de.http  ESTABLISHED

I can reach the Fedora host through SSH, using 172.26.6.51. I want to reach the webserver that is running on my Fedora guest. I’m trying to do that by entering this into my browser on my Mac host: 172.26.6.51:49515.

What am I doing wrong?

Using a bridged network adapter is no option, due to my network setup.

2 Answers 2

1

Honestly, netstat is too deep a networking tool for what you are attempting to do. My guess is that you could just connect to the Fedora guest OS directly like this:

172.26.6.51:8090

If you want to test this connectivity from the command line, just open up the Terminal window and type in the following:

curl -I 172.26.6.51:8090

That will make an HTTP request but only show you headers. This is a nicer and more efficient way to test an actual HTTP connection since this is a raw, immediate, non-browser-based connection that won’t be cached the same way a browser would cache it.

1

I solved this with VirtualBox' port forwarding functionality.

  • Host IP: 127.0.0.1
  • Host Port: 9001
  • Guest IP: 10.0.2.15
  • Guest Port: 8090

It doesn't matter which value you use for host port, as long as it's used by another service.

You must log in to answer this question.

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