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.

How can I connect to Linux (which is in a VM) from the host PC using putty? I can ping the 192.168.1.108 from my host PC. And there is sshd process running on Linux. I choose the SSH to connect, but gives error.

share|improve this question

migrated from stackoverflow.com Feb 6 '10 at 6:39

This question came from our site for professional and enthusiast programmers.

    
We really need to know which VM product you are using - vmware, virtualbox ... It would also be useful to know what host OS you are using - windows, mac or linux. –  Hamish Downer Feb 6 '10 at 13:12
add comment

5 Answers

Which VM product are you running? Also, check your VM's network settings. If it's running in bridged mode, it has an IP address in your host's LAN, which means you just connect to its IP address that way.

If your VM uses NAT mode, you need to set up your NAT to forward a specific port back into your VM. In VMware, there's a nat.conf file you edit to do this. I cannot speak about how you'd do this in other virtualisation products, though.

share|improve this answer
    
I use the VMware Workstation 6.5 –  Yongwei Xing Feb 6 '10 at 6:11
    
It uses bridged mode. –  Yongwei Xing Feb 6 '10 at 6:12
add comment

Is SSH enabled on your Linux client? Even if the process is running it may not be configured correctly to allow remote SSH connections.

share|improve this answer
add comment

you might try this:

  • Log into your VM (the client) from the console
  • open a terminal window
  • type sudo ifconfig
  • note down the ip addesses of your interfaces. Most likely you are interested in eth0.
  • try connecting to that address/those addresses (most likely only one) using putty.

does that work?

.

share|improve this answer
add comment

I think that you most likely need to have Workstation listening on the host for port whatever and forward it into your guest as port 22. This would keep your host's own port 22 open while delivering traffic into your guest. However, I only see port forwarding as part of NAT. Must your VM be using bridged network?

share|improve this answer
add comment

A lot depends on what host OS you have and what virtualization software you are using.

But many types of virtualisation software (including VirtualBox) default to not being able to access the guest from the host. However you can access the host from the guest.

For instructions for using ssh to connect in this case, you can follow these instructions for KVM or these instructions for VirtualBox.

share|improve this answer
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.