SSH Between MAC OSX Host and CentOS VM On NATNetwork

This is for discussing general topics about how to use VirtualBox.
Post Reply
Hamerins
Posts: 6
Joined: 31. Jul 2017, 09:37

SSH Between MAC OSX Host and CentOS VM On NATNetwork

Post 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.
Last edited by socratis on 31. Jul 2017, 10:49, edited 1 time in total.
Reason: Enclosed the information in [code] tag for better readability
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: SSH Between MAC OSX Host and CentOS VM On NATNetwork

Post 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.
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