SSH into VirtualBox Guest: Connection Refused

sshvirtualbox

Setup

  • Windows 7 64-bit host OS running VirtualBox 4.2, with Ubuntu 12.04 guest OS.
  • OpenSSH server is installed and running (ssh -v localhost connects locally in the guest machine).
  • Can SSH to external servers (no outbound Windows firewall rule blocking port 22)
  • Can ping the IP of the guest (192.168.56.101)

Problem

Using PuTTY to SSH to the IP of the guest OS (192.168.56.101), PuTTY returns almost immediately with

Network error: connection refused

How can I diagnose & resolve this issue?

Best Answer

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.

Related Question