An interesting routing problem

This is for discussing general topics about how to use VirtualBox.
Post Reply
factor3
Posts: 7
Joined: 17. May 2011, 23:40
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows 7, Windows XP SP2, Fedora 10 - 14, Other Linux's

An interesting routing problem

Post by factor3 »

I have a host machine that I am going to want to run multiple VMs on. Though the question I will ask is generic enough to apply to any host, in my case my host machine is running Fedora 15. My VMs will likely be running various operating systems.

What I want to be able to do is run multiple VMs that, in turn are running software that listens on a particular port. For the sake of concreteness, let's say that my VMs are all listening on Port 8083.

The rub here is that while each VM is listening on Port 8083, each VM is running a different application. Again for the sake of concreteness, let's say that I have two VMs, one called "A" and the other called "B". Both are running Tomcat, and both are using Port 8083 to receive requests. The difference is the applications being run on these VMs. One application is an e- commerce app, while the other does a lot of picture sharing. In fact, I would like to have two different URLs associated with the two VMs.

My problem is this: I would like to open up a single port to the Internet (because I am going to eventually have several VMs and I don't want a lot of ports open on my outer firewall!), and have HTTP requests that come in on that port to be routed to my host machine. On my host machine, depending on the request URL, I would like to route the request to the appropriate VM.

Does VirtualBox provide some way of doing this? If not, can anyone suggest some software that I can put on my host to handle this problem?

Someone please advise.
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: An interesting routing problem

Post by Sasquatch »

VirtualBox only provides in network access, not routing. From what you're describing, is something like a load balancer. It will listen on one port, but two urls, let's say vm1.yourdomain.org and vm2.yourdomain.org. They both point to the same IP address and port number, like a webserver serving multiple websites on different domains. The load balancer would then serve data from either VM1 or VM2 depending on the domain name used.

You can also install two instances of Tomcat and let it listen to the domain names, while maintaining the single IP and port configuration. Then you would need only one VM. You have to check the Tomcat configuration documentation for how to set it up like that.

In either way, this is not a VB question and should be asked in another forum more specialised in this kind of set up. You basically have two servers behind a single NAT router and you want to have them both accessible through a single TCP port.
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.
factor3
Posts: 7
Joined: 17. May 2011, 23:40
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows 7, Windows XP SP2, Fedora 10 - 14, Other Linux's

Re: An interesting routing problem

Post by factor3 »

Thanks for the info. I was uncertain whether or not this was something that VirtualBox solved. I am not a real expert in these matters.

Can you point me to where I should go to discuss this matter? I just need some clue as to what kind of software I am looking for...
Leak
Posts: 242
Joined: 31. Mar 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian Testing, Windows XP, Windows Server 2003/2008 R2

Re: An interesting routing problem

Post by Leak »

factor3 wrote:I just need some clue as to what kind of software I am looking for...
Can't help you with discussing this, but the software you're looking for is called a reverse proxy - Apache or Lighttpd can do that, among other things.

In your case you could install the reverse proxy on the host and use it to route requests to the appropriate VM, or you could run the reverse proxy in a VM and use VirtualBox's internal networking to keep everything contained.
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: An interesting routing problem

Post by Sasquatch »

factor3 wrote:Can you point me to where I should go to discuss this matter?
That would be the Apache website. Maybe they have a forum or mailing list you can ask your question.
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.
Post Reply