How to access a VirtualBox VM guest through the internet remotely

matiasht

Distinguished
Oct 17, 2011
103
0
18,680
Hi, I just signed up for DynDNS through No-IP and now I can access my PC remotely anywhere through RDS built on the OS.

What I want to find out now is if I can access a VM running on my local machine ONLY.
My VM is connected to my host computer on a local network through Bridge Adapter on VirtualBox Setting.
Both guest and host are Windows 7 machines.
Any port forwaring option on Virtual Box I have to set up?

Any help?

Regards!
 

Shadow_Realm

Reputable
May 24, 2015
9
0
4,510
If it's setup as a bridged and has it's own internal IP address all you should have to do is turn off RDP on your main computer (As you can't really have 2 things listening onthe same port). You could always try and change the port around on the VM and see if that does the trick
 

matiasht

Distinguished
Oct 17, 2011
103
0
18,680
Thanks for the answer, Ill try disabling RDP on the host machine and see if it takes me to the VM directly.
How do I change the port around on the VM for RDP and how would I access through RDP on a different port?
 

matiasht

Distinguished
Oct 17, 2011
103
0
18,680
Ok, the port 3889 is already forwarded for the local IP address on my host machine, so everytime I do RDP I can see the host machine; so you're saying I should add the local IP of the VM into the router table. Should I remove the one from the host machine? Is there any way I can leave both and how would I choose between the two when putting my domain name into RDP?

Thanks for your answer!
 
Set up two port-forwarding rules:
Rule 1 for port 3889 goes to the IP address of the Host, port 3889
Rule 2 for port (eg) 3890 goes to the IP address of the VM, port 3889

When you set up your RDP client, you change port numbers depending on which computer you need access to. You might have to edit the .rdp file with NotePad, I am not sure whether you can specify port number using GUI.
 
Just add the port number after the IP address
5364ax.jpg
 

matiasht

Distinguished
Oct 17, 2011
103
0
18,680
So this is what happens when trying to open the ports that way on my router:

vIXbMo.jpg


So in this image you can see 192.168.0.107 is local IP address for the VM and it has it service port 3389 an internal port (3389 by default but this is editable), so I have access to the VM remotely no problems, cause the RDP port for it is open.

RwpELf.jpg


But when I try to open the port for the local PC...
So I put the regular service port for my local machine (the same one I did for my VM), and its local IP address 192.168.0.100

k0oVBh.jpg


This is the error message I get, do you have any ideas on how to get this sorted? :(
 
You already have a port forwarder which listens on "Service port" 3389 (that is your external IP address) forwarding it to your host RDP.

Set up another Port Forwarding for different "Service port" (eg 4489) pointing to 192.168.0.100, port 3389. Then, from outside, setup RDP client as in my previous message, with custom 4489 port.
 
This should work.

Just out of curiosity - you a forwarding HTTP/HTTPS, SMTP and VPN traffic all to different IP addresses - do you have that many "servers" in your network? Make sure all these servers are properly protected - it would take no time for the "bad" guys to discover them and start playing games.
 

matiasht

Distinguished
Oct 17, 2011
103
0
18,680
The only "real machine" there is 192.168.0.100, all the others are just VMs (some of them clients, other servers) for testing purposes.
Im just basically emulating a AD DS environment with several virtual servers and hosts to test the different services and features.