Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


  • 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 (


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

Network error: connection refused

How can I diagnose & resolve this issue?

share|improve this question

Problem was solved by enabling the DHCP server on the VirtualBox network adapter.

VirtualBox (latest version, version 5) -> File -> Preferences -> Network -> Host-only networks (tab) -> Host-only networks details (Icon tool) -> DHCP Server

  1. Tick Enable Server
  2. Fill in the IP address
  3. OK, OK
  4. Restart the virtual machine

My settings for step 2

  1. Server Address:
  2. Server Mask:
  3. Lower Address Bound:
  4. Upper Address Bound:
share|improve this answer

In your Linux box (VirtualBox Ubuntu), open the Terminal and enter the following command: sudo service ssh start

Try connecting to it again after this

Oh my bad I missed what gronostaj pointed out

OK sometimes the solutions are really simple. recently I faced the same issue with Slackware guest on windows 7 host. All i had to do was ifconfig up eth'X' and assign IP sub net (if host only adapter) This question is almost one year old, so I'm mentioning this for someone like me stumbles on this page searching for "ssh connection refused" ;-)

share|improve this answer
OP had stated that local SSH connections work, so the server is running. – gronostaj Mar 16 '13 at 22:02

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 was actually the Windows interface IP and the host OS IP was

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.

share|improve this answer
+1, The VirtualBox default is to create a guest whose virtual network adapter is NAT'ed through VirtualBox itself. Therefore such a guest would be able to SSH out, and would be able to SSH itself, but it would not be able to receive SSH connections until Port Forwarding rules were created in VirtualBox. – Gord Thompson Mar 17 '13 at 12:30
+1 After 1h of Google-mess, finally! I thought the .101 was the guest not the host! – 5chdn Jul 8 '14 at 17:33

Maybe it's an issue with access control. To disable it and allow full access, as root:

xhosts +

I had a similar issue with VNC viewer

share|improve this answer
I really doubt that, IMHO sshd has nothing to do with X -- in contrast to vnc. – mpy Mar 16 '13 at 20:44

You should check that your guest OS firewall is not blocking incoming connections on port 22.

share|improve this answer
The guest OS firewall is disabled. That is the default, and I verified it is disabled with sudo ufw status. – Eric J. Sep 25 '12 at 3:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.