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.

I have Ubuntu 12.10 installed, and 12.04 Server set up in my virtual machine.

My VM has internet access, and I can ping it from my host.

ping symfony.dev # points to 192.168.56.101, and successful ping.

The problem is that I can't connect to it using SSH

me@ubuntu:~$ ssh root@symfony.dev
ssh: connect to host symfony.dev port 22: Connection refused
me@ubuntu:~$ ssh -p 21 root@symfony.dev
ssh: connect to host symfony.dev port 21: Connection refused

There doesn't seem to be an IP conflict, if I close the machine I can't ping the address anymore.

SSH is installed on the VM (I did try sudo apt-get install openssh-server, but it seems this package doesn't exist, only openssh-client - which is already installed, and ssh works from VM).

Any ideas on how I can get this to work ?

Solution:

I needed to install openssh-server, but cound't do this without sshd.

sudo apt-get install sshd # next line won't work until you do this
sudo apt-get install openssh-server
share|improve this question
    
If memory serves, the server and client bundle is installed with apt-get install ssh. –  terdon Apr 14 '13 at 3:38

1 Answer 1

up vote 2 down vote accepted
  1. From within the VM, can you ssh to localhost? If not, check your ssh server.
  2. If you aren't using bridged mode for networking, you may need to access VirtualBox settings and forward port 22. This article has instructions and screenshots.
  3. Is there a firewall running on the VM? Ubuntu ships with ufw, so try ufw status first, before tinkering with iptables.
share|improve this answer
    
The problem was #1, it seems I had to install sshd before openssh-server, or else it doesn't work, or even appear in the autocomplete list. Thanks ! –  Vlad Preda Apr 14 '13 at 9:51
1  
Just as a side note, the other 2 options are very good to know. I was using bridge mode for networking, and ufw was disabled –  Vlad Preda Apr 14 '13 at 19:10

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.