Two VMs with 'Internal Network' cannot communicate with each other.

Discussions related to using VirtualBox on Linux hosts.
Post Reply
timothylegg
Posts: 16
Joined: 20. Dec 2017, 09:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: WinXP, Ubuntu, FreeDOS, Android
Location: Guin, AL, USA or Nürnberg, Germany
Contact:

Two VMs with 'Internal Network' cannot communicate with each other.

Post by timothylegg »

This is a follow up to a thread back in December that had evolved to such a degree, that the title was no longer descriptive of the content. Also, I was gone for nearly a month in the meantime.

viewtopic.php?f=7&t=85952

VirtualBox Graphical User Interface Version 5.2.4 r119785 (Qt5.6.1)

These two machines have statically assigned IP addresses of 192.168.56.10 and 192.168.56.20. The ssh server can be reached via it's own IP address, but not that of it's sibling machine. This behavior is described in the attached screenshot image. Note: The preview below only displays a portion of the uploaded screenshot.
Screenshot from 2018-01-22 01-05-41.png
Screenshot from 2018-01-22 01-05-41.png (109.5 KiB) Viewed 6424 times
What do I need to perform in order for these VMs to communicate to each other, as if they were attached on the same router?

What diagnostic information should I provide to help solve this issue? These systems both have Ubuntu Server 16.04 and have had very little modification from the default.

Code: Select all

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet static
address 192.168.56.10
netmask 255.255.255.0
gateway 192.168.56.1

Code: Select all

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet static
address 192.168.56.20
netmask 255.255.255.0
gateway 192.168.56.1
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Two VMs with 'Internal Network' cannot communicate with each other.

Post by socratis »

You know the saying "A picture is worth 1000 words"? Well, not always. I was trying to figure out what was going on, so let me see if I got it right:
  • You're using ssh to connect from 192.168.56.10 to itself. That works.
  • You're using ssh to connect from 192.168.56.20 to itself. That works as well.
  • You are trying to connect from one to the other. That fails with:
    ssh: connect to host 192.168.56.## to port 22: No route to host
I'd start by looking at the Ubuntu Network Configuration article. Not a network guru, but I suspect that you need to configure a default gateway, with the 'route' command on both of your guests:
  • sudo route add default gw 192.168.56.1 enp0s3
But, as I said, this looks like a configuration issue with your guest, not with VirtualBox. Treat it accordingly...


PS. Of course there are limits to the width of your pictures in the forums, not everyone is on a 4K monitor... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Two VMs with 'Internal Network' cannot communicate with each other.

Post by Perryg »

192.168.56.## is the same IP range as the host-only provided by VirtualBox. Are we sure this is not actually causing a conflict?
timothylegg
Posts: 16
Joined: 20. Dec 2017, 09:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: WinXP, Ubuntu, FreeDOS, Android
Location: Guin, AL, USA or Nürnberg, Germany
Contact:

Re: Two VMs with 'Internal Network' cannot communicate with each other.

Post by timothylegg »

Perryg wrote:192.168.56.## is the same IP range as the host-only provided by VirtualBox. Are we sure this is not actually causing a conflict?
Well, I don't know. DHCP handed me the address during an earlier session, so I figured it was valid.

I changed /etc/network/interfaces to use addresses of 192.168.10.10 and 192.168.10.20, and the behavior is exactly as before.
timothylegg
Posts: 16
Joined: 20. Dec 2017, 09:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: WinXP, Ubuntu, FreeDOS, Android
Location: Guin, AL, USA or Nürnberg, Germany
Contact:

Re: Two VMs with 'Internal Network' cannot communicate with each other.

Post by timothylegg »

I tried the route command and rebooting, just to make sure. The symptoms are the same.

Yeah, they didn't fit on my screen either, but cut-pasting text from a VM isn't possible. But after transcribing one of the screens, I created a floppy disk image to copy the typescript onto. Since I already had the picture, I figured it wouldn't hurt to add it.

I really thought that networking on Ubuntu via VirtualBox was something that would just work out-of-the-box. That's what the documentation led me to believe. I'm no network expert either, but have been wondering if two Raspberry Pi's and my old Netgear router would be easier...

I could take this to UbuntuForums.com and see what they say.
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Two VMs with 'Internal Network' cannot communicate with each other.

Post by Martin »

Did you try to ping between the systems before starting with ssh?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Two VMs with 'Internal Network' cannot communicate with each other.

Post by socratis »

