2

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.

1
  • 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. Feb 6, 2010 at 13:12

5 Answers 5

2

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.

2
  • I use the VMware Workstation 6.5
    – Yongwei Xing
    Feb 6, 2010 at 6:11
  • It uses bridged mode.
    – Yongwei Xing
    Feb 6, 2010 at 6:12
1

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

0

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?

.

0

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?

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .