# Installing Kali Linux

We will now install Kali Linux in our hypervisor (or call it a virtual machine (VM) manager). But before doing so, let's learn about the types of hypervisors.

## **Types of Hypervisors**

A hypervisor is software that allows us to create and manage virtual machines (VMs). It acts as a bridge between the physical hardware and the virtual environment, allowing multiple operating systems to run on a single system. Hypervisors are categorized into two main types:

### Type 1 Hypervisor (Bare-Metal Hypervisor)

A Type 1 hypervisor runs directly on the physical hardware, without requiring an underlying operating system. Because of this, it provides better performance, efficiency, and security. Type 1 hypervisors are commonly used in enterprise environments, data centers, and cloud computing.

**Examples of Type 1 Hypervisors:**

* VMware ESXi – A widely used hypervisor for enterprise virtualization.
* Microsoft Hyper-V – A built-in virtualization solution for Windows Server.
* Xen – An open-source hypervisor used in cloud platforms like AWS.

### Type 2 Hypervisor (Hosted Hypervisor)

A Type 2 hypervisor runs on top of an existing operating system (Windows, macOS, or Linux). Since it relies on the host OS to access hardware resources, it is generally easier to install and use but may have slightly lower performance compared to Type 1 hypervisors. Type 2 hypervisors are commonly used for personal, testing, and development purposes.

**Examples of Type 2 Hypervisors:**

* VirtualBox – A free, open-source hypervisor developed by Oracle.
* VMware Workstation/Player – A powerful virtualization tool used by professionals.
* Parallels Desktop – A macOS-specific hypervisor for running Windows and Linux.

Since we will be using VirtualBox or VMware Workstation, we are working with a Type 2 hypervisor. Now that we understand the different types of hypervisors, let’s move on to preparing our system and setting up a virtual machine for Kali Linux.

***

## **Installing VirtualBox**

Since VirtualBox is free and open-source, we will use it for this book. It is widely supported and easy to set up, making it a great choice for beginners and professionals alike. However, if you want to explore other options, you can also install VMware.

At the time of writing this, VMware Workstation Pro is officially free for personal use. This makes it another excellent choice for running virtual machines. While the installation steps for VMware are slightly different, the overall process remains similar.

For this guide, we will proceed with VirtualBox, but feel free to try out VMware if you're interested. Now, let's move on to installing and setting up our virtualization environment.

To install VirtualBox, the process is simple. Visit[ https://www.virtualbox.org/wiki/Downloads](https://www.virtualbox.org/wiki/Downloads) and download the appropriate installer for your operating system:

* **Windows Users**: Download the .exe binary and run the installer.
* **Mac Users**: Download the macOS package (.dmg) and follow the installation steps.
* **Linux Users**: VirtualBox is available in most distribution repositories. You can install it using your package manager, such as:
  * *Debian/Ubuntu*: `sudo apt install virtualbox`
  * *Fedora*: `sudo dnf install VirtualBox`
  * *Arch Linux*: `sudo pacman -S virtualbox`

Once downloaded and installed, VirtualBox will be ready to create and manage virtual machines.

**Installing Kali Linux**

We can install Kali Linux from their official website:[ https://www.kali.org/get-kali/](https://www.kali.org/get-kali/).

When you visit the website, you will find two options available for downloading Kali Linux:

1. **Installer Image** – This is an ISO file, which is typically burned to a USB drive and used to boot a system for installation. The same process applies to hypervisors, where we can boot using the ISO file and manually set up Kali Linux from scratch.
2. **Virtual Machine Image** – These are pre-configured .OVA (for VirtualBox) and .OVF (for VMware) files, designed specifically for virtualization.

For this guide, we will use the `.OVA` or `.OVF` file and import it directly into our hypervisor instead of installing from scratch.&#x20;

<figure><img src="/files/SML80rp9pB8rEgJDLhVH" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/haEBFfEgpbStnrJzW1cV" alt=""><figcaption></figcaption></figure>

**Why? Because:**

* It saves time – no need to go through the lengthy installation process.
* It is pre-configured – comes with essential settings and optimizations.
* It allows us to start working immediately instead of spending hours setting up the system.

The file you download will be a `.7z (7-Zip)` compressed file. To use it, we need to extract the contents first. Here's how you do it:

1. Download and install 7-Zip from their official website (I don’t think we need to provide a full guide for this – just search for “7-Zip” on Google if you don’t have it).
2. Once installed, right-click the `.7z` file and select Extract Here or Extract to \[folder name].

After extraction, you will find the `.OVA` file (for VirtualBox) or the .OVF file (for VMware), which is the virtual machine image. Now, we can import it into VirtualBox:

* **Option 1**: Simply right-click the `.OVA` file and select Open with VirtualBox. This will automatically import the virtual machine.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcIkogRvUqhBhy4pH5p9bSxhRKCrQ13C9XZzlYueAiJZFeuqy61Uzh2lFw0vHY5Mc4vkYEsM-d2KUlkoR1Vr01O4mn3ky7dfhRqgYmsScKsVVaFlrcHT8egCbmDg2iVZn5q5XVc?key=YTE-ZYlBfPBh4KHHzJ5mQlUN" alt=""><figcaption></figcaption></figure>

* **Option 2:** In VirtualBox, click File > Import Appliance, browse to the extracted .OVA file, and follow the prompts to import the virtual machine.

Since our virtual machine is imported into the hypervisor, we can start it and wait for it to boot up. There we go—our Kali Linux is ready! You'll see the login prompt, and the default credentials for the pre-configured virtual machines are `kali:kali`.

***

## Apply Optimizations

If you're using VMware, it should not lag, as optimizations for virtual machines are already applied by default, and fullscreen should be supported natively without any additional installation.

However, for VirtualBox, you need to install VirtualBox Guest Additions in Kali Linux to optimize the OS and enable fullscreen support. Here’s how you can do it:

1. Start Kali Linux in your VirtualBox VM.
2. Once Kali is up and running, click on the "Devices" menu in the VirtualBox toolbar at the top of the screen.
3. From the dropdown, select "Insert Guest Additions CD image...". This will mount the Guest Additions ISO to your Kali Linux VM.
4. Open a Terminal in Kali Linux and run the following commands to install the necessary packages:

```bash
sudo apt update && sudo apt upgrade -y
sudo reboot
## After System is rebooted run following:
sudo apt install -y build-essential dkms linux-headers-generic
```

5\. Now, cd to the Guest Additions CD image manually. Run the following command to navigate to the mounted CD:

```bash
cd /media/kali/VBox_GAs_7.1.6/  ## 7.1.6 can be different version too
```

6\. Next, run the installation script:

```bash
sudo bash VBoxLinuxAdditions.run # use 'kali' as password when it prompts
```

Once the installation is complete, reboot your system:

```bash
sudo reboot
```

After rebooting, you should be able to use fullscreen mode and experience better performance in your Kali Linux VM.

{% hint style="info" %}
**Note**: When you use sudo before a command, it prompts you to enter a password. The password you enter is "`kali`", *which is the default password for your current user account*. This user is included in the **sudoers file**, granting it permission to execute commands with superuser privileges (i.e., using sudo).
{% endhint %}

Also, when typing your password, it won’t appear on-screen for security reasons. This is a standard design in Linux to prevent shoulder surfing and protect your password from being exposed. Therefore, from now on, you need to develop the habit of typing your password without looking at the terminal to see how many characters you have typed so far. Although you can change this behavior, it’s beyond the scope of this book and would be considered part of your personal research.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://handbook.ncateam.xyz/fundamentals/linux/installing-kali-linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
