Post

Building a Virtual Security Home Lab: Part 3 - Kali Linux Setup

A step-by-step guide for building your very own Cybersecurity Home Lab using VirtualBox

Banner Background by logturnal on Freepik
Hacker Image by catalyststuff on Freepik

Changelog

  • Nov. 10, 2024
    • Added note about settings that could fix the “black screen on boot” problem that occurs on certain machines.
    • Updated Kali Linux VM setup steps to include configuration that is recommended by Offensive Security.

In this module, we are going to install Kali Linux. We will use this VM in the next module also to complete the pfSense setup.

Download Kali Linux

Go to the following link: Get Kali | Kali Linux

Download the 64-bit Recommended Installer. The image is ~4GB in size so it will take some time to download.

As of writing the latest version of Kali Linux is 2023.4.

kali-download-1

Once it is downloaded we should have an .iso file.

kali-download-2

Kali Linux VM Creation

Launch VirtualBox. Select Tools from the sidebar and then click on New from the toolbar.

vbox-19

Give the VM a Name. Set the Folder option to the location where the Home Lab VMs are going to be saved. Leave the ISO Image option empty. Select Type as Linux and Version as Debian (64-bit) then click on Next.

vbox-20

Leave everything on its default values. Click on Next.

vbox-21

Increase the Disk Size to 80GB and click on Next.

vbox-22

Ensure that all the settings look right and click on Finish.

vbox-23

vbox-27

Adding VM to Group

Right-click on the Kali Linux VM from the sidebar, select Move to Group -> [New].

vbox-24

The VM will now be added to a Group called New Group. Right-click on the group name and select Rename Group. Name the group Management.

vbox-8

Select the Firewall and Management group (Ctrl+Click). Right-click on the name of one of the groups. From the menu select Move to Group -> [New].

vbox-25

Now both the groups should be nested inside a group called New Group. Right-click on the group and choose Rename Group. Give the group the name Home Lab.

vbox-28

In the end, we should have the following structure:

vbox-26

Kali Linux VM Configuration

Select the Kali Linux VM and then from the toolbar select Settings.

vbox-29

System Configuration

Go to System -> Motherboard. For the Boot Order option ensure that the Hard Disk is on the top followed by Optical. Uncheck Floppy.

vbox-30

Go to System -> Processor. From Extended Features list select Enable PAE/NX.

vbox-74

Go to Display -> Screen and increase the Video Memory to 128 MB.

vbox-75

Boot Image Configuration

Go to the Storage tab. Select the Empty disk present below Controller: IDE then click on the small disk icon on the right side of the Optical Drive option.

vbox-31

Select Choose a disk file and then select the downloaded .iso file for Kali Linux.

vbox-32

The final result should look as follows:

vbox-33

Network Configuration

Go to Network -> Adapter 1. For the Attached to field select Internal Network. For Name select LAN 0. Expand the Advanced section. For Adapter Type select Paravirtualized Network (virtio-net).

vbox-34

Kali Linux Installation

Remember to boot the pfSense VM if it was shut down before starting the Kali Linux installation.

Select Kali Linux from the sidebar and click on Start on the toolbar.

vbox-35

From the Installer menu select Graphical Install.

kali-1

Select your Language, location and keyboard layout.

kali-2

kali-3

kali-4

Enter a name for the VM. You can use any name here. The hostname is used to identify the system on the network. The hostname can also be changed after installation.

kali-5

Leave the domain name input blank and click on Continue.

kali-6

Enter your name. This name will be shown on the login screen.

kali-7

The username is used to create the home directory for the user. All the user-related configurations are stored in this folder.

kali-8

Enter a strong password. Re-enter the password in the second field and click on Continue.

kali-9

Select your clock and then click on Continue.

kali-10

Select the drive (sda) and click on Continue.

kali-11

Select Guided - use entire disk and then click on Continue.

kali-27

Select the option: All files in one partition and click on Continue.

kali-12

Select Finish partitioning and write changes to disk. Then click on Continue.

kali-13

Select Yes and click on Continue.

kali-14

kali-15

After the base system installation is complete we need to choose the desktop environment that will be installed. I have selected GNOME for installation.

The default is XFCE it does not look as pretty as GNOME it is much lighter and should have better performance. KDE Plasma is the fanciest with a lot of bells and whistles. I would only recommend KDE if you can assign 2 cores and 4GB RAM for this VM. Once the desktop environment is selected click on Continue.

kali-16

The installation will take some time. Select Yes and click on Continue.

kali-17

kali-18

Click on Continue to Reboot the system.

kali-19

After reboot, we should see the Login screen. Click Enter to log in. Enter the password that was configured during the installation.

kali-21

Post-Installation Configuration

Kali Linux installer can detect when it is run from a VM because of this it automatically installs Guest Addons.

Press Right Ctrl+F to enter Fullscreen mode. The VM should scale to fill the entire screen. Press Right Ctrl+F again to exit Fullscreen mode. From the dock at the bottom of the screen. Select the Terminal.

kali-26

Run the command: ip a. We can see that the Kali VM has been assigned an IP address from the LAN network range. The VM should be able to access the internet as well.

kali-22

Use the following command to update the system:

1
sudo apt update && sudo apt full-upgrade

Enter password when prompted.

kali-23

Once the sources have been fetched we will be asked if we want to continue. Enter Y and then press Enter to start the update.

kali-24

After the update is complete run the following command to remove the unused packages:

1
sudo apt autoremove

kali-25

The .iso file that was downloaded to create the VM can be deleted now if you do not plan to store it for future use.

Black Screen on Boot
On certain machines starting the Kali VM results in a black screen. This issue occurs usually after updating the VM. There isn’t a definitive solution to this problem. The issue may popup from time to time.

Some users have reported that changing the “Graphics Controller” to VBoxSVGA seems to resolve the problem for them. This option is located under Settings → Display → Screen.

Forcefully powering off the VM and starting it back up also seems to fix the issue. The VM might need to be restarted 2-3 times before the VM loads properly.

In the next module, we will access the pfSense Web UI and complete the remaining configuration.

Part 4 - pfSense Firewall Configuration

This post is licensed under CC BY 4.0 by the author.