13

I am trying to run a server on one VM and a client on another; both VMs have ScientificLinux 6.4 as their OS, running on VirtualBox 4.2.10.

The client should be able to communicate with the server via MPI and the server will ingest information into a MySQL database. The client and server software will communicate and run successfully on one machine; however, it fails to run between machines.

At first, I was using the default NAT network. Then, I tried using the GUI to create an internal network and a bridged network between the machines; however, they still could not communicate. I then tried to SSH between the machines; this did not work. I think that if I can SSH between the machines that the Client and Server should be able to successfully communicate with each other.

Has anyone run into this problem before?
What should I try to do to resolve this?

EDIT: The other thing I am confused about is that the VMs do not seem to have unique IP addresses; when I execute ifconfig, I find that the IP addresses are both 127.0.0.1 under the lo (Local Loopback) section. I cannot find any other IP addresses in any of the other sections, so that is all I have to work with.

2
  • Please run ifconfig on both machines, and append it to your question.
    – spuder
    Commented Jul 31, 2013 at 22:48
  • -1 why are you even talking about ssh when you say the machines can't communicate
    – barlop
    Commented May 15, 2015 at 13:41

5 Answers 5

6

You want to set up either an internal network or a host-only network. The practical difference between the two is that the host computer can participate in a host-only network, but not an internal network.

Assuming you want to use an internal network, the basic process is as follows:

  1. On each of the guest VMs, set its network adapter to "internal network" OR add an additional network adapter and set it to "internal network". Make sure that the network name is the same for each guest.

  2. Set up a DHCP server for the internal network, as described here.

  3. When you start the guest VMs, they'll see an additional network adapter. Most modern operating systems will configure the network interface from the DHCP server without any fuss.

If you use a host-only network, the process is as follows:

  1. From the Virtualbox VM manager, select File->Preferences->Network and set up a host-only adapter. You can set up a DHCP server from the GUI here. When you complete this process, you'll see a new virtual interface appear on the host. That is how you will communicate between the host and guests.

  2. On each guest, change its network adapter to use the host-only network, or add a new network adapter set to the host-only network.

  3. Start each guest. They should get an IP address from the DHCP server.

2
  • Firstly, the option to set up the host-only adapter now seems to be under File > Host Network Manger. My guests (Linux Mint 19) got IP addresses from the server, but I get ssh: connect to host <IP ADDRESS> port 22: Connection refused I don't know a lot about networking yet, but I know that port 22 is default for ssh. Both guests are configured with only one network adapter enabled, which is the host-only one. Any advice?
    – Ungeheuer
    Commented Jul 20, 2018 at 19:59
  • Two things, I had to enable the host-only network interface with nmcli device connect vboxnet0 (check the name of your virtual interface). Second, check firewall rules on both the host and guest.
    – Noah May
    Commented Aug 4, 2021 at 6:46
1

I usually setup bridged network for all my VMs, so I can access my VMs from anywhere on my network.

If you want make VM to VM communications faster, use host-only networking. For host-only networking, you have to enable it and create either a DHCP server (within options of virtualbox) or use static ip-addresses on you VMs.

I have DHCP on my router and I have an internal DHCP server for virtualbox. So if I have VMs with more than 1 internet/ethernet requirement, I create 1 bridged and 1 host-only network.

I also make sure "allow all" is enabled under the network card.

0

If you issue ifconfig and find that there is only a loopback interface that's listed, then you do not have any interface to communicate with your network.

I do not use Scientific Linux but it seems you could configure your network interfaces with the following command, as per this article:

system-config-network-tui

If it doesn't work, then you can edit the file by hand as stated in the article mentioned above.

0

You should have something like an eth0 interface on both machines. Make sure in your VirtualBox settings that you have a network enabled for both VM's, and that "Cable unplugged" isn't checked. Bridged networking is probably your best bet if you need the two VMs to communicate with anything besides each other, as it will use VirtualBox's virtual interface to get you IP's on the same network as your host (assuming your network has a DHCP server).

Once you verify those things, try:

/etc/rc.d/init.d/network restart

to try to bring up the interfaces again with a valid IP address.

-1

Check your firewall settings on the guests first.

Usually I start with ping, telnet and so on... I see no reason why it shouldn't work apart from misconfig of firewall or virtual network.

You must log in to answer this question.

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