How can I SSH directly into a VMWare virtual machine from an external computer?
Solution 1
You need to put your VMware Player network adapter into bridged mode. This will make the VMware Guest visible to the other computers on your network including to your VirtualBox guest.
If the VM needs to stay NATed then you will have to create a port forward rule on port 22. To do that you need to make sure that vmnetcfg
was installed when you installed VMWare Player.
Open that Utility by going to the directory where you installed VMware Player and run vmnetcfg.exe
. From there you will be able to create a port forwarding rule by choosing your VMs network adapter and selecting "NAT Settings". There is a section of that menu where you can create port forwarding rules. You'll want to forward port 22 to the VM (unless you've changed the ssh port on your server, then forward whatever that port is).
If you don't have that tool installed, you can get it by running
VMware-player-?.?.?-??????.exe /e .\VMTools
Then from your Kali box you can ssh to the IP of the VMWare host machine and the ssh traffic will get passed through to the VM.
Solution 2
Is openssh-server
installed on your Kali Linux VM? You'll need that thing if you want to SSH into it.
You can make sure by opening a terminal / console (on the console inside Kali Linux) and putting in:
sudo apt-get install openssh-server
Then ssh using:
ssh user@ipaddress:port
Does this work for you?
Comments
-
AlwaysQuestioning over 3 years
I am running Kali Linux on Virtual Box on my personal computer. There is another computer on the same network that has a virtual machine on it. I want to SSH directly from Kali Linux (on my computer) into that other computer's virtual machine directly.
I don't want to go through two steps (SSH into the other computer, then SSH into its virtual machine). The other computer uses VMWare Player as its virtualization software. Its guest is metasploitable.
Any ideas?
EDIT: The VM on the other machine needs to stay in NAT mode for my purposes.
-
AlwaysQuestioning almost 9 yearsIt needs to stay in NAT for our purposes.
-
AlwaysQuestioning almost 9 yearsI have it installed. On the other machine, the virtual machine is connected via NAT to the network. Knowing this, how does it affect the ssh? How can I find the ip/port?
-
TheGentleman almost 9 yearsI edited my response to include a way to do this leaving NAT enabled.
-
AlwaysQuestioning almost 9 yearsI'm struggling to download the tool. What do the question marks signify and how can I find them? The host is Ubuntu, by the way.
-
TheGentleman almost 9 yearsThe question marks are just place holders for the version number of VMware you're using. Use the same installer you originally used for VMware Player.
-
killjoy over 7 yearsI ran the "VMware-player-?.?.?-??????.exe /e .\VMTools" command, re-installed tools, and saw no change. Still no vmnetcfg found. VMPlayer 12 free version. If this is not available for the free version, is there any other way to have it work with NAT within my LAN ?
-
alper over 4 yearsThis answer seems old
-
alper almost 4 yearsI can connet to the vm when i am in the local network but cannot if I am not in local network