timothylegg wrote:I really thought that networking on Ubuntu via VirtualBox was something that would just work out-of-the-box. That's what the documentation led me to believe.
It does. I have no problem absolutely with as many guest as you'd like me to throw at it. Everything is set to automatic (DHCP) and I have custom HostOnly, Internal (with DHCP) and NATnetworks. IP ranges and DHCP servers are customized. The guests aren't, they're all set to automatic. All my guests have 4 NICs; HostOnly, Internal, NATnetwork, Bridged. Never had an issue with any of my guests or a combination of N of them, no matter which or how many NICs have their cable connected or not...
timothylegg wrote: I'm no network expert either
I'd start from that. If you're not, then don't try things manually until you have a good understanding of what's going on or how you're supposed to set things up. I know what iptables, arp, ifconfig and netstat do, but I still don't claim to be a network expert. Try things with their defaults. Once you know what's going on, then start swimming into deeper waters...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
timothylegg
Posts: 16
Joined: 20. Dec 2017, 09:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: WinXP, Ubuntu, FreeDOS, Android
Location: Guin, AL, USA or Nürnberg, Germany
Contact:

Re: Two VMs with 'Internal Network' cannot communicate with each other.

Post by timothylegg »

For reasons I can't grasp, my post was deleted from UbuntuForums without any explanation or notification (this has happened twice within the last month or so). I'm guessing it was too far off topic for the General Forum or it was because I inserted a link to this thread.

My lack of understanding of iptables and ifconfig is precisely why I only have one NIC emulated. I can revert the VM back to DHCP exactly as it was installed. The file /etc/network/interfaces is the only file that was customized. The only requirement is machine A and machine B to communicate to each other and I don't know how to make it work with the defaults for Ubuntu/VirtualBox. If it can help, I'll even delete and reinstall them fresh using VirtualBox's and Ubuntu's defaults. That will take me about an hour to do that but it's over a month in this project and I really need to get to step 1.

I can bring in other NIC's but I'll need to know how to configure them because TCP/IP, UDP and the rest of that is one frog's eye away from magic. I've bought various books, but block diagrams and wedding cake metaphors have been little help with the practical understanding of how it works above the electron-flow model.
Last edited by socratis on 30. Jan 2018, 21:09, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
timothylegg
Posts: 16
Joined: 20. Dec 2017, 09:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: WinXP, Ubuntu, FreeDOS, Android
Location: Guin, AL, USA or Nürnberg, Germany
Contact:

Re: Two VMs with 'Internal Network' cannot communicate with each other.

Post by timothylegg »

Okay, just to prove an attempt, I created two new machines and named them Calvin and Hobbes. Both are Ubuntu Server 16.04.3. Neither of these two machines have been customized at all. The host configuration is at default too. Upon booting, both machines have been assigned the same IP address of 10.0.2.15, which isn't helpful for machine-to-machine communication. After noticing that, I recalled that was the precise reason I chose a static IP over the default of DHCP.

So, how exactly is a user able to get two machines on the same host system to be able to contact each other? This time I modified nothing, touched nothing. Everything is default.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Two VMs with 'Internal Network' cannot communicate with each other.

Post by socratis »

You need to do some reading. The default NAT always assigns the 10.0.2.15 IP on all of its guests. They're isolated, behind a NAT. That's the idea. The default is to allow guests easy and painless access to the network, not to cover specific usage scenarios.

Please read the following: User Manual, ch. 6.2. Introduction to networking modes including the Overview table, which shows quickly what kind of connection is required to achieve what you want. And remember, you can always have more than one network card in your guest to cover multiple scenarios.

And after that, keep reading ch. 6. Pretty much every other mode, except NAT, allows VM-to-VM configuration. I do not which of then have a DHCP enabled by default, but you can definitely configure easily the HostOnly and the NATservice (or NATnetwork) modes.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
timothylegg
Posts: 16
Joined: 20. Dec 2017, 09:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: WinXP, Ubuntu, FreeDOS, Android
Location: Guin, AL, USA or Nürnberg, Germany
Contact:

Re: Two VMs with 'Internal Network' cannot communicate with each other.

Post by timothylegg »

I remember reading Chapter 6. I read through it again and I came across the same problems I ran across back in November.

I set it to Internal Network and when Ubuntu boots, in it's default state...

"A start job is running for Raise network interfaces(4min 30s / 5min 4s)"

which places a 304 second time penalty for me attempting this configuration.

So that certainly didn't work...

I went the Host Only Adapter approach. I ran the command

Code: Select all

VBoxManage hostonlyif create
and then configured the two VMs. This time, it worked. I had done this before back in November, so I have no idea what is different. I document everything and delete nothing, so I'll go back and read through my steps.

I'm a little on the paranoid side right now, so I won't make further changes until I am certain that I can restore all configuration data efficiently from a backup copy. I was literally 18 hours away from buying three cheap PC's for the task of a VM host.

I appreciate the help, and the patience everybody had. Make your final replies and this will be SOLVED.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Two VMs with 'Internal Network' cannot communicate with each other.

Post by socratis »

timothylegg wrote:I set it to Internal Network and when Ubuntu boots, in it's default state...
A start job is running for Raise network interfaces(4min 30s / 5min 4s)
So that certainly didn't work...
That's because you had it set up for a DHCP server, and a DHCP server was not available.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply