VirtualBox

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#3182 closed enhancement (wontfix)

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

Reported by: Luiz Angelo Daros de Luca Owned by:
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 (10)

comment:1 by Sander van Leeuwen, 15 years ago

Resolution: wontfix
Status: newclosed

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

comment:2 by Lars Rasmusson, 15 years ago

This is very bad IMHO.

comment:3 by Frank Mehnert, 15 years ago

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 by Lars Rasmusson, 15 years ago

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.

in reply to:  4 comment:5 by vasily Levchenko, 15 years ago

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 by Lars Rasmusson, 15 years ago

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

in reply to:  6 comment:7 by vasily Levchenko, 15 years ago

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 by Lars Rasmusson, 15 years ago

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 by Lars Rasmusson, 15 years ago

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...

in reply to:  9 comment:10 by vasily Levchenko, 15 years ago

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.

© 2023 Oracle
ContactPrivacy policyTerms of Use