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:

  1. Enable SSH on the virtual machine.
  2. Configure port forwarding on the NAT network configuration.
  3. Restart the VMware NAT service.
  4. 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

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *