SSH Connect to a Kali Virtual Machine in Virtualbox

ssh green font on black background

Kali is a great learning tool for learning cybersecurity, especially the red-attacking side of it.

For the longest time, I had trouble running the Kali VM on my rather old Thinkpad X1 Carbon, as the image consumes quite a few resources.

There is a way to use most of Kali’s tools with little resource consumption: ssh into the image via your distro terminal.

It turns out it’s quite easy to set this up in VirtualBox, as described in this article:

https://averagelinuxuser.com/ssh-into-virtualbox/#install-ssh-in-virtualbox-os

Steps:

1. Download the latest Kali VirtualBox VM from https://www.kali.org/get-kali/#kali-virtual-machines

2. Go to the machine settings, network, port forwarding

virtulabox setting network page

3. Set name, protocol, host port and guest port

virtualbox port forwarding rules settings page

4. Open the terminal in the VM and enable SSH access

systemctl enable ssh --now

5. Open your system terminal and connect via SSH by the chosen port

terminal showing an ssh connection to a kali virtual machine

The VM can be left open on the login screen.

This will consume a lot less resources to run the image and keep the option to run the GUI options in the Kali VM if needed.

Happy hacking!

References: