1

A devbox has Windows 8.1 as the host OS running VirtualBox and a virtual machine with CentOS 7 for development. The devbox is connected to a CentOS 7 development server through an Ethernet cable. The development server is not connected to the Internet, or to any other computer.

The devbox Windows 8.1 host OS is able to SSH to the development server using PuTTY after making the config changes described in this other post. However, the CentOS 7 virtual machine inside the devbox is not able to make SSH connections to the development server.

In the devbox virtual machine, when I type

cd /etc/sysconfig/network-scripts

And then type:

ls ifcfg-*

The terminal prints out ifcfg-lo.

When I next type:

nano ifcfg-lo

The terminal shows:

DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback

However, I hesitate to make the other changes shown in the other posting because the devbox virtual machine needs to retain the ability to ssh over the Internet also.

What changes need to be made in the devbox to allow the CentOS 7 VM to SSH into the development server?

Note that the virtual machine on the devbox is able to SSH to remote servers over the Internet. So the current problem is just getting it to know how to connect to the local Ethernet development server when a user types ssh [email protected].

1
  • how do you have your virtual network set up in VirtualBox?
    – Jakuje
    Sep 3, 2015 at 6:41

1 Answer 1

2

My suspicion is that on Oracle VirtualBox the networking is set to 'NAT'. This would explain why you can SSH to the Internet as the Windows 8.1 host NATs the guest's IP addresses for you and sends them out on the hosts external facing interface (which I assume you have, but you haven't mentioned).

Change the networking on the guest to 'Bridge' and connect that bridge to the ethernet device that connects to the CentOS dev server. Next, change the IP address of the VM (using the instructions in that linked post) to one within the range used by Ethernet network such as 192.168.100.3.

You could use the host IP address as the default gateway of the VM to save changing it again if you decide to use Internet Connection Sharing on the host to allow the CentOS machines to access the Internet.

3
  • Thank you and +1 for getting me to name it 192.168.100.3 and for directing me to the Networking Settings in VirtualBox. You also got me to stick with lo protocol. As it turned out, NAT networking was the best choice because it allows port forwarding. I set up a port forwarding rule to direct ssh traffic to the development server. This will become tedious over time as I have to turn port forwarding off and then on again, but for the time being it gets me what I need. The Bridge Networking Adapter GUI in VirtualBox did not give an option for port forwarding, but the NAT adapter did.
    – CodeMed
    Sep 4, 2015 at 0:30
  • @JakeGould - What's wrong with static IPs? This is a dev server after all. The post linked in the OPs question uses static IP addressing to get the physical machines to talk, this is just an extension of that. Sep 4, 2015 at 6:38
  • @CodeMed - the alternative would be to configure Internet Connection Sharing to NAT the physical ethernet adapter of your Windows machine to the adapter you are using to connect to the Internet (WiFi?). Sep 4, 2015 at 6:41

You must log in to answer this question.

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