Cannot connect to Virtual Box Ubuntu via public IP

This is for discussing general topics about how to use VirtualBox.
Post Reply
Franner
Posts: 5
Joined: 25. Apr 2017, 18:39

Cannot connect to Virtual Box Ubuntu via public IP

Post by Franner »

Hi,
I am new in using VM, but already read a lot about configurations in order to solve my issue by myself the last couple of days.
I want to set up an Ubuntu based OS on the VM, run a doemon process and connect to this process by my host Windows System via the public IP adress of the Machine.
After I tried a lot different configurations I finally came up to use bridget adapter, in order to give the Ubuntu system its own IP Adress. I also implemented portforwarding at the side of the router.
So, after I start the mentioned daemon process, I can check the specific port on an online port checker. According to my expectation, it shows up that this port went open (here I used the public Ip adress of course). So, everything fine so far. But when I use telnet from the command Line of my windows host and check the port it is not possible. Also the attempt to connect to this port via various application is not possible. I alreade shut down the firewalls on my host for testing and checked if there are firewalls on the VM what is not the case I guess.

What else can be the problem in order to connect from my host to the VM via public IP and port number?
Franner
Posts: 5
Joined: 25. Apr 2017, 18:39

Re: Cannot connect to Virtual Box Ubuntu via public IP

Post by Franner »

Is it possible that the problem is located in the host tables ?
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Cannot connect to Virtual Box Ubuntu via public IP

Post by BillG »

I am not sure exactly what you are trying to do, or why, but I can guess. You want to connect to the guest using its public IP as if you were a user coming in from the Internet?

That is not possible. It has nothing to do with virtual machines. It won't work on a physical setup either. You simply cannot do that with both machines behind a NAT router. NAT will not send a packet out to the public side then port forward it back in to another address inside.
Bill
Franner
Posts: 5
Joined: 25. Apr 2017, 18:39

Re: Cannot connect to Virtual Box Ubuntu via public IP

Post by Franner »

Hi,
yes that's why I try to archive. I configured the VM with bridge network, so the Ubuntu System has its own IP adress. My final goal is to reach this Ubuntu System by another computer in another network. I just try to reach it by the host in order to test ist.
So, there must be a possibility to reach this UBuntu system from outside, isnt it?
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Cannot connect to Virtual Box Ubuntu via public IP

Post by BillG »

Yes indeed. That should work fine. The limitation only applies to machines on your local network.
Bill
Franner
Posts: 5
Joined: 25. Apr 2017, 18:39

Re: Cannot connect to Virtual Box Ubuntu via public IP

Post by Franner »

Hi,
you are right. I tried everything, studied all configurations and it acually worked fine :) thanks.
How does it come that I can't connect with my host via the public IP?

Thanks a lot !
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Cannot connect to Virtual Box Ubuntu via public IP

Post by BillG »

I thought that I had already explained that. It is because both the machines, client and target, have private addresses and are behind a NAT router. NAT will not send anything out through NAT to the public side to be redirected by port forwarding back to the private side.

If you cannot understand the reasoning, I guess you just have to accept that it cannot be done.
Bill
Franner
Posts: 5
Joined: 25. Apr 2017, 18:39

Re: Cannot connect to Virtual Box Ubuntu via public IP

Post by Franner »

Alright, thank you a lot :)
Post Reply