Can't access ssh in my VM Centos
This looks like you're using VirtualBox VM with a NAT network (it seems to give the address 10.0.2.15 by default). If so, you need to set up a port forward to access port 22 on the VM from the host.
- Open Settings->Network for the VM
- Click the little blue arrow next to the Advanced box
- Click the box at the bottom labelled "Port Forwarding"
- Click the green "+" to add a rule
- Add the rule Host IP="127.0.0.1", Host Port="2222", Guest IP="10.0.2.15", Guest Port="22"
- From the host, you should be able to "ssh -p2222 127.0.0.1"
This is a bit stupid compared to the way VMWare does NAT. It creates a separate network interface on the host for NAT, so no forwarding is necessary.