Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a windows 7 OS hosting Ubuntu server on VirtualBox.

The host OS is connecting to the internet via a USB 3G modem. What I'm trying to do is connect to the hosted Ubuntu server from another computer via the internet. Now I'm guessing there will be port forwarding involved.

So in other words, I want to forward all 22, 80, and 8080 port traffic coming in to my host OS from the internet to my hosted Ubuntu server, then my hosted Ubuntu server will process the request and then send it back to the client that made the request

Can this be done?

NOTES : VirtualBox is not allowing me to select the mobile connection when using bridged connection, I cannot bridge the VirtualBox network card with the 3G dongle.

share|improve this question
    
What network connection have you selected? NAT? Can you access the internet from the virtual machine? –  daxlerod Apr 3 '13 at 18:35
    
Ya everything regarding the NAT is working I have set up port forwarding on port 80, 8080, 22 and 21, I can access the virtual box web server locally no problem, the only thing now is to get all incoming traffic to my internet dongle from the outside world to be forwarded to this box and all will be good :) –  Illegal Opperator Apr 4 '13 at 8:16

2 Answers 2

You won't be able to use bridge in this case. Use NAT and setup the necessary port forwardings, make sure the host machine is not already binding those ports (Skype uses port 80 by default).

It should work except for one thing: Ports 22 and 80 are blocked by most ISPs. Before doing tests with your VM, check if the host machine is capable of opening those ports to the world.

Also, you won't be able to test if your port forwardings are working from your own machine. It will give you the sensation it is not. Only people from outside your network will try and successfully connect.

To test your port forwardings yourself, use online tool like the Open Port Check Tool.

share|improve this answer
    
Cool man thanks, will check it out, will post here again on what I found. –  Illegal Opperator Apr 4 '13 at 7:16
up vote 0 down vote accepted

This is quite simple after looking around quite a bit I came up with this, when configuring the virtual box network device to NAT, you can use port forwarding.

This is what you do to forward the port
1) Run a ipconfig to get your internet IP address, it will look something like 41.151.19.77
2) Go to setting -> network
3) Click the port forwarding button
4) In the list click on add new
5) Enter your Internet ip address as the host ip address, enter 80 as the port
6) Enter your linux servers ip address as the guest ip address, enter 80 as the port
7) Click ok

All incoming requests to your internet ip address on port 80 will be forwarded to your linux server

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.