VirtualBox

Ticket #3182 (closed enhancement: wontfix)

Opened 5 years ago

Last modified 5 years ago

NAT: VM to VM comunication and Host to VM not possible

Reported by: luizluca Owned by:
Priority: major Component: network/NAT
Version: VirtualBox 2.1.2 Keywords:
Cc: Guest type: other
Host type: Linux

Description

Hello,

As all my VM gets IP 10.0.2.15, I imagine that I cannot access a NAT VM from another NAT VM or even Host PC. I believe that implementing a (optional) common network would help a lot.

For example, I cannot install a DC and a Win Workstation and test them together while using NAT.

Change History

comment:1 Changed 5 years ago by sandervl73

  • Status changed from new to closed
  • Resolution set to wontfix

This works as designed and the NAT limitations are documented. Use host interface networking.

comment:2 Changed 5 years ago by larsr

This is very bad IMHO.

comment:3 Changed 5 years ago by frank

I would suggest you to learn how NAT works. A machine behind a NAT router is never directly accessible from the outer network, and this is not different with VirtualBox.

comment:4 follow-up: ↓ 5 Changed 5 years ago by larsr

The problem is that port forwarding doesn't work correctly.

It doesn't work for VMs on the same host, but it works as it should between VMs on different hosts.

If port 5000 on the host is forwarded the host to VM1, then the VM1 should be reachable on that port by NATed VMs. Irrespective of whether they are on the same physical host or not.

comment:5 in reply to: ↑ 4 Changed 5 years ago by Hachiman

Replying to larsr:

The problem is that port forwarding doesn't work correctly.

It doesn't work for VMs on the same host, but it works as it should between VMs on different hosts.

If port 5000 on the host is forwarded the host to VM1, then the VM1 should be reachable on that port by NATed VMs. Irrespective of whether they are on the same physical host or not.

Let's assume VM1 and VM2 with NAT networking. Do you mean that it's impossible for co-exists two VMs with the same port-forwarding, e.g. 5000 for VM1 and 5000 for VM2? or two VM with any port-forwardings?

comment:6 follow-up: ↓ 7 Changed 5 years ago by larsr

I mean:

On host1 there are two NATed VMs: VM1 and VM2 On host2 there is one NATed VM: VM3

host one forwards port 5000 to VM1

VM2 can't connect to host1:5000 but VM3 _can_ connect to host1:5000

comment:7 in reply to: ↑ 6 Changed 5 years ago by Hachiman

Replying to larsr:

I mean:

On host1 there are two NATed VMs: VM1 and VM2 On host2 there is one NATed VM: VM3

host one forwards port 5000 to VM1

VM2 can't connect to host1:5000 but VM3 _can_ connect to host1:5000

Thanks for clarification. Does it make any difference if you use 10.0.2.2 or host1 IP while accessing VM1 from VM2?

comment:8 Changed 5 years ago by larsr

Thanks for your suggestion. Something really strange happens:

When I use the IP address to telnet to the port, either 10.0.2.2 or the globally routable IP address of the host, it WORKS!

However, when I use the DNS name of the host, I get the error

Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused

See here:

vm1:~$ telnet 193.10.64.215 40022
Trying 193.10.64.215...
Connected to 193.10.64.215.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.1p1 Debian-5ubuntu1
^C
Connection closed by foreign host.
vm1:~$ host cluster5.sics.se
cluster5.sics.se has address 193.10.64.215
cluster5.sics.se mail is handled by 0 fsmsg1.sics.se.
vm1:~$ telnet cluster5.sics.se 40022
Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused

This must be related to Ubuntu in some way.

I was unable to replicate this bug in Windows XP. The Windows machine could connect to the VMs on the same physical host.

comment:9 follow-up: ↓ 10 Changed 5 years ago by larsr

SOLVED. The problem was caused by an entry in /etc/hosts that aliased the DNS name to 127.0.0.1 When the entry was removed, everything worked as expected.

I will see if that entry is put there by Ubuntu during install. I suspect it is, because I don't know where it would have come from if not...

comment:10 in reply to: ↑ 9 Changed 5 years ago by Hachiman

Replying to larsr:

SOLVED. The problem was caused by an entry in /etc/hosts that aliased the DNS name to 127.0.0.1 When the entry was removed, everything worked as expected.

I will see if that entry is put there by Ubuntu during install. I suspect it is, because I don't know where it would have come from if not...

Thanks for update.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use