Install Kali Linux within a VM

Use these steps to install a Kali Linux distribution within a VMware virtual environment.

Background. Kali Linux is a free Debian-based Linux distribution you can use for penetration testing and many other security tasks. If you’re taking a cybersecurity exam, you can use it to experiment with some penetration tools.

Requirements. This lab assumes you have installed VMware Workstation Player on your system and created a virtual machine (VM) with the Kali Linux ISO image attached to the VM.

Install Kali Linux Image

1) Start VMware Workstation Player

2) Locate VM you created with the Kali Linux ISO image attached. Select it and click Play virtual machine.

3) If any prompts appear read and acknowledge them.

Note: If you already have Hyper-V installed on the host system you will receive the following message:

“VMware Player and Hyper-V are not compatible. Remove the Hyper-V role (Hypervisor) from the system before running VMware Player.”

The workaround is to disable Hyper-V so that you can use VMware. To do this open an Administrator Command Prompt, enter the following command and then reboot your system.

bcdedit /set hypervisorlaunchtype off

If you later want to enable Hyper-V, you can do so with the following command (which also requires a reboot).

bcdedit /set hypervisorlaunchtype auto

4) Click within the VM and select Graphical Install. Press Enter to start the installation.

5) When prompted to select a language, select your chosen language and click Continue.

6) When prompted to select a location, select your location and click Continue.

7) When prompted to configure the keyboard, select the keymap that maps your language and location. Click Continue.

8) The installation will go through multiple automated steps to detect hardware, load installer components, and configure the network. When prompted to to enter a hostname for your computer, enter the name of your computer (such as kali) and click Continue.

9) When prompted to enter a domain name, enter home and click Continue.

Note: A typical domain name on the Internet is something like .com, .net, or .org. Your VM won’t be hosted on the Internet and by using non-Internet domain name such as home, will help prevent confusion when you’re working with your VM.

11) On the Set up users and passwords page, enter a password that you will use for the root account. Enter the same password again to verify that you don’t have any typos. You will need to remember this password so take whatever steps are necessary to ensure you can remember it. When you’re done, click Continue.

Note that the root account in a Linux operating system has access all commands and files on the Linux operating system. This is equivalent to an administrator account on a Windows computer.

12) On the Configure the clock page, select the appropriate time zone that is the closest to your location. Click Continue.

13) On the Partition disks page, select Guided – use entire disk and click Continue.

Note that the Logical Volume Manager is available in an encrypted and non-encrypted format. To keep this installation simple, I’m suggesting to use the first option. However, it will be well worth your time to create another installation using encrypted LVM so that you can see how it works.

14) On the second Partition disks page, click Continue.

15) On the third Partition disks page, select All files in one partition. click Continue.

16) On the final Partition disks page, ensure Finish partitioning and write changes to disk is selected. Click Continue.

17) When prompted to write the changes to disks, select Yes and click Continue.

At this point, the installation program has enough information to perform most of the installation.

18) On the Configure the package manager page, you can select to use a network mirror or not. A mirror is recommended.

Note: If you don’t select Yes to use a mirror, you will have problems doing updates.

 

19) On the second Configure the package manager page, related to using an HTTP proxy, click Continue.

20) When prompted to install the GRUB boot loader on a hard disk, select Yes and click Continue.

21) When prompted on where to install the GRUB loader, select /dev/sda and click Continue.

22) On the Finish the installation page, click Continue. The installation will complete and the VM will reboot.

Log onto the Kali Linux VM

1) Click within the Kali Linux VM you just created.

2) If the Username text box doesn’t appear, start typing root..

3) When the Username text box appears, enter root and click Next.

4) Enter the password you used when you created the VM and click Sign In.

Install Open-VM-Tools

Once the installation has completed, you can use the following steps to install the open-vm-tools package on your system.

Requirements: These steps require that you selected Yes to the Use a network mirror question when installing Kali Linux.

1) Ensure you are logged into the Kali Linux VM.

2) Start a Linux terminal session by clicking on the terminal icon in the side menu.

3) Enter the following command in the terminal window:

apt-get update

This command will connect to a mirror site and download update packages to your system.

Having Trouble Running apt-get?

I found that running the apt-get commands didn’t consistently work as advertised. The first time was my fault, but the second time was apparently just a fickle installation.

The first time I ran the apt commands, they failed and it was because I didn’t select Yes when asked to Use a network mirror. Manual fixes didn’t resolve the problems.

I rebuilt the image by completely reinstalling Kali in a new VM. It looked like it was working but then ended up giving errors on the second command installing the open-vm-tools-desktop.

Last, after upgrading to VMware Workstation Pro and creating a new image by reinstalling Kali in a new VM, these commands worked without a hitch.

4) After the previous command finishes, enter the following command in the terminal window:

apt-get install open-vm-tools-desktop fuse

When prompted to continue, enter Y.

5) After the previous command finishes, enter the following command in the terminal window:

reboot

This will reboot the Kali Linux VM with the VMware tools installed.