How to enable port forwarding from host machine to virtual machine so that you can access the NAT ip (VMWare)
Often we need to access the virtual machine shell using some ssh client like mobaxtream or solar putty etc. for better visibility, fonts and copy-paste from host machine. But the challenge is your host machine say got the ip from your local wifi access point and say the ip is 192.168.5.100
And in the vmware workstation your NAT network got ip address from 192.168. 88.100
Now how you can connect your vm from physical machine? As they are different network so it will not connect.
That’s why port forwarding kicks in in vmware or virtual box platform. So finally here are the steps:
Click on Change Settings
Click on NAT Settings as you want to access the network which is under NAT subnet.
I have already add an entry. Click on Add
Now configure this way. You can choose any port that are not in use for your host port. I recommend choose above 10000. Here i choose 5000. Provide your vm IP and port number that vm currently listening on.
That is it from vmware. Save the settings.
Now on the ssh client, you need to create a new ssh session. Now do the things carefully after creating the session.
Remote host: Here you need to provide localhost ip which is 127.0.0.1
Username: On your vm machine, provide which username you choose to log on.
Port: You need to provide port 5000 that you specified in your vmware settings.
That’s it. Now click on Ok. It will ask you for password. Once you provide the password you should log in.
For windows:
Note: Enable rdp on the vm.
That’s it. Now click on Ok. It will ask you for password. Once you provide the password you should log in.
Now if use local windows RDP:
In the rdp console you just need to provide nat ip address of your windows host which is in this case 192.168.88.131 and hit enter. Provide the username and password (no pin). You should get access. :) If not then go to your network connections adapter by typing ncpa.cpl in the run dialog box. Find out the NAT VM adapter. In my case vmnet8.
Go to Virtual Network Editor
Try to disable it first. Then enable it. Then try to RDP again. Hopefully now it will work.
I hope you like it. Please subscribe below:
LinkedIn:
https://www.linkedin.com/in/md-mahimbin-firoj-7b8a5a113/
YouTube: