SSH fails often when contacting VM from remote machine

sshvirtualboxvirtualizationvmware-workstation

I have a Windows 8.1 Host in which I installed ubuntu server 15.05 in a virtual machine. I set an SSH server in the guest (ubuntu) and then I create a forwarding rule from the host port 2222 to the guest port 22.

If I try to ssh from the Host using ssh -p 2222 username@localhost I can connect with no problems to the vm.

If I attempt to connect from a remote machine (an OS X one) in the same local network with ssh -p 2222 username@192.168.X.X most of the times I get a Timeout error. When I actually manage to establish a connection, after some time it freezes until I get the error Write failed: Broken pipe.

I have disabled the firewall of my anti virus (Bitdefender) and created rules in the Windows firewall to allow traffic from the ports 22 and 2222. The problem persists even after disabling both firewalls (Actually, bitdefender's is always deactivated).

I also set UseDNS no in the guest's sshd_config file. There's no firewall installed in the Guest (ubuntu).

I see the problem happen with both vmware workstation 11 and VirtuaBox.

Best Answer

The problem seems to be that the VM network is not reachable from outside the Windows 8.1 machine. You can see that it works when you ssh to localhost:2222 and that may be caused because of the network configuration (probably is configured as NAT, the default)

When using VirtualBox you should configure the network of the VM to be bridged and that should do the trick. You may get more info from https://superuser.com/questions/810097/vmware-player-bridged-networking-no-longer-works-host-win8-1-guest-mint-17-l

Related Topic