I have an Ubuntu VM instance running on my laptop. Both Host and VM run the same OS - Ubuntu 12.04. I tried to ssh from host like

ssh username@<VM-IP>

It tries for some time and then says

ssh: connect to host <ip-address> port 22: Connection timed out

Then I tried to ping

I get 100% packet loss. Which I guess is because there is no established route. How should I fix this?


Ensure ssh is installed on the VM

sudo apt-get install openssh-server

Ensure networking is enabled for the guest OS

| improve this answer | |

You need to setup port-forwarding for the SSH port that the openssh-server is using in your VM. Also have a look at Portforwarding from host to guest using port 80, but it doesn't work. bodhi.zazen's answer links to the corresponding chapter in the manual, which walks through the commands needed to setup port-forwarding and uses SSH as an example. As far as I can remember you can also do this with the GUI in recent versions (since version 3 I think).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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