This tutorial demonstrates how to install and configure Offensive Security’s Kali Linux image in VMware Workstation.

 

Software

 

Install VMware Workstation Pro

Download and install VMware Workstation Pro from VMware. Workstation Pro is not a free program. The 30-day trial version is available here [download] or you may use free alternatives such as VMware Player or Virtualbox.

*This tutorial uses Workstation Pro 12, but Workstation Pro 14 is the newest version as of today.

 

Download the Kali Linux Image

Offensive Security releases custom versions of Kali Linux for virtualization. This simplifies the process of creating a new virtual machine from the Kali Linux ISO. The 64-bit VM is the best choice for our purposes.

*It is highly recommended to use the images from Offensive Security if you have not previously used Kali Linux. If you are already familiar with the OS, you may download the most recent version here.

 

Open the Image

Extract the contents of the image (7-zip).

Extract Kali Image

In VMware Workstation Pro, from File > Open, open your newly extracted folder and select the .vmx file contained within.

Open .vmx in Workstation

Edit the virtual machine settings as needed. The defaults for the Offensive Security images work fine, but you may wish increase or decrease settings such as the memory, processors, hard disk, and network adapter. I will leave these as the default for now.

Edit virtual machine settings

Power on the virtual machine. When presented with the screen below, select “I Copied It”.

I Copied It

You may see the notification bar on the bottom of Workstation show a note about VMware Tools. If this appears, select ‘Remind Me Later’. This will be fixed in the configuration changes below.

VMware Tools - Remind Me Later

The machine will boot to the login page. On the Offensive Security image, enter ‘root‘ for the username with the default password of ‘toor‘.

Username is root, password is toor

 

Configure Kali Linux

Open terminal (red arrow) from the left sidebar menu. You may also use the keyboard shortcut Ctrl+Alt+T.

Default desktop with terminal

Change the default password for root.

  • #passwd root
  • Repeat the new password twice. You will NOT see the password as you type.

It is a poor security practice to always use the root user. To create a new user, enter the following commands in the terminal:

  • #useradd -m username
  • #passwd username
  • Repeat the new password twice. You will NOT see the password as you type.
  • #usermod -a -G sudo username
  • #chsh -s /bin/bash username

New user

To become the new user, log out of root and log back in with the new user created.

Sign out of root

Once logged in as the new user, open a terminal window. To prevent many issues when updating Kali, edit /etc/apt/sources.list to pull from repo rather than http.

*Note: To use elevated privileges, you must type sudo before the command. If you want to switch to root during the rest of the configuration process outlined here rather than typing sudo before elevated commands, change to root using $su and entering the password for user.

  • $sudo gedit /etc/apt/source.list
  • Enter password for user
  • Edit this line:
    • deb http://http.kali.org/kali kali-rolling main non-free contrib
  • To read:
    • deb http://repo.kali.org/kali kali-rolling main non-free contrib

Replace http with repo in sources.list

The following commands will take longer to process the first time you run them.

  • Update and upgrade the system: $sudo apt-get update && sudo apt-get upgrade -y
    • For configuring postgresql-common, press ‘TAB, TAB, Enter‘ to proceed.

PostgreSQL

  • Update the distribution: $sudo apt-get dist-upgrade -y
    • Enter the user password when prompted.
    • Hit ‘Enter‘ to select the default No for configuring wireshark-common.
    • Type ‘n‘ and press enter for the server_config.yml prompt to leave as default.

Wireshark

server_config.yml

Change the default ssh keys.

  • $cd /etc/ssh/
  • $sudo mkdir default_kali_keys
  • $sudo mv ssh_host_* default_kali_keys/
  • $sudo dpkg-reconfigure openssh-server

Verify the new key hashes.

  • $sudo md5sum ssh_host_*
  • $cd default_kali_keys/
  • $sudo md5sum*

At this point, it is HIGHLY recommended to take a snapshot of the virtual machine. This acts as a saving point if anything goes wrong that you can revert the virtual machine back to rather than starting over.

  • Power off the Kali virtual machine.
  • From the VMware Workstation menu bar
    • VM > Snapshot > Take Snapshot…
  • Change the name and provide a description if desired.
  • Select ‘Take Snapshot’

Additional Configuration Steps

Install NVIDIA Drivers – if needed.

Disable screen lock (default is set to 5 minutes).

  • Select the power button in the top right of the Kali desktop.
  • Select the wrench icon in the bottom left of the popup menu.
  • Select power.
  • Change the ‘Blank screen’ setting from 5 minutes to Never.

Screen lock