Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

4 Answers

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 192.168.56.xxx sub net 255.255.255.0 (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
add comment

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.

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
add comment

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
1  
I really doubt that, IMHO sshd has nothing to do with X -- in contrast to vnc. –  mpy Mar 16 '13 at 20:44
add comment

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

share|improve this answer
1  
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
add comment

Your Answer

 
discard

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.