0

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.

PeeHaa
  • 71,436
  • 58
  • 190
  • 262
AlwaysQuestioning
  • 1,464
  • 4
  • 24
  • 48
  • [this](https://stackoverflow.com/questions/14074408/using-vmware-player-5-how-can-i-access-a-web-server-running-in-a-vm-via-an-exte) and [this](https://stackoverflow.com/questions/52386841/how-to-do-port-forwarding-on-vmware-player-14-1-2-ubuntu-18-04-guest-windows-1) questions are asking the same and have an answer. The accepted answer here does not work on recent versions of the Player. – David Balažic Mar 05 '19 at 10:07
  • Answers for the questions are seems old @DavidBalažic – alper Feb 18 '20 at 17:19

2 Answers2

3

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?

Mingle Li
  • 1,322
  • 1
  • 15
  • 39
  • I 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? – AlwaysQuestioning Aug 27 '15 at 20:14
  • I can connet to the vm when i am in the local network but cannot if I am not in local network – alper Aug 03 '20 at 11:29
2

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.

TheGentleman
  • 2,324
  • 13
  • 17