I don't particularly need a "solution" to something, I'd just like to understand more of the landscape here.
So on my CentOS box, I installed a CentOS VM specifically for learning Puppet. When the login prompt appears, it prints a banner saying what IP address can be used to reach it through ssh. In this case, it prints an address in the 10.0.2.0/24 range. From my previous experience, I was immediately skeptical I would be able to reach the VM with that address, and likely not at all without some reconfiguration of the VM.
To confirm, after I logged in I used "ip addr" to see the advertised IP addresses, and it did show that IP address.
Unsurprisingly to me (because I've seen this happen before), neither ssh or ping to that VM from the CentOS host succeeded.
At that point, I closed down the VM and edited the VM settings in VirtualBox, and added a "Host-Only Adapter", and then restarted the VM. I then did "ip addr" again, and in addition to the "10.0.2.0/24" address, it showed an additional IP in the "192.168.56.0/24" range. I was able to ping and ssh to that addr from the host.
I knew that adding the "Host-Only Adapter" would do this, but frankly I don't understand what the "Host-Only Adapter" IS. I'd appreciate some illumination on what's happening here.
What other diagnostics could I show on either the guest or the host that would illustrate that I can or cannot reach the guest through a given IP?
I also note that when I run "ip addr" on the host, I see "10.20.17.142/21" and "192.168.56.1/24". The latter is labeled "vboxnet0", which is the default name given for the "Host-Only Adapter" in the vm settings. From what little I understand about subnetting, as both the host and guest appear to be on the same subnet, at least on that interface (not sure what that means exactly), that explains why I can reach it from the host.
I also note that I can ping BOTH of those addresses from the guest. I can understand it should be able to reach the "192.168.56.1/24" IP, but the fact that it reaches the "10.20.17.142/21" host confuses me, as that's not on the same subnet as the guest.
Again, any illumination you can provide would be useful.