Page 1 of 1

SSH Between MAC OSX Host and CentOS VM On NATNetwork

Posted: 31. Jul 2017, 09:50
by Hamerins
Hello,

I have created a NATNetwork in VirtualBox -> Preferences -> Network -> Nat Networks with the name NatNetwork.

The details from VBoxManage is as follows

Code: Select all

$ VBoxManage list natnets
NetworkName:    NatNetwork
IP:             10.1.2.1
Network:        10.1.2.0/24
IPv6 Enabled:   No
IPv6 Prefix:    fd17:625c:f037:2::/64
DHCP Enabled:   Yes
Enabled:        Yes
loopback mappings (ipv4)
        127.0.0.1=2

Code: Select all

$ VBoxManage natnetwork list
NAT Networks:

Name:        NatNetwork
Network:     10.1.2.0/24
Gateway:     10.1.2.1
IPv6:        No
Enabled:     Yes

1 network found

Code: Select all

$ VBoxManage --version
5.1.26r117224

Ι have created a centos vm and it have the ip 10.1.2.4, when i try to ping the gateway from Mac OSX Host, its not reachable. But the ping to the gateway from vm is working. But i cannot ssh to the vm using the ip 10.1.2.4.

I have check ssh with both firewall enabled and disabled. but its not working

Also i have created a test hostonly network and ssh to that ip is working fine from Mac OSX Host.

Please let me know how to enable ssh to VM via NATNetwork on a Mac OSX Host.
I have tested the SSH VIA NATNetwork in windows and linux and it works fine for me.

Re: SSH Between MAC OSX Host and CentOS VM On NATNetwork

Posted: 31. Jul 2017, 11:01
by socratis
Moving to "Using VirtualBox" from "OSX Hosts", you'll have a wider audience there...
Hamerins wrote:Please let me know how to enable ssh to VM via NATNetwork on a Mac OSX Host.
You can't. The host does not participate in the NATnetwork network. You'll need to have HostOnly or Bridged if you want VM<->Host communication.

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.