SSH into VirtualBox Guest: Connection Refused
Are you sure the IP is for the guest OS. I had the same problem and it turned out that the IP I had been using all along, the 192.168.56.101 was actually the Windows interface IP and the host OS IP was 192.168.56.103.
You can verify by doing ipconfig / ifconfig on both.
NOTE: I had also setup a static IP which it turns out I didn't need at all. In case you try from the start I found this tutorial to be better.
None of the other solutions are good because:
- There is no point to ssh to your guest via bridge if the guest will loose access to internet
- All the other solutions above tell you to build a rocket to cross the road.
- Host Ubuntu Desktop 16.04
- Guest Ubuntu Server 16.04 (Running on Virtual box 5)
- Shut your guest Ubuntu down
- On Virtualbox go to Setting>network>Adapter1>Advanced>Portforwarding
- Name=SSH Hostport=2022 (or any port but 22) Guestport(22)
- Reboot your guest
- On you host open a Putty or whatever you use for SSH
- ssh [email protected] -p2022 (or any port you mentioned as hostport)
- Have fun you are in
You should check that your guest OS firewall is not blocking incoming connections on port 22.