Access webserver in VM

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Herbi
Posts: 2
Joined: 17. Feb 2009, 12:26

Access webserver in VM

Post by Herbi »

Hi!

I have a VM with a Debian webserver. The network connection is set to NAT.

I want to connect from my host to the webserver on the guest system. How do I set up a port forwarding rule to make this possible?

Greetings,
Herbi
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

You forward localhost:8080 -> guest:80, then browse http://localhost:8080/

This will work as long as all of your hrefs host relative. However since 2.1, I've stopped stopped doing this and just use a Host IF -- far simpler
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Herbi
Posts: 2
Joined: 17. Feb 2009, 12:26

Post by Herbi »

Thx!
Does Host IF work if my host is not connected to a network?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

You are correct in that if you do not have a "connected" then Host IF doesn't work correctly. Something to raise as an issue, I think.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Post by vbox4me2 »

Or buy a 20$ switch and plug it in.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

You might also be interested in http://www.virtualbox.org/ticket/3376
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Post Reply