1

I've got two instances of Ubuntu Server running in VirtualBox, mimicking a cluster we're putting together. I'll be using static IPs and communicating with SSH/MPI, which works on the real machines, but I can't get my two virtual machines to see each other. I'm seeing from various posts how this might be done, but the different network options in VirtualBox are confusing.

So far, I have:

  • Set the static IPs in /etc/network/interfaces
  • Confirmed that I have an adapter (enp0s3)
  • If I set the VM's network to NAT, it let's me connect to the internet (download packages, etc) but not the other machine
  • If I set them to Bridged (en0: Wi-Fi (AirPort)), I get no ping connection to either the internet or other VM

EDIT:
As requested, here's the output of ip addr on one of the nodes:

enter image description here

And ip route:

enter image description here

1 Answer 1

1

You could use Internal networking to connect the hosts. Assign static addresses to the hosts so they are on the same subnet. If you need access to the internet, you could make one of the clustered machines a router with two interfaces, one connected to the internal network and the other NATed or bridged. Add a default route on the other machines pointing to the router host. Also remember to enable packet forwarding on the host acting as a router by putting the following line in /etc/sysctl.conf:

net.ipv4.ip_forward = 1
10
  • Hmm, doesn't work for me. I have static IPs assigned to both machines (192.168.1.6 and 192.168.1.7). I set the network for both to Internal, which has the default name intnet. Am I missing a step to get them to ping or ssh each other? Commented Nov 14, 2017 at 22:39
  • 1
    What is your netmask? What is the output of ip addr and ip route? Commented Nov 15, 2017 at 7:06
  • Output posted above as screenshots. My netmask is 255.255.255.0. Commented Nov 15, 2017 at 13:57
  • 1
    Check the addresses to see they are on the same subnet. You screen dump says 192.169.1.6, not 192.168.1.6. Commented Nov 15, 2017 at 14:14
  • [facepalm] yeah, that helped! With the internal network I can now ping and ssh between them. But I can't figure out how to get an outside connection on one of the nodes? Adding a second interface is grayed out in VirtualBox. Commented Nov 15, 2017 at 15:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .