This is a follow-up question from: Make virtualbox get a different IP address than my laptop. I ended up with these /etc/hosts files on both my laptop running Ubuntu 14.04 (the host) and my virtualbox running Ubuntu 14.04 (the guest):
127.0.0.1 localhost
127.0.1.1 gsamaras // gsamaras-VirtualBox
192.168.1.2 master // the host
192.168.1.9 slave-1 // the guest
I obtained the IPs with this answer. When I set the virtualbox to eth0, this won't return anything and the network seems to be disconnected, so in the virtualbox, I have this setting:
Devices -> Network -> Bridged Adapter (name wlan0)
I can ssh from guest to host with ssh master, but when on master, I am getting:
gsamaras@gsamaras:~$ ssh slave-1
ssh: connect to host slave-1 port 22: Connection refused
Also notice that, when on guest, I am getting:
gsamaras@gsamaras-VirtualBox:~$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
How to fix it?
EDIT:
From guest:
gsamaras@gsamaras-VirtualBox:~$ netstat -an | grep -w LISTEN | grep -w 22
gsamaras@gsamaras-VirtualBox:~$
From master:
gsamaras@gsamaras:~$ ping slave-1
PING slave-1 (192.168.1.9) 56(84) bytes of data.
64 bytes from slave-1 (192.168.1.9): icmp_seq=1 ttl=64 time=0.360 ms
connect to host slave-1 port 22and notconnect to host localhost port 22in your last test?