How to SSH to Linux virtual machine running in VM Player.
To SSH to a VM behind NAT running in VMware Player, you can follow these steps:
- Enable SSH on the virtual machine.
- Configure port forwarding on the NAT network configuration.
- Restart the VMware NAT service.
- SSH to the virtual machine using the forwarded port.
Pre-requisites
- VM Player
- Ubuntu VM
- Putty or CMD
- Learning Intent
Directions
- If your virtual machine is running in NAT interface mode.
- Open this file C:ProgramDataVMwarevmnetnat.conf in administrator mode
- Add this line under section : [incomingtcp]
2233 = :22
Eg: 2233 = 192.168.41.136:22 - Save this file.
- Either Restart your Virtual Machine or use these commands to restart the VMWARE NAT services.
net stop “VMWare NAT Service”
net start “VMWare NAT Service” - Now you should able to SSH to your virtual machine using these commands.
ssh @localhost -p 2233 - You may use TELNET command to validate the connectivity.
> telnet localhost 2233