The host cannot SSH the guest, but the guest can


Samaras

This is a follow-up question from: Getting virtualbox to get a different IP address than my laptop . I ended up using these files /etc/hostson both my laptop (host) running Ubuntu 14.04 and my virtual machine (guest) running Ubuntu 14.04 :

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 got the IP through this answer . When I set virtualbox to eth0 it doesn't return anything and the network seems to be disconnected, so in virtualbox I have the following settings:

Device -> Network -> Bridged Adapter (name wlan0)

I can use to switch from guest to host ssh master, but when on master I get:

gsamaras@gsamaras:~$ ssh slave-1
ssh: connect to host slave-1 port 22: Connection refused

Also note that on guest I get:

gsamaras@gsamaras-VirtualBox:~$ ssh localhost
ssh: connect to host localhost port 22: Connection refused

How to solve?


edit:

From the guest :

gsamaras@gsamaras-VirtualBox:~$ netstat -an | grep -w LISTEN | grep -w 22
gsamaras@gsamaras-VirtualBox:~$

From the 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
Yelia Gray

An easy way to check the ssh service is to start and run locally on the guest:

ssh localhost

or:

netstat -an | grep -w LISTEN | grep -w 22

If not installed, visit https://askubuntu.com/questions/51925/how-do-i-configure-a-new-ubuntu-installation-to-accept-ssh-connections

Related


The host cannot SSH the guest, but the guest can

Samaras This is a follow-up question from: Getting virtualbox to get a different IP address than my laptop . I ended up using these files /etc/hostson both my laptop (host) running Ubuntu 14.04 and my virtual machine (guest) running Ubuntu 14.04 : 127.0.0.1

SSH to Ubuntu host from Ubuntu VirtualBox guest?

Mountain X I want to SSH into my host (Kubuntu 12.04 64bit) from a VirtualBox guest running 32bit Ubuntu 12.04. The host has the latest VirtualBox from the Ubuntu repositories (4.1.12). The guest is a preconfigured VM that I downloaded from VirtualBoxImages.co

How to SSH from host to guest using QEMU?

Jobin How to setup ssh from host to guest using qemu? When booting a virtual machine, you can use port redirection without any special parameters as follows: /usr/bin/qemu-system-x86_64 -hda ubuntu1204 -m 512 -redir tcp:7777::8001 However, when I try to boot

SSH to Ubuntu host from Ubuntu VirtualBox guest?

Mountain X I want to SSH into my host (Kubuntu 12.04 64bit) from a VirtualBox guest running 32bit Ubuntu 12.04. The host has the latest VirtualBox from the Ubuntu repositories (4.1.12). The guest is a preconfigured VM that I downloaded from VirtualBoxImages.co

How to SSH from host to guest using QEMU?

Jobin How to setup ssh from host to guest using qemu? When booting a virtual machine, you can use port redirection without any special parameters as follows: /usr/bin/qemu-system-x86_64 -hda ubuntu1204 -m 512 -redir tcp:7777::8001 However, when I try to boot

Ubuntu host cannot Ping Guest Windows 10

Ragnason I have the following components: Host: Ubuntu 16.04.4 LTS. Guest: Windows 10 virtual machine. In the "Virtual" box, I've selected " " Bridged Adapterfor this Windows VM , and I've also changed the VM's static IP so that it matches my host Ubuntu. But

Virtualbox Vagrant Guest cannot use host DNS

Micardo On my company's Windows 10 host, I can run it successfully ping a.b.c. I have vagrant guests on Virtualbox and when I call I get ping a.b.can errorUnknown host I found that I should use natdnshostresolver1 on. But that didn't help me. I'm using the net

Ubuntu host cannot Ping Guest Windows 10

Ragnason I have the following components: Host: Ubuntu 16.04.4 LTS. Guest: Windows 10 virtual machine. In the "Virtual" box, I've selected " " Bridged Adapterfor this Windows VM , and I've also changed the VM's static IP so that it matches my host Ubuntu. But

Virtualbox Vagrant Guest cannot use host DNS

Micardo On my company's Windows 10 host, I can run it successfully ping a.b.c. I have vagrant guests on Virtualbox and when I call I get ping a.b.can errorUnknown host I found that I should use natdnshostresolver1 on. But that didn't help me. I'm using the net

Virtualbox Vagrant Guest cannot use host DNS

Micardo On my company's Windows 10 host, I can run it successfully ping a.b.c. I have vagrant guests on Virtualbox and when I call I get ping a.b.can errorUnknown host I found that I should use natdnshostresolver1 on. But that didn't help me. I'm using the net

Can both the host and the guest use the hardware directly?

Green Dragon I'm about to start experimenting with VT-d/PCI passthrough on new upcoming supported hardware, and was wondering if it's possible to use the video/audio hardware on both the host and guest OS, or if passing a piece of hardware to the guest means u

Can both the host and the guest use the hardware directly?

Green Dragon I'm about to start experimenting with VT-d/PCI passthrough on new upcoming supported hardware, and was wondering if it's possible to use the video/audio hardware on both the host and guest OS, or if passing a piece of hardware to the guest means u