background, security, linux-1900329.jpg

Table of Contents

What is Kali Linux?

About Kali Linux

Kali Linux (formerly known as BackTrack Linux) is an open-

source, Debian-based Linux distribution aimed at advanced Penetration Testing and Security Auditing. It does this by providing common tools, configurations, and automations which allows the user to focus on the task that needs to be completed, not the surrounding activity.

Kali Linux contains industry specific modifications as well as several hundred tools targeted towards various Information Security tasks, such as Penetration Testing, Security Research, Computer Forensics, Reverse Engineering, Vulnerability Management and Red Team Testing.

Kali Linux is a multi-platform solution, accessible and freely available to information security professionals and hobbyists.

Kali Linux Features

  • More than 600 penetration testing tools included: After reviewing every tool that was included in BackTrack, we eliminated a great number of tools that either simply did not work or which duplicated other tools that provided the same or similar functionality. Details on what’s included are on the Kali Tools site.
  • Free (as in beer) and always will be: Kali Linux, like BackTrack, is completely free of charge and always will be. You will never, ever have to pay for Kali Linux.
  • Open source Git tree: We are committed to the open source development model and our development tree is available for all to see. All of the source code which goes into Kali Linux is available for anyone who wants to tweak or rebuild packages to suit their specific needs.
  • FHS compliant: Kali adheres to the Filesystem Hierarchy Standard, allowing Linux users to easily locate binaries, support files, libraries, etc.
  • Wide-ranging wireless device support: A regular sticking point with Linux distributions has been support for wireless interfaces. We have built Kali Linux to support as many wireless devices as we possibly can, allowing it to run properly on a wide variety of hardware and making it compatible with numerous USB and other wireless devices.
  • Custom kernel, patched for injection: As penetration testers, the development team often needs to do wireless assessments, so our kernel has the latest injection patches included.
  • Developed in a secure environment: The Kali Linux team is made up of a small group of individuals who are the only ones trusted to commit packages and interact with the repositories, all of which is done using multiple secure protocols.
  • GPG signed packages and repositories: Every package in Kali Linux is signed by each individual developer who built and committed it, and the repositories subsequently sign the packages as well.
  • Multi-language support: Although penetration tools tend to be written in English, we have ensured that Kali includes true multilingual support, allowing more users to operate in their native language and locate the tools they need for the job.
  • Completely customizable: We thoroughly understand that not everyone will agree with our design decisions, so we have made it as easy as possible for our more adventurous users to customize Kali Linux to their liking, all the way down to the kernel.
  • ARMEL and ARMHF support: Since ARM-based single-board systems like the Raspberry Pi and BeagleBone Black, among others, are becoming more and more prevalent and inexpensive, we knew that Kali’s ARM support would need to be as robust as we could manage, with fully working installations for both ARMEL and ARMHF systems. Kali Linux is available on a wide range of ARM devices and has ARM repositories integrated with the mainline distribution so tools for ARM are updated in conjunction with the rest of the distribution.
  • For more features of Kali Linux, please see the following page: Kali Linux Overview.

Kali Linux is specifically tailored to the needs of penetration testing professionals, and therefore all documentation on this site assumes prior knowledge of, and familiarity with, the Linux operating system in general. Please see Should I Use Kali Linux? for more details on what makes Kali unique.

Should I Use Kali Linux?

What’s Different About Kali Linux?

Kali Linux is specifically geared to meet the requirements of professional penetration testing and security auditing. To achieve this, several core changes have been implemented in Kali Linux which reflect these needs:

  1. Network services disabled by default: Kali Linux contains systemd hooks that disable network services by default. These hooks allow us to install various services on Kali Linux, while ensuring that our distribution remains secure by default, no matter what packages are installed. Additional services such as Bluetooth are also blocklisted by default.
  2. Custom Linux kernel: Kali Linux uses an upstream kernel, patched for wireless injection.
  3. A minimal and trusted set of repositories: given the aims and goals of Kali Linux, maintaining the integrity of the system as a whole is absolutely key. With that goal in mind, the set of upstream software sources which Kali uses is kept to an absolute minimum. Many new Kali users are tempted to add additional repositories to their sources.list, but doing so runs a very serious risk of breaking your Kali Linux installation.

Is Kali Linux Right For You?

As the distribution’s developers, you might expect us to recommend that everyone should be using Kali Linux. The fact of the matter is, however, that Kali is a Linux distribution specifically geared towards professional penetration testers and security specialists, and given its unique nature, it is NOT a recommended distribution if you’re unfamiliar with Linux or are looking for a general-purpose Linux desktop distribution for development, web design, gaming, etc.

Even for experienced Linux users, Kali can pose some challenges. Although Kali is an open source project, it’s not a wide-open source project, for reasons of security. The development team is small and trusted, packages in the repositories are signed both by the individual committer and the team, and – importantly – the set of upstream repositories from which updates and new packages are drawn is very small. Adding repositories to your software sources which have not been tested by the Kali Linux development team is a good way to cause problems on your system.

While Kali Linux is architected to be highly customizable, do not expect to be able to add random unrelated packages and repositories that are “out of band” of the regular Kali software sources and have it Just Work. In particular, there is absolutely no support whatsoever for the apt-add-repository command, LaunchPad, or PPAs. Trying to install Steam on your Kali Linux desktop is an experiment that will not end well. Even getting a package as mainstream as NodeJS onto a Kali Linux installation can take a little extra effort and tinkering.

If you are unfamiliar with Linux generally, if you do not have at least a basic level of competence in administering a system, if you are looking for a Linux distribution to use as a learning tool to get to know your way around Linux, or if you want a distro that you can use as a general purpose desktop installation, Kali Linux is probably not what you are looking for.

In addition, misuse of security and penetration testing tools within a network, particularly without specific authorization, may cause irreparable damage and result in significant consequences, personal and/or legal. “Not understanding what you were doing” is not going to work as an excuse.

However, if you’re a professional penetration tester or are studying penetration testing with a goal of becoming a certified professional, there’s no better toolkit – at any price – than Kali Linux.

If you are looking for a Linux distribution to learn the basics of Linux and need a good starting point, Kali Linux is not the ideal distribution for you. You may want to begin with Ubuntu, Mint, or Debian instead. If you’re interested in getting hands-on with the internals of Linux, take a look at the Linux From Scratch project.

Summary

So, after having read this you should have figured out if Kali Linux is the distribution you were looking for or at least got an idea about your choice.

If still you have not figured it out, here is a summary that will hopefully remove your remaining doubts:

  • Kali Linux is made with pentesters and pentesting in mind so, expecting it to fit with your necessity might not be as simple even though it’s completely possible.
  • If you are new to Linux or have less experience with command line you might find Kali Linux to be not so user-friendly, even though our developers try to make it as user-friendly as possible some things might be intimidating to you if you are new.
  • The developers always try to make Kali Linux as much hardware compatible as possible but, still some hardware/s might not work as expected or not work at all. So, its better to research hardware compatibility beforehand rather than breaking your computer later.
  • If you are installing Kali Linux for the first time, it is recommended to install first in Virtual Machine then, after getting familiar with it, you can install it in your own hardware.

Hopefully, now you know if you need to install Kali Linux or not. If you have decided to install Kali Linux then, we welcome you to our community.

If not, then see you later, and remember always “Try Harder”.

Which Image Should I Download?

In this section, we will describe the process of installing Kali Linux on 32-bit and 64-bit hardware using the images published on the Kali Linux download page.

Content

Which Image to Choose

The Kali Linux download page offers different image types (Installer, NetInstaller and Live) for download, each available for both 32-bit and 64-bit architectures. Additionally, there is an Everything flavor of the Installer and Live images, for 64-bit architectures only.

If in doubt, use the “Installer” image. You will need to check your system architecture to know whether to get 32-bit or 64-bit. If you don’t know it, you’re best to research how to find out (As a rule of thumb, if your machine’s newer than 2005 you should be okay with amd64/x64/64-bit)

Installer

This is the recommended image to install Kali Linux. It contains a local copy of the (meta)packages listed (top10, default & large) so it can be used for complete offline installations without the need of a network connection.

This image cannot be used to boot a live system (such as directly running Kali from a USB). It is only an installer image.

NetInstaller

This image can be used if you want the latest package every time you install Kali Linux or the standard installer image is too big to download. This image is very small because it does not contain a local copy of (meta)packages to install. They will all be downloaded during installation, so as a result this requires a network connection which will slow down the installation time.

Only use this image if you have reasons not to use the standard installer image above.

This image cannot be used to boot a live system (such as directly running Kali from a USB). It is only an installer image.

Live

This image is for running Kali Linux without installing it first so it is perfect for running off a USB drive (or a CD/DVD).

You are able to install Kali Linux in its default configuration from this image but you will not be able to choose between desktop environments or to specify additional (meta)packages to install.

Everything

This image is meant for offline scenarios, when you want to use Kali Linux in a place that has no network connectivity. The image is huge (more than 9GB), as it contains nearly all of Kali’s tools already. It’s only available for the 64-bit architecture, and it can be downloaded via BitTorrent only.

Kali “everything” is not exactly an image, it’s a flavor. You can download either the Installer Everything image or the Live Everything image. In both case, all the tools are already there, no need for an Internet connection.

Which Desktop Environment and (Meta)Packages to Choose During Installation:

Each Kali Linux installer image (not live) allows the user to select the preferred “Desktop Environment (DE)” and software collection (metapackages) to be installed with operating system (Kali Linux).

We recommend sticking with the default selections and add further packages after the installation as required. Xfce is the default desktop environment, and kali-linux-top10 and kali-linux-default are the tools which get installed at the same time.

At this screen, you may wish to not install a desktop environment, then Kali Linux becomes “headless” (no graphic interface) which uses less system resources up and commonly found on servers, dropboxes, low powered ARM devices, and the cloud. This is meant for people who are completely comfortable with the command line. You are able to install multiple Desktop Environments, allowing you to switch, we wouldn’t recommend it. You may change your mind and switch desktop environments at a later date.

May wish to not to install any of the pre-defined software packages/bundles/collections (metapackages), giving you a finer degree of control of manually installing exactly what software you want. Alternatively you may want to be more prepared and install more than the default toolset. Please be aware, that there are more tools available in Kali which has be manually installed after the setup (as they all cannot be stored in the setup image).

Overall, these extra choices are for a more efficient installation experience, meant for advanced users. Please be aware of their pitfalls.

The following sections in the “Kali Documentation Installation” of this documentation, will be using the “Installer” image for the guides unless stated otherwise.

Downloading Kali Linux

IMPORTANT! Never download Kali Linux images from anywhere other than the official sources. Always be sure to verify the SHA256 checksums of the file you’ve downloaded against our official values. It would be easy for a malicious entity to modify a Kali installation to contain exploits or malware and host it unofficially.

Where to Get Official Kali Linux Images

ISO Files for Intel-based PCs

In order to run Kali “Live” from a USB drive on standard Windows and Apple PCs, you’ll need a Kali Linux bootable ISO image, in either 32-bit or 64-bit format.

If you’re not sure of the architecture of the system you want to run Kali on, on Linux or macOS, you can run the command:

uname -m

 

If you get the response, “x86_64”, use the 64-bit ISO image (the one containing “amd64” in the file name); if you get “i386”, use the 32-bit image (the one containing “i386” in the file name).

If you’re on a Windows system, the procedure for determining whether your architecture is detailed on Microsoft’s website.

The Kali Linux images are available both as directly downloadable “.iso/.img” files or via “.torrent” files.

Building your own Kali Linux ISO, standard or customized, is a very simple process.

Virtual Machines Images

If you want to run Kali Linux as a “guest” under VMware or VirtualBox, Kali Linux is available as a pre-built virtual machines with any guest tools already installed. These image are available in a 64-bit (amd64), and 32-bit PAE (i*86) formats.

ARM Images

The hardware architectures of ARM-based devices vary considerably, so it is not possible to have a single image that will work across all of them. Pre-built Kali Linux images for the ARM architecture are available for a wide range of devices.

Scripts for building your own ARM images locally are also available on GitLab. For more details, see the articles on setting up an ARM cross-compilation environment and building a custom Kali Linux ARM chroot.

Verifying Your Downloaded Kali Image

Why do I need to do this?

Before you run Kali Linux Live, or install it to your hard disk, you want to be very sure that what you’ve got actually is Kali Linux, and not an imposter. Kali Linux is a professional penetration testing and forensics toolkit. As a professional penetration tester, having absolute confidence in the integrity of your tools is critical: if your tools are not trustworthy, your investigations will not be trustworthy, either.

Moreover, as the leading penetration testing distribution, Kali’s strengths mean that a bogus version of Kali Linux could do a tremendous amount of damage if it were deployed unwittingly. There are plenty of people with plenty of reason to want to stick very sketchy stuff into something that looks like Kali, and you absolutely do not want to find yourself running something like that.

Avoiding this is simple:

  • Only download Kali Linux via the official download page at kali.org/get-kali/ – you will not be able to browse to these pages without SSL; encrypting the connection makes it much harder for an attacker to use a “man-in-the-middle” attack to modify your download. There are a few potential weaknesses to even these sources – see the sections on verifying the download with the SHA256SUMS file and its signature against the official Kali Development team private key for something much closer to absolute assurance.
  • Once you’ve downloaded an image, and before you run it, always validate that it really is what it’s supposed to be by verifying its checksum using one of the procedures detailed below.

There are several methods for verifying your download. Each provides a certain level of assurance, and involves a corresponding level of effort on your part. We list 3 of these methods below:

  1. You can download an ISO image from an official Kali Linux “Downloads” mirror, calculate the ISO’s SHA256 hash and compare it by inspection with the value listed on the Kali Linux site. This is quick and easy, but potentially susceptible to subversion via a DNS poisoning: it assumes that the site to which, for example, the domain “kali.org” resolves is in fact the actual Kali Linux site. If it somehow were not, an attacker could present a “loaded” image and a matching SHA256 signature on the fake web page. See the section “Manually Verify the Signature on the ISO (Direct Download)”, below.
  2. You can download an ISO image through the torrents, and it will also pull down a file – unsigned – containing the calculated SHA256 signature. You can then use the shasum command (on Linux and macOS) or a utility (on Windows) to automatically verify that the file’s computed signature matches the signature in the secondary file. This is even easier than the “manual” method, but suffers from the same weakness: if the torrent you pulled down is not really Kali Linux, it could still have a good signature. See the section “Verify the Signature on the ISO Using the Included Signature File (Torrent Download)”, below.
  3. To be as close to absolutely certain as possible that the Kali Linux download you’ve obtained is the real thing, you can download both a cleartext signature file and and version of the same file that has been signed with the official Kali Linux private key and use GNU Privacy Guard (GPG) to first, verify that the computed SHA256 signature and the signature in the cleartext file match and second, verify that the signed version of the file containing the SHA256 hash has been correctly signed with the official key.

If you use this more complicated process and successfully validate your downloaded ISO, you can proceed with pretty complete assurance that what you’ve got is the official image and that it has not been tampered with in any way. This method, while the most complex, has the advantage of providing independent assurance of the integrity of the image. The only way this method can fail is if the official Kali Linux private key is not only subverted by an attacker, but also not subsequently revoked by the Kali Linux development team. For this method, see the section on verification using the SHA256SUMS file.

What do I need to do this?

If you’re running on Linux, you probably already have GPG (GNU Privacy Guard) installed. If you’re on Windows or macOS, you’ll need to install the appropriate version for your platform.

  • If you’re on a PC running Windows, download and install GPG4Win from here.
  • If you’re on a Macintosh running macOS, download and install GPGTools from here. Alternatively, if you have Homebrew installed, just run brew install gnupg

Once you’ve installed GPG, you’ll need to download and import a copy of the Kali Linux official key. Do this with the following command:

$ wget -q -O – https://archive.kali.org/archive-key.asc | gpg –import

 

or the command

$ gpg –keyserver hkps://keys.openpgp.org –recv-key 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6

 

Your output should look like this:

gpg: key ED444FF07D8D0BF6: public key “Kali Linux Repository <[email protected]>” imported

gpg: Total number processed: 1

gpg:               imported: 1  (RSA: 1)

 

Verify that the key is properly installed with the command:

$ gpg –fingerprint 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6

 

The output will look like this:

pub   rsa4096 2012-03-05 [SC] [expires: 2025-01-24]

      44C6 513A 8E4F B3D3 0875  F758 ED44 4FF0 7D8D 0BF6

uid           [ full] Kali Linux Repository <[email protected]>

sub   rsa4096 2012-03-05 [E] [expires: 2025-01-24]

 

You’re now set up to validate your Kali Linux download.

How Do I Verify My Downloaded Image?

Manually Verify the Signature on the ISO (Direct Download)

If you downloaded the ISO directly from the downloads page, verify it using the following procedure.

On Linux, or macOS, you can generate the SHA256 checksum from the ISO image you’ve downloaded with the following command (assuming that the ISO image is named “kali-linux-2024.1-live-amd64.iso”, and is in your current directory):

$ shasum -a 256 kali-linux-2024.1-live-amd64.iso

 

The output should look like this:

48c9f9c24a7dbe68277e591e5f3af588714190cde8263af2f9b35e7ad252750c  kali-linux-2024.1-live-amd64.iso

 

On Windows, you can open the command prompt and run

certutil -?

 

If certutil is available, you can run:

certutil -hashfile kali-linux-2024.1-live-amd64.iso sha256

 

To verify your download. Certain versions of Windows do not have the native ability to calculate SHA256 checksums. If you do not have certutil installed, you can use a utility such as Microsoft File Checksum Integrity Verifier or Hashtab to verify your download.

The resulting SHA256 signature:

48c9f9c24a7dbe68277e591e5f3af588714190cde8263af2f9b35e7ad252750c

 

Can be seen to match the signature displayed in the “sha256sum” section on the official download page for the 64-bit Intel architecture Kali Linux 2024.1 ISO image:

 

Verify the Signature on the ISO Using the Included Signature File (Torrent Download)

If you downloaded your copy of the Kali Linux ISO image via the torrents, in addition to the ISO file (e.g. kali-linux-2024.1-live-amd64.iso), there will be a second file containing the computed SHA256 signature for the ISO, with the extension “.txt.sha256sum” (e.g. kali-linux-2024.1-live-amd64.txt.sha256sum).

You can use this file to verify the authenticity of your download on Linux or macOS with the following command:

$ grep kali-linux-2024.1-live-amd64.iso kali-linux-2024.1-live-amd64.txt.sha256sum | shasum -a 256 -c

 

If the image is successfully authenticated, the response will look like this:

kali-linux-2024.1-live-amd64.iso: OK

 

For Windows, provided you have certutil you can use the command above and then manually check the contents of the txt file to see if the two SHA256 sums match. If certutil is not available, any of the tools stated above would be able to provide you the SHA256 sum of your download.

IMPORTANT! If you are unable to verify the authenticity of the Kali Linux image you have downloaded as described in the preceding section, do NOT use it! Using it could endanger not only your own system, but any network you connect to as well as the other systems on that network. Stop, and ensure that you have downloaded the images from a legitimate Kali Linux mirror.

Verify the ISO Using the SHA256SUMS File

If using Powershell on Windows you may receive a fully uppercase result. This can cause an error when comparing the two sums. Send this result through a converter to get a proper result.

This is a more complex procedure, but offers a much higher level of validation: it does not rely on the integrity of the web site you downloaded the image from, only the official Kali Linux development team key that you install independently. To verify your image this way for an Intel architecture version of Kali, you will need to download three files from the Kali “Live CD Image” site for the current release (v2024.1, as of this writing):

  • The ISO image itself (e.g. kali-linux-2024.1-live-amd64.iso)
  • The file containing the calculated SHA256 hash for the ISO, SHA256SUMS
  • The signed version of that file, SHA256SUMS.gpg

Before verifying the checksums of the image, you must ensure that the SHA256SUMS file is the one generated by Kali Linux. That’s why the file is signed by Kali’s official key with a detached signature in SHA256SUMS.gpg. If you have not already done so, Kali’s official key can be downloaded and imported into your keychain with this command:

$ wget -q -O – https://archive.kali.org/archive-key.asc | gpg –import

 

or this command

$ gpg –keyserver hkps://keys.openpgp.org –recv-key 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6

 

Your output should look like this:

gpg: key ED444FF07D8D0BF6: public key “Kali Linux Repository <[email protected]>” imported

gpg: Total number processed: 1

gpg:               imported: 1  (RSA: 1)

 

You should verify that the key is properly installed with the command:

$ gpg –fingerprint 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6

 

The output will look like this:

pub   rsa4096 2012-03-05 [SC] [expires: 2025-01-24]

      44C6 513A 8E4F B3D3 0875  F758 ED44 4FF0 7D8D 0BF6

uid           [ full] Kali Linux Repository <[email protected]>

sub   rsa4096 2012-03-05 [E] [expires: 2025-01-24]

 

Once you have downloaded both SHA256SUMS and SHA256SUMS.gpg, you can verify the signature as follows:

$ gpg –verify SHA256SUMS.gpg SHA256SUMS

gpg: Signature made Mon Sep  2 06:42:05 2019 EDT

gpg:                using RSA key 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6

gpg: Good signature from “Kali Linux Repository <[email protected]>” [full]

 

If you do not get that “Good signature” message or if the key ID does not match, then you should stop and review whether you downloaded the images from a legitimate Kali Linux mirror. The failed verification strongly suggests that the image you have may have been tampered with.

If you did get the “Good signature” response, you can now be assured that the checksum in the SHA256SUMS file was actually provided by the Kali Linux development team. All that remains to be done to complete the verification is to validate that the signature you compute from the ISO you’ve downloaded matches the one in the SHA256SUMS file. You can do that on Linux or macOS with the following command (assuming that the ISO is named “kali-linux-2024.1-live-amd64.iso” and is in your working directory):

$ grep kali-linux-2024.1-live-amd64.iso SHA256SUMS | shasum -a 256 -c

 

If the image is successfully authenticated, the response will look like this:

kali-linux-2024.1-live-amd64.iso: OK

 

If you do not get “OK” in response, then stop and review what’s happened: the Kali image you have has apparently been tampered with. Do NOT use it.

Once you’ve downloaded and verified your image, you can proceed to create a bootable “Kali Linux Live” USB drive.

Download Kali Linux Images Securely

When you download an image, be sure to download the SHA256SUMS and SHA256SUMS.gpg files that are next to the downloaded image (i.e. in the same directory on the Kali Linux Download Server). Before verifying the checksums of the image, you must ensure that the SHA256SUMS file is the one generated by Kali. That’s why the file is signed by Kali’s official key with a detached signature in SHA256SUMS.gpg. Kali’s official key can be downloaded like so:

$ wget -q -O https://archive.kali.org/archive-key.asc | gpg –import

# or…

$ gpg –keyserver hkps://keyserver.ubuntu.com –recv-key 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6

# …and verify that the displayed fingerprint matches the one below

$ gpg –fingerprint 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6

pub   rsa4096/0xED444FF07D8D0BF6 2012-03-05 [SC] [expires: 2023-01-16]

uid [ unknown] Kali Linux Repository <[email protected]>

sub   rsa4096/0xA8373E18FC0D0DCB 2012-03-05 [E] [expires: 2023-01-16]

 

Once you have downloaded both SHA256SUMS and SHA256SUMS.gpg, you can verify the signature as follows:

$ wget -q https://cdimage.kali.org/current/SHA256SUMS{.gpg,}

$ gpg –verify SHA256SUMS.gpg SHA256SUMS

gpg: Signature made Tue 17 Nov 2020 15:39:09 GMT

gpg:                using RSA key 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6

gpg: Good signature from “Kali Linux Repository <[email protected]>” [unknown]

gpg: WARNING: This key is not certified with a trusted signature!

gpg:          There is no indication that the signature belongs to the owner.

Primary key fingerprint: 44C6 513A 8E4F B3D3 0875  F758 ED44 4FF0 7D8D 0BF6

 

If you don’t get that “Good signature” message or if the key ID doesn’t match, then you should stop the process and review whether you downloaded the images from a legitimate Kali mirror.

Kali’s Default Credentials

Kali changed to a non-root user policy by default since the release of 2020.1.

This means:

  • During the installation of amd64 and i386 images, it will prompt you for a standard user account to be created.
  • Any default operating system credentials used during Live Boot, or pre-created image (like Virtual Machines & ARM) will be:
    • User: kali
    • Password: kali
  • Vagrant image (based on their policy):
    • Username: vagrant
    • Password: vagrant
  • Amazon EC2:
    • User: kali
    • Password: <ssh key>

Default Tool Credentials

Some tools shipped with Kali, will use their own default hardcoded credentials (others will generate a new password the first time its used). The following tools have the default values:

  • BeEF-XSS
    • Username: beef
    • Password: beef
    • Configuration File: /etc/beef-xss/config.yaml
  • MySQL
    • User: root
    • Password: (blank)
    • Setup Program: mysql_secure_installation
  • OpenVAS
    • Username: admin
    • Password: <Generated during setup>
    • Setup Program: openvas-setup
  • Metasploit-Framework
    • Username: postgres
    • Password: postgres
    • Configuration File: /usr/share/metasploit-framework/config/database.yml
  • PowerShell-Empire/Starkiller
    • Username: empireadmin
    • Password: password123

Kali Undercover

Kali Undercover is a set of scripts that change the theme of your Kali Linux to a Windows 10 alike theme.

It was released with Kali Linux 2019.4 with an important concept in mind, to hide in plain sight.

Going “undercover”

Switching to undercover mode is pretty simple, just run the following command:

kali@kali:~$ kali-undercover

kali@kali:~$

 

or, you could also look for “Kali Undercover Mode” from the menu of your desktop and launch it from there.

Swoosh! Now, you are (almost) invisible to most indescrete eyes by having a theme that would make most people think you are using Windows 10.

Reverting Back

Now, to revert back into your previous Kali Linux theme just re-enter the previous command:

kali@kali:~$ kali-undercover

kali@kali:~$

 

Ta-da! Welcome back! Now, all your desktop settings should be restored.

Purpose of Undercover Mode in Kali Linux

The main purpose of introducing Kali Undercover mode is to prevent any unnecessary attention while using Kali Linux in public.

Let’s imagine a scenario: you are ethically pentesting your client and you are in their office or reception doing reconnaissance or something that involves the use of Kali Linux.

Someone from your client’s office or some random on-looker spots the desktop environment/wallpaper of Kali Linux, so they might think you are doing something mischievous even though you are doing it ethically and warn the authority. All the hard work that you did from the beginning to become stealthy will go in vain. And that’s because of what? A wallpaper! For a client who requested you to become stealthy, this is not what you would want.

Hence, to prevent any kind of unwanted attention from public it’s better to go “Undercover!”.

Kali Press Release

Introducing Kali Linux

Free All-in-One Solution for Professional Security Auditing

Popular BackTrack Linux Evolves Into Mature, Enterprise-Ready Penetration Testing Toolkit.

Black Hat Europe, Amsterdam – 13th March 2013 – OffSec (previously known as Offensive Security) today announced the availability of Kali Linux, the evolution of its popular BackTrack Linux, a free security auditing operating system and toolkit. Showcased at Black Hat Europe in Amsterdam, Kali Linux incorporates more than 300 penetration testing and security auditing programs with a Linux operating system, delivering an all-in-one solution that enables IT administrators and security professionals to test the effectiveness of risk mitigation strategies.

“For IT professionals, an experiment is worth a thousand theories. Applied to security, it means that simulating attacks to assess the defenses protecting your organization is the only sure way to understand their effectiveness and the impact of an attack,” said Mati Aharoni, Lead Trainer and Developer, OffSec. “That’s why we created Kali Linux; we’ve developed the most advanced penetration testing and security auditing toolkit available to help IT administrators and security professionals put themselves in the shoes of potential attackers.”

The new Kali Linux offers a smoother, easier penetration testing experience, making it more accessible to IT generalists as well as security specialists. The new infrastructure incorporates Debian development standards to provide a more familiar environment for IT administrators. The result is a more robust solution that can be updated more easily. Users can also customize the operating system to tailor it to their needs and preferences.

All the programs packaged with the operating system were evaluated for suitability and effectiveness before being included. They include Metasploit-Framework for network penetration testing, Nmap for port and vulnerability scanning, Wireshark for monitoring network traffic, and Aircrack-ng for testing the security of wireless networks.

“When it comes to security, the best defense is offense; you need to test the effectiveness of your own security practices before a real intruder does it for you,” said HD Moore, Chief Architect for Metasploit at Rapid7. “We built Metasploit to level the playing field for defenders; arming them with the same tools the attackers have. OffSec takes this even further, bringing hundreds of such tools together in Kali Linux to streamline security auditing.” Additionally, Kali Linux can now run on a wide variety of hardware and is compatible with numerous wireless and USB devices. It also introduced support for ARM devices – typically miniature, battery-powered computers – which are becoming more prevalent and inexpensive. More information on which devices are supported, as well as other documentation, is available on the Kali Linux documentation site.

Pricing and Availability

Like its predecessors, Kali Linux is completely free and always will be. OffSec is committed to supporting the Open-source community with the ongoing development of Kali Linux. The development tree and all sources are available for those who wish to tweak and rebuild packages. Kali Linux is available immediately for download from kali.org/downloads/.

About Kali Linux

Kali Linux (formerly known as BackTrack Linux) is an open-source, Debian-based Linux distribution aimed at advanced Penetration Testing and Security Auditing. Kali Linux contains several hundred tools targeted towards various information security tasks, such as Penetration Testing, Security Research, Computer Forensics and Reverse Engineering. Kali Linux is a multi platform solution, accessible and freely available to information security professionals and hobbyists.

About OffSec

Founded in 2007, OffSec was born out of the belief that the only way to achieve sound defensive security is through an offensive approach. The team is made up of security professionals with extensive experience of attacking systems to see how they respond. They share this information through trainings, free tools and publications. With the motto “Try Harder”, the Company’s trainings and certifications are well-respected and considered amongst the most rigorous available, creating a model adopted across the industry. In addition, the Exploit Database, VulnHub, Metasploit Unleashed and BackTrack Linux community projects are highly-regarded and used by security teams in governmental and commercial organizations across the world. In March 2023 Offensive Security was renamed to OffSec. For more information about OffSec, please visit offsec.com.

Kali Linux History

Kali Linux is based on years of knowledge and experience of building a pentestion testing Operating Systems, which has spanned over multiple previous projects. During all these project’s life-time, there has been only a few different developers, as the team has always been small. As a result, Kali has been years in the making and has come a long way.

The first project was called Whoppix, which stood for WhiteHat Knoppix. As can be inferred from the name, it was based on Knoppix for the underlining OS. Whoppix had releases ranging from v2.0 to v2.7.

This made way for the next project, WHAX (or the long hand, WhiteHat Slax). The name change was because the base OS changed from Knoppix to Slax. WHAX started at v3, as a nod towards it carrying on from Whoppix.

There was a similar OS being produced at the same time, Auditor Security Collection (often getting shorted to just Auditor), once again using Knoppix, and efforts were combined (with WHAX) to produce BackTrack. BackTrack was based on Slackware from v1 to v3, but switched to Ubuntu later on with v4 to v5.

Using the experience gained from all of this, Kali Linux came after BackTrack in 2013. Kali started off using Debian stable as the engine under the hood before moving to Debian testing when Kali became a rolling OS.

This is only the major releases, there were minor ones to address bug fixes, releases, and tools updates.

For more details about Kali Linux’s history, see this page and our press release. And for more information about Kali Linux’s releases, see this page.

Kali ARM History

When BackTrack ARM first came out, it was one image, for a Motorola Xoom. The work was done on the Xoom itself by @muts. He started from an Ubuntu image for it, built all of the packages for BackTrack on it, then installed them. @steev then took the work and expanded it to support 3 or 4 different ARM devices he had, following a similar procedure. @steev showed @muts the work he’d done and @muts was as excited about it as @steev was.

When Kali came about, we retooled everything, including build servers for armel, armhf, and arm64. No more building packages manually on the ARM devices themselves. So everything was in place, but the images for ARM devices were still being built manually. Putting out an updated image meant downloading the last release, writing it to an sdcard, booting the device, running updates, building the kernel, installing the new kernel, cleaning up the logs and apt cache, then powering the system off, plugging the sdcard back into my other system, and creating a dd image of the sdcard, putting it on to a server. This was very error prone due to the nature of sd cards from different manufacturers having different actual sizes.

We wanted to make it so anyone could, starting from a Kali amd64 installation, build an image that would work on any of our supported ARM devices, end up with exactly what we put out, and most importantly, customize it for their needs. So we created the kali-arm build scripts – they are not fancy, but they’re easy to read, follow and modify.

Kali NetHunter History

Kali NetHunter is a custom OS for Android devices. This takes Kali Linux desktop and makes it mobile.

Kali NetHunter is made up of three parts:

  • ROM
  • App (and AppStore)
  • Kali Chroot

Kali NetHunter was first released in September 2014 with v1.0, supporting just Nexus devices (5,7 and 10). There was a minor release of Kali NetHunter v1.1 in January 2015, and at the same time device support started to appear, such as OnePlus One and Nexus 4.

Kali NetHunter v3 was the next major release in January 2016, which was a complete NetHunter app rewrite, allowing for more control and actions to be performed from it, build scripts and Android 5 and 6 support. Nexus 6 device also became supported.

Kali NetHunter then joined the rolling release with 2019.2 release in May 2019, where 13 devices where supported, with a mixture of Android 4 to 9. From this point, Kali NetHunter matched the release points of Kali Linux, with each of them adding more devices support, image and overall features.

In July 2019, the Kali NetHunter store, went public, allowing for a place of dedicated information security focused apps to be located.

With the release of Kali NetHunter 2019.4, NetHunter KeX was launched, giving a “full Kali desktop on Android phones”.

Kali Linux Image Overview

Below is an overview of where you can get Kali Linux that is kept up-to-date when a new platform or system is added. Each entry that has a Kali docs page available will have their page linked.

WSL does not have enough unique methods of obtaining Kali to warrant its own column. For this reason, it is included in the “Virtual Machines” column.

Installing Kali Linux on desktops & laptops using “.ISO” files (x64/x86)

Installing Kali Linux

Installing Kali Linux (single boot) on your computer is an easy process. This guide will cover the basic install (which can be done on bare metal or guest VM), with the option of encrypting the partition. At times, you may have sensitive data you would prefer to encrypt using Full Disk Encryption (FDE). During the setup process you can initiate an LVM encrypted install on either Hard Disk or USB drives.

First, you’ll need compatible computer hardware. Kali Linux is supported on amd64 (x86_64/64-bit) and i386 (x86/32-bit) platforms. Where possible, we would recommend using the amd64 images. The hardware requirements are minimal as listed in the section below, although better hardware will naturally provide better performance. You should be able to use Kali Linux on newer hardware with UEFI and older systems with BIOS.

Our i386 images, by default use a PAE kernel, so you can run them on systems with over 4 GB of RAM.

In our example, we will be installing Kali Linux in a fresh guest VM, without any existing operating systems pre-installed. We will explain other possible scenarios throughout the guide.

System Requirements

The installation requirements for Kali Linux will vary depending on what you would like to install and your setup. For system requirements:

  • On the low end, you can set up Kali Linux as a basic Secure Shell (SSH) server with no desktop, using as little as 128 MB of RAM (512 MB recommended) and 2 GB of disk space.
  • On the higher end, if you opt to install the default Xfce4 desktop and the kali-linux-default metapackage, you should really aim for at least 2 GB of RAM and 20 GB of disk space.
    • When using resource-intensive applications, such as Burp Suite, they recommend at least 8 GB of RAM (and even more if it is a large web application!) or using simultaneous programs at the same time.

Installation Prerequisites

This guide will make also the following assumptions when installing Kali Linux:

  • Using the amd64 installer image.
  • CD/DVD drive / USB boot support.
  • Single disk to install to.
  • Connected to a network (with DHCP & DNS enabled) which has outbound Internet access.

We will be wiping any existing data on the hard disk, so please backup any important information on the device to an external media.

Preparing for the Installation

  1. Download Kali Linux (We recommend the image marked Installer).
  2. Burn The Kali Linux ISO to DVD or image Kali Linux Live to USB drive. (If you cannot, check out the Kali Linux Network Install).
  3. Backup any important information on the device to an external media.
  4. Ensure that your computer is set to boot from CD/DVD/USB in your BIOS/UEFI.
  5. In the UEFI settings, ensure that Secure Boot is disabled. The Kali Linux kernel is not signed and will not be recognized by Secure Boot.

Kali Linux Installation Procedure

Boot

  1. To start your installation, boot with your chosen installation medium. You should be greeted with the Kali Linux Boot screen. Choose either Graphical install or Install (Text-Mode). In this example, we chose the Graphical install.

If you’re using the live image instead, you will see another mode, Live, which is also the default boot option.

Language

  1. Select your preferred language. This will be used for both the setup process and once you are using Kali Linux.
  1. Specify your geographic location.
  1. Select your keyboard layout.

Network

  1. The setup will now probe your network interfaces, looks for a DHCP service, and then prompt you to enter a hostname for your system. In the example below, we’ve entered kali as our hostname.

If there is no network access with DHCP service detected, you may need to manually configure the network information or do not configure the network at this time.

  • If there isn’t a DHCP service running on the network, it will ask you to manually enter the network information after probing for network interfaces, or you can skip.
  • If Kali Linux doesn’t detect your NIC, you either need to include the drivers for it when prompted, or generate a custom Kali Linux ISO with them pre-included.
  • If the setup detects multiple NICs, it may prompt you which one to use for the install.
  • If the chosen NIC is 802.11 based, you will be asked for your wireless network information before being prompted for a hostname.
  1. You may optionally provide a default domain name for this system to use (values may be pulled in from DHCP or if there is an existing operating systems pre-existing).

User Accounts

  1. Next, create the user account for the system (Full name, username and a strong password).

Clock

  1. Next, set your time zone.

Disk

  1. The installer will now probe your disks and offer you various choices, depending on the setup.

In our guide, we are using a clean disk, so we have four options to pick from. We will select Guided – the entire disk, as this is the single boot installation for Kali Linux, so we do not want any other operating systems installed, so we are happy to wipe the disk.

If there is an pre-existing data on the disk, you will have have an extra option (Guided – use the largest continuous free space) than the example below. This would instruct the setup not to alter any existing data, which is perfect for dual-booting into another operating system. As this is not the case in this example, it is not visible.

Experienced users can use the “Manual” partitioning method for more granular configuration options, which is covered more in our BTRFS guide.

If you want to encrypt Kali Linux, you can enable Full Disk Encryption (FDE), by selecting Guided – used entire disk and setup encrypted LVM. When selected, later on in the setup (not in this guide) prompt you to enter a password (twice). You will have to enter this password every time you start up Kali Linux.

  1. Select the disk to be partitioned.
  1. Depending on your needs, you can choose to keep all your files in a single partition – the default – or to have separate partitions for one or more of the top-level directories.

If you’re not sure which you want, you want “All files in one partition”.

  1. Next, you’ll have one last chance to review your disk configuration before the installer makes irreversible changes. After you click Continue, the installer will go to work and you’ll have an almost finished installation.

Encrypted LVM

If enabled in the previous step, Kali Linux will now start to perform a secure wipe of the hard disk, before asking you for a LVM password.

Please be sure a strong password is used, or else you will be prompted with a weak passphrase warning.

This wipe may take “a while” (hours) depending on the size and speed of the drive.
If you wish to risk it, you can skip it.

Proxy Information

  1. Kali Linux uses a central repository to distribute applications. You’ll need to enter any appropriate proxy information as needed.

Metapackages

If network access was not setup, you will want to continue with setup when prompt.

If you are using the Live image, you will not have the following stage.

  1. Next you can select which metapackages you would like to install. The default selections will install a standard Kali Linux system and you don’t really have to change anything here.

Please refer to this guide if you prefer to change the default selections.

Boot Information

  1. Next confirm to install the GRUB boot loader.
  1. Select the hard drive to install the GRUB bootloader in (it does not by default select any drive).

Reboot

  1. Finally, click Continue to reboot into your new Kali Linux installation.

Post Installation

Now that you’ve completed installing Kali Linux, it’s time to customize your system.

The General Use section has more information and you can also find tips on how to get the most out of Kali Linux in our User Forums.

Installing Kali on Mac Hardware

IMPORTANT! Newer Mac hardware (e.g. T2/M1 chips) do not run Linux well, or at all. This is true for Linux in general, not just Kali Linux.
The model & year of the device will determine how successful your experience will be.

Installing Kali Linux (Single boot) on Apple Mac hardware (such as MacBook/MacBook Pro/MacBook Airs/iMacs/iMacs Pros/Mac Pro/Mac Minis), can be a straight forward, if the hardware is supported. Most of the time, there are a few issues that come up, so there is a bit of trial and error.

This guide will show you how to replace macOS/OS X with Kali Linux. However, if you wish to keep macOS/OS X, you will want to refer to our dual-boot guide instead.

In our example, we will be installing Kali Linux on a Mac Mini (Mid 2011) using macOS High Sierra (10.13). The same procedure has also been tested on a Mac Book Air (Early 2014) using macOS Catalina (10.15).

Installation Prerequisites

This guide will make the following assumptions:

  • You have read our single boot Kali Linux install guide, as this has the same Installation Prerequisites (System requirements, setup assumptions and install media).
  • Currently running macOS/OS X 10.7 or higher (later versions are more preferred) as this means the hardware is Intel (and not a PowerPC CPU).
  • Depending on the Mac hardware model & year, you may find:
    • Different results when trying to boot by using either a CD/DVD or a USB drive.
      • You may be able to increase the chances of booting (especially older hardware and non-EFI) from a USB drive by having rEFInd pre-installed.
    • When using the graphical installer, you may notice the tracepad does not function (but will after Kali Linux is installed).
    • In-built wireless may not work, as firmware-b43-installer is not included in the default images.

We will be wiping any existing data on the hard disk, so please backup any important information on the device to an external media.

Kali Linux Installation Procedure

  1. To start your installation, make sure you insert your Kali Linux installation medium and power on the device. Immediately press and hold the Option (or Alt) ⌥ key until you see the boot menu (rEFInd if installed, else the default macOS/OS X). You may or may not have a Recovery HD depending on your macOS/OS X setup.
  1. When the boot menu appears, if everything works as expected, you should see two volumes:
  • EFI BootNewer hardware which support UEFI. It is common for GUID Partition Table (GPT) partitions to be used.
  • Windows – “Non-EFI” boot. This use on older hardware which uses BIOS. You often see Master Boot Record (MBR) partition tables here.

If you only see one volume (EFI Boot), then the installation media is not supported for this device. This could be because the age of the firmware on the device.
You may wish to install rEFInd, as it is a boot manager, and try again.

Even though Kali Linux is based on Debian, macOS/OS X always detects non-EFI boot media as Windows. We suggest that you select the EFI Boot volume to continue. However, if the installation hangs at this point, power cycle and select Windows (Being Kali Linux non-EFI/BIOS). The success depends on the Mac hardware’s model & year.

Kali Linux Installation Procedure

  1. The installation procedure from this point onwards is the same as our Kali Linux Hard Disk install guide.
  2. After that is complete, all that is left is to reboot, take out the installation media, and enjoy Kali Linux.

Troubleshooting macOS/OS X

If you have issues installing Kali Linux on macOS/OS X, there are a few options you can try:

  • Install the latest version of macOS/OS X (App store, Recovery or USB) and applying any updates as this may upgrade the firmware.
  • Install rEFInd boot manager to replace the default boot manager.
  • If you’re using a DVD, refresh rEFInd once the drive has stop spinning by pressing ESC.
  • Switch from EFI to BIOS boot when trying to boot Kali Linux.
  • Switch from GPT drive to Hybrid MRB drive (using the Live image may help).

Post Installation

Now that you’ve completed installing Kali Linux, it’s time to customize your system.

The General Use section has more information and you can also find tips on how to get the most out of Kali Linux in our User Forums.

Dual Booting Kali with Linux

Installing Kali Linux alongside another Linux installation can be quite useful. However, you need to exercise caution during the setup process. First, make sure that you’ve backed up any important data on your Linux installation. Since you’ll be modifying your hard drive, you’ll want to store this backup on external media. Once you’ve completed the backup, we recommend you peruse our Kali Linux Hard Disk install guide, which explains the normal procedure for a basic Kali Linux install.

In our example, we will be installing Kali Linux alongside an installation of Ubuntu (Server 18.04), which is currently taking up 100% of the disk space in our computer. We will start by resizing our current Linux partition to occupy less space and then proceed to install Kali Linux in the newly-created empty partition.

Installation Prerequisites

This guide will make the following assumptions:

We need to use a different image from the single boot Kali Linux install guide, as we need the live image. This is because we need to edit the disk structure without mounting any partitions (otherwise they would be in-use). After we have finished altering the disk layout, we can still install Kali Linux using the live image, but there will be a few differences such as:

Both of these can be addressed post installation, as it saves swapping to the installer image (as you will need either multiple CD/DVD/USBs or to re-image half way though).

This installation has the potential to go wrong very easily as it involves editing existing partitions. Be aware of what partitions you are modifying and where you are installing Kali Linux to.
Having a backup of your Linux files available is a good idea in the event something goes wrong.

Resize Linux Procedure

Before we can install Kali Linux, there needs to be room on the hard disk. By booting into a live Kali Linux session with your chosen installation medium, we can resize the partition to our desired size, as the disk will not be in use because Kali Linux will all be in memory.

  1. To start resizing, make sure you insert your Kali Linux installation medium and power on the device. If needed, press any keyboard shortcuts for a “boot order menu” (depends on each manufacture) or boot into BIOS/UEFI and change the boot order to point to the installation medium first.
  2. When the boot menu/options appears, you should see at least one new option. Depending on the manufacture, hardware, how the system is configured and install medium, you may see more options (e.g. Can you boot into non-UEFI?).

You may need to try a few different options in order to find success.

  1. You should be greeted with the Kali Linux boot screen. Select Live, and you should be booted into the Kali Linux default desktop.
  1. Now launch GParted, which we’ll use to shrink the existing Linux partition to give us enough room to install Kali Linux in the free space.
  1. Once GParted has opened, select your Linux partition (/dev/sda1) & resize it leaving enough space (we recommend at least 20 GB) for the Kali Linux installation.

Depending on your setup, the disk structure may be different to include:

  • A swap partition
  • Separate partitions for certain directories (e.g. /home, /var and /tmp)

You often just want to select the largest partition (commonly the data/home directory)

If you are moving past into any non-white in the partition then you are editing a section that is in use.
Only remove from the area of the partition that is not in use.

If you wish to organize the partition to group all the Linux partitions together, placing the free space at the end, you may do so.

  1. Once you have resized your Linux partition, ensure you “Apply All Operations” on the hard disk. Exit gparted and reboot.

Kali Linux Installation Procedure

  1. The installation procedure from this point onwards is similar to a Kali Linux Hard Disk install, until the point of the partitioning. At this point, you need to select “Guided – use the largest continuous free space(rather than “Guided – the entire disk”) which got created earlier with gparted.
  1. You can carry on following the single boot Kali Linux install guide, expect you will not have the option to select desktop environment or metapackages as you are using the live image. Once the installation is done, reboot.

You should be greeted with a GRUB boot menu, which will allow you to boot either into Kali Linux or the other Linux operating system.

Post Installation

Now that you’ve completed installing Kali Linux, it’s time to customize your system.

The General Use section has more information and you can also find tips on how to get the most out of Kali Linux in our User Forums.

Dual Booting Kali with macOS/OS X

IMPORTANT! Newer Mac hardware (e.g. T2/Apple Silicon) do not run Linux well, or at all. This is true for Linux in general, not just Kali Linux.
The model & year of the device will determine how successful your experience will be.

This guide will show you to dual-boot macOS/OS X with Kali Linux using rEFInd boot manager. If you wish to replace macOS/OS X completely, please refer to our single boot Kali on Mac hardware guide.

By using using the 3rd party boot manager rEFInd (a fork of rEFIt) we are able to increase our control when booting over macOS/OS X OS’s default option. This makes it perfect for dual booting, as a keyboard shortcut does not need to be used every time the device is powered on to boot Kali Linux. rEFInd also has the advantage of helping older hardware to boot from USB devices that would not be able to otherwise (e.g. non-EFI). Once Kali Linux has been installed, rEFInd can be customized to be hidden during boot or removed completely.

In our example, we will be installing Kali Linux on a Mac Mini (Mid 2011) using macOS High Sierra (10.13). The same procedure has also been tested on a Mac Book Air (Early 2014) using macOS Catalina (10.15).

Installation Prerequisites

This guide will make the following assumptions:

  • You have read our single boot Kali Linux install guide, as this has the same Installation Prerequisites (System requirements & setup assumptions).
  • When downloading Kali Linux, pick the live image, rather than the installer option.
  • A single disk to install to (rather than a dedicated disk per operating system).
  • Currently running macOS/OS X 10.7 or higher (later versions are more preferred) as this means the hardware is Intel (and not a PowerPC CPU).
  • Depending on the Mac hardware model & year, you may find:
    • Different results when trying to boot by using either a CD/DVD or a USB drive.
      • You may be able to increase the chances of booting (especially older hardware and non-EFI) from a USB drive by having rEFInd pre-installed.
    • When using the graphical installer, you may notice the tracepad does not function (but will after Kali Linux is installed).
    • In-built wireless may not work, as firmware-b43-installer is not included in the default images.

We need to use a different image from the single boot Kali Linux install guide, as we need the live image. This is because we need to edit the disk structure without mounting any partitions (otherwise they would be in-use). After we have finished altering the disk layout, we can still install Kali Linux using the live image, but there will be a few differences such as:

Both of these can be addressed post installation, as it saves swapping to the installer image (as you will need either multiple CD/DVD/USBs or to re-image half way though).

This installation has the potential to go wrong very easily as it involves editing existing partitions. Be aware of what partitions you are modifying and where you are installing Kali Linux to.
Having a backup of your macOS/OS X files available is a good idea in the event something goes wrong.

Resize macOS/OS X Procedure

Before we can install Kali Linux, there needs to be room on the hard disk. Depending on the format of the macOS/OS X partition, will depend on what method you need todo.

  • If macOS/OS X Sierra (10.12) and earlier, it will be Mac OS Extended (HFS+).
    • You can resize using GParted in from a Kali Linux live session
  • Since macOS/OS X High Sierra (10.13) and later, the default will be Apple File System (APFS).
    • You can resize in a normal macOS/OS X session, or in recovery mode (recommended).

HFS+/GParted

  1. To start resizing, make sure you insert your Kali Linux installation medium and power on the device. Immediately press and hold the Option (or Alt) ⌥ key until you see the boot menu (rEFInd if installed, else the default macOS/OS X). You may or may not have a Recovery HD depending on your macOS/OS X setup.
  1. When the boot menu appears, if everything works as expected, you should see two volumes:
  • EFI BootNewer hardware which support UEFI. It is common for GUID Partition Table (GPT) partitions to be used.
  • Windows – “Non-EFI” boot. This use on older hardware which uses BIOS. You often see Master Boot Record (MBR) partition tables here.

If you only see one volume (EFI Boot), then the installation media is not supported for this device. This could be because the age of the firmware on the device.
You may wish to install rEFInd, as it is a boot manager, and try again.

Even though Kali Linux is based on Debian, macOS/OS X always detects non-EFI boot media as Windows. We suggest that you select the EFI Boot volume to continue. However, if the installation hangs at this point, power cycle and select Windows (Being Kali Linux non-EFI/BIOS). The success depends on the Mac hardware’s model & year.

  1. You should be greeted with the Kali Linux boot screen. Select Live, and you should be booted into the Kali Linux default desktop.
  1. Now launch GParted, which we’ll use to shrink the existing macOS/OS X partition to give us enough room to install Kali Linux in the free space.
  1. Once GParted has opened, select your macOS/OS X partition & resize it leaving enough space (we recommend at least 20 GB) for the Kali Linux installation.

Depending on your setup, it is often the second option (the largest partition). In our example, there are three partitions:

  • The EFI upgrade partition (/dev/sda1)
  • macOS/OS X’s main operating system (/dev/sda2)
  • System Recovery (/dev/sda3)

If you are moving past into any non-white in the partition then you are editing a section that is in use.
Only remove from the area of the partition that is not in use.
It is alright to leave the third partition (/dev/sda3), and only shrink the actual install (/dev/sda2).

If you wish to organize the partition to group all the macOS/OS X partitions together, placing the free space at the end, you may do so.

  1. Once you have resized your macOS/OS X partition, ensure you “Apply All Operations” on the hard disk. Exit gparted and reboot.

APFS/Recovery

This can be doing using either the command line, or graphical (using Disk Utility). Both option support resizing in a “normal” session, or booting into recovery mode. Using recovery mode, means the drive is not in use, so would reduce of the chances of issues. We would also recommend using the command line method, as it allows for a empty partition to be created which simplifies the setup process later on.

  1. To get to command line access: Spotlight->Terminal
  2. By using diskutil list, we can see our disk we want to resize is disk0s2, and it is ~500GB:

$ diskutil list

/dev/disk0 (internal, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *500.1 GB   disk0

   1:                        EFI EFI                     209.7 MB   disk0s1

   2:                 Apple_APFS Container disk1         499.9 GB   disk0s2

 

/dev/disk1 (synthesized):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      APFS Container Scheme –                      +499.9 GB   disk1

                                 Physical Store disk0s2

   1:                APFS Volume Macintosh HD            16.6 GB    disk1s1

   2:                APFS Volume Preboot                 21.4 MB    disk1s2

   3:                APFS Volume Recovery                516.2 MB   disk1s3

   4:                APFS Volume VM                      20.5 KB    disk1s4

 

$

 

  1. We want to reduce the 500GB to be 400GB. This would give Kali Linux 100GB (we recommend at least 20 GB):

$ sudo diskutil apfs resizeContainer disk0s2 400g

Password:

Started APFS operation

Aligning shrink delta to 99,898,105,856 bytes and targeting a new physical store size of 400,000,000,000 bytes

Determined the minimum size for the targeted physical store of this APFS Container to be 17,949,245,440 bytes

Resizing APFS Container designated by APFS Container Reference disk1

The specific APFS Physical Store being resized is disk0s2

Verifying storage system

Using live mode

Performing fsck_apfs -n -x -l /dev/disk0s2

Checking volume

Checking the container superblock

Checking the EFI jumpstart record

Checking the space manager

Checking the object map

Checking the APFS volume superblock

Checking the object map

Checking the fsroot tree

Checking the snapshot metadata tree

Checking the extent ref tree

Checking the snapshots

Checking the APFS volume superblock

Checking the object map

Checking the fsroot tree

Checking the snapshot metadata tree

Checking the extent ref tree

Checking the snapshots

Checking the APFS volume superblock

Checking the object map

Checking the fsroot tree

Checking the snapshot metadata tree

Checking the extent ref tree

Checking the snapshots

Checking the APFS volume superblock

Checking the object map

Checking the fsroot tree

Checking the snapshot metadata tree

Checking the extent ref tree

Checking the snapshots

Verifying allocated space

The volume /dev/disk0s2 appears to be OK

Storage system check exit code is 0

Shrinking APFS Physical Store disk0s2 from 499,898,105,856 to 400,000,000,000 bytes

Shrinking APFS data structures

Shrinking partition

Modifying partition map

Finished APFS operation

$

 

  1. Quickly checking diskutil list again, we can see it has been successful:

$ diskutil list

/dev/disk0 (internal, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *500.1 GB   disk0

   1:                        EFI EFI                     209.7 MB   disk0s1

   2:                 Apple_APFS Container disk1         400.0 GB   disk0s2

 

/dev/disk1 (synthesized):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      APFS Container Scheme –                      +400.0 GB   disk1

                                 Physical Store disk0s2

   1:                APFS Volume Macintosh HD            16.6 GB    disk1s1

   2:                APFS Volume Preboot                 21.4 MB    disk1s2

   3:                APFS Volume Recovery                516.2 MB   disk1s3

   4:                APFS Volume VM                      20.5 KB    disk1s4

$

 

Kali Linux Installation Procedure

  1. The installation procedure from this point onwards is similar to a Kali Linux Hard Disk install, until the point of the partitioning. At this point, you need to select “Guided – use the largest continuous free space(rather than “Guided – the entire disk”) which got created earlier with gparted.

Do not forget you may need to press and hold the Option (or Alt) ⌥ key during the startup to see the boot menu (unless you have rEFInd installed).

  1. You can carry on following the single boot Kali Linux install guide, expect you will not have the option to select desktop environment or metapackages as you are using the live image. Once the installation is done, reboot.

By default, macOS/OS X will boot into itself, rather than any other operating system/install media. As we have done it already a few times, you need to hold the Option (or Alt) ⌥ key. Whilst this “works”, but its not ideal as it is easy to not boot anything other than macOS/OS X. Enter rEFInd, a replacement boot manager (which can also have themes applied).

Installing rEFInd

rEFInd is a boot manager, replacing the limiting default one with macOS/OS X, allowing for greater options. It can be installed either before or after Kali Linux’s installation, as well as from macOS/OS X or Kali Linux.

Since the release of macOS/OS X El Capitan (10.11), an additional security feature got introduced, System Integrity Protection (SIP). To install rEFInd using macOS/OS X, this first needs to be one-time bypassed (recommended), or disabled. Alternatively rEFInd can be installed using Kali Linux (we recommended todo so after when Kali Linux is installed rather than using live mode).

Installing rEFInd using macOS/OS X

rEFInd cannot easily be downloaded when in recovery mode, as there is limited space and tools/libraries available (e.g. curl does not support https). As a result, we will download rEFInd inside of a normal macOS/OS X session and afterwards reboot to recovery mode to install.

At the time of this writing, the latest version of rEFInd is 0.12.0.

  1. We will start off by downloading rEFInd, check its a valid zip file, and then extract:

$ curl -s -L https://sourceforge.net/projects/refind/files/0.12.0/refind-bin-0.12.0.zip -o ~/Downloads/refind.zip

$

$ file Downloads/refind.zip

Downloads/refind.zip: Zip archive data, at least v1.0 to extract

$

$ unzip -q -d Downloads/ Downloads/refind.zip

$

$ ls Downloads/

refind-bin-0.12.0 refind.zip

$

 

  1. We are going to restarting macOS/OS X, and press the Command (⌘) and R keys at the same time, until you see a boot logo. At this point, if there is a firmware password, you will need to enter it in order to continue.

This will bypass SIP by using macOS/OS X’s Recovery System version which is in-built to the firmware (so no Internet connection is required).

  1. When recovery mode has fully loaded, from the menu: Utilities->Terminal.
  1. Afterwards, we need to navigate to the extracted folder.

The path will be different, as its based on the label of the hard disk (in our case, Macintosh HD) and username (username) and version of rEFInd (0.12.0)

# cd /Volumes/Macintosh\ HD/Users/username/Downloads/refind-bin-0.12.0/

#

# pwd

/Volumes/Macintosh HD/Users/username/Downloads/refind-bin-0.12.0

#

 

  1. Execute shell script refind-install.

Even though we are in recovery, where SIP is not running, rEFInd still believes it is. We will overwrite this.

# ./refind-install

ShimSource is none

Installing rEFInd on macOS….

Installing rEFInd to the partition mounted at /Volumes/ESP

 

**** ALERT: SIP ENABLED! ****

 

rEFInd cannot be installed because System Integrity Protection (SIP) seems

to be enabled! You must install rEFInd from your Recovery installation or

from another OS. To install from the Recovery system:

 

  1. Reboot
  2. Hold down Command+R as the chime sounds
  3. When the OS has booted, select Utilities->Terminal
  4. Change to this directory with the ‘cd’ command; it will probably be under

     /Volumes/Macintosh HD/Users/username/Downloads/refind-bin-0.12.0

  1. Re-run this script.

 

If you believe SIP is NOT enabled, you may attempt an installation anyhow,

but it may fail.

 

For more on this subject, see http://www.rodsbooks.com/refind/sip.html

 

Do you want to attempt installation (Y/N)? y

Copied rEFInd binary files

 

Copying sample configuration file as refind.conf; edit this file to configure

rEFInd.

 

#

 

  1. Reboot macOS/OS X. From the menu: Apple->Restart.
  1. Upon restart you should see the new boot manager, rEFInd.

Installing rEFInd using Kali Linux

rEFInd is also included with Kali Linux. We can quickly install it by doing the following:

kali@kali:~$ sudo apt update

kali@kali:~$

kali@kali:~$ sudo apt install -y refind

 

During the installation, you will get a prompt saying about automatically running rEFInd. We recommend you press yes, otherwise you will need to run sudo dpkg-reconfigure refind (or sudo refind-install) afterwards:

┌────────────────────────┤ Configuring refind ├────────────────────────┐

 │                                                                      │

 │ It is necessary to install rEFInd to the EFI System Partition (ESP)  │

 │ for it to control the boot process.                                  │

 │                                                                      │

 │ Not installing the new rEFInd binary on the ESP may leave the        │

 │ system in an unbootable state. Alternatives to automatically         │

 │ installing rEFInd include running /usr/sbin/refind-install by hand   │

 │ or installing the rEFInd binaries manually by copying them from      │

 │ subdirectories of /usr/share/refind-{version}.                       │

 │                                                                      │

 │ Automatically install rEFInd to the ESP?                             │

 │                                                                      │

 │                   <Yes>                      <No>                    │

 │                                                                      │

 └──────────────────────────────────────────────────────────────────────┘

 

[…]

 

ShimSource is none

Installing rEFInd on Linux….

ESP was found at /boot/efi using vfat

Installing driver for ext4 (ext4_x64.efi)

Copied rEFInd binary files

 

Copying sample configuration file as refind.conf; edit this file to configure

rEFInd.

 

Creating new NVRAM entry

rEFInd is set as the default boot manager.

Creating //boot/refind_linux.conf; edit it to adjust kernel options.

kali@kali:~$

 

Upon restart you should see the new boot manager, rEFInd.

Configuring rEFInd

If you wish, you can alter rEFInd in various ways now, including:

  • The default OS selection
  • Timeout for menu selection
  • Direct boot into the default OS (Note, by pressing Option (or Alt) ⌥ key during boot, you will have a one-time boot menu).
  • Adding custom icons/themes.

refind.conf

macOS/OS X El Capitan

If you wish to make any of these alterations, this can be done by editing rEFInd’s configuration file. If you are using macOS/OS X El Capitan (10.11) or later, you need to mount the EFI boot volume first to access the file. This is done by doing the following:

$ cd ~/Downloads/refind-bin-*/

$

$ sudo ./mountesp

The ESP has been identified as /dev/disk0s1; attempting to mount it….

The ESP is mounted at /Volumes/ESP

username@Usernames-Mac refind-bin-0.12.0 %

 

$

$ vim /Volumes/ESP/EFI/refind/refind.conf

$

 

macOS/OS X Yosemite

If you are using macOS/OS X Yosemite (10.10) or earlier, the configuration file is located here as no mounting is required:

$ sudo vim /EFI/refind/refind.conf

$ s

 

Kali Linux

On Kali Linux, the configuration file is found in the following location:

kali@kali:~$ sudo vim /boot/efi/EFI/refind/refind.conf

kali@kali:~$

 

Post Installation

Now that you’ve completed installing Kali Linux, it’s time to customize your system.

The General Use section has more information and you can also find tips on how to get the most out of Kali Linux in our User Forums.

Dual Booting Kali with Windows

Installing Kali Linux next to a Windows installation has its benefits. However, you need to exercise caution during the setup process. First, make sure that you’ve backed up any important data on your Windows installation. Since you’ll be modifying your hard drive, you’ll want to store this backup on external media. Once you’ve completed the backup, we recommend you peruse our Kali Linux Hard Disk install guide, which explains the normal procedure for a basic Kali Linux install.

In our example, we will be installing Kali Linux alongside an installation of Windows (10), which is currently taking up 100% of the disk space in our computer. We will start by resizing our current Windows partition to occupy less space and then proceed to install Kali Linux in the newly-created empty partition.

Installation Prerequisites

This guide will make the following assumptions:

We need to use a different image from the single boot Kali Linux install guide, as we need the live image. This is because we need to edit the disk structure without mounting any partitions (otherwise they would be in-use). After we have finished altering the disk layout, we can still install Kali Linux using the live image, but there will be a few differences such as:

Both of these can be addressed post installation, as it saves swapping to the installer image (as you will need either multiple CD/DVD/USBs or to re-image half way though).

This installation has the potential to go wrong very easily as it involves editing existing partitions. Be aware of what partitions you are modifying and where you are installing Kali Linux to.
Having a backup of your Linux files available is a good idea in the event something goes wrong.

Resize Windows Procedure

Before we can install Kali Linux, there needs to be room on the hard disk. By booting into a live Kali Linux session with your chosen installation medium, we can resize the partition to our desired size, as the disk will not be in use because Kali Linux will all be in memory.

  1. Before Resizing the disk, Make Sure Fast Startup is turned off in Windows 10 so that we don’t get an error while resizing the partition. If you don’t know how to do that:- Open Control Panel > Hardware and Sound > Power Options > On the left, click Choose what the power buttons do > Then at the top, click Change Settings that are currently unavailable (This will ask for administrator permissions) > Now Unselect the Turn on fast startup option and click Save Changes at the bottom. Now you are ready to resize the partition.
  2. To start resizing, make sure you insert your Kali Linux installation medium and power on the device. If needed, press any keyboard shortcuts for a “boot order menu” (depends on each manufacture) or boot into BIOS/UEFI and change the boot order to point to the installation medium first.
  3. When the boot menu/options appears, you should see at least one new option. Depending on the manufacture, hardware, how the system is configured and install medium, you may see more options (e.g. Can you boot into non-UEFI?).

You may need to try a few different options in order to find success.

You may need to disable secure boot

  1. You should be greeted with the Kali Linux boot screen. Select Live, and you should be booted into the Kali Linux default desktop.
  1. Now launch GParted, which we’ll use to shrink the existing Windows partition to give us enough room to install Kali Linux in the free space.
  1. Once GParted has opened, select your Windows partition (/dev/sda2) & resize it leaving enough space (we recommend at least 20 GB) for the Kali Linux installation.

Depending on your setup, it is often the second option (the largest partition). In our example, there are three partitions:

  • Window’s boot partition (/dev/sda1)
  • Window’s main operating system itself (/dev/sda2)
  • Window’s System Recovery partition (/dev/sda3)

If you are moving past into any non-white in the partition then you are editing a section that is in use.
Only remove from the area of the partition that is not in use.
It is normal to leave the third partition (/dev/sda3), and only shrink the actual install (/dev/sda2).

If you wish to organize the partition to group all the Windows partitions together, placing the free space at the end, you may do so.

  1. Once you have resized your Windows partition, ensure you “Apply All Operations” on the hard disk. Exit gparted and reboot.

Kali Linux Installation Procedure

  1. The installation procedure from this point onwards is similar to a Kali Linux Hard Disk install, until the point of the partitioning. At this point, you need to select “Guided – use the largest continuous free space(rather than “Guided – the entire disk”) which got created earlier with gparted.
  1. You can carry on following the single boot Kali Linux install guide, except you will not have the option to select desktop environment or metapackages as you are using the live image. Once the installation is done, reboot.

You should be greeted with a GRUB boot menu, which will allow you to boot either into Kali Linux or Windows.

Post Installation

Now that you’ve completed installing Kali Linux, it’s time to customize your system.

The General Use section has more information and you can also find tips on how to get the most out of Kali Linux in our User Forums.

Time/System Clock

One thing that may be worth knowing about is that occasionally the time will get changed between the Windows and the Linux system. To fix this, we can do the following:

kali@kali:~$ timedatectl set-local-rtc 1 –adjust-system-clock

kali@kali:~$

 

To undo this we can simply do:

kali@kali:~$ timedatectl set-local-rtc 0 –adjust-system-clock

kali@kali:~$

 

BTRFS Install (Kali Unkaputtbar)

Have you ever wished you could travel back in time after deleting that all important customer report or installing a broken driver just before heading into the board meeting?

Well, you better read on, because now you can!

All it takes is to install Kali Linux version 2022.1 or newer with btrfs as file system and to enable snapshotting after installation.

You can even boot into any of your saved snapshots via the boot menu and easily rollback to a previous system state:

Content

Overview

btrfs is a modern Copy on Write (CoW) filesystem for Linux aimed at implementing advanced features such as pooling, snapshots, checksums, and integrated multi-device spanning. In particular, the snapshot support is what makes btrfs attractive for Kali installations on bare metal. Virtualization solutions such as VMware and VirtualBox provide their own snapshotting functionality and using btrfs in those environments is not really required.

The snapshotting strategy of this walk-through centres around a tool called “snapper” from our friends over at SUSE. Snapper transparently hooks into the apt workflow and automatically creates snapshots before and after any apt operation. This neat little feature allows to easily rollback a system after a botched upgrade.

To top things off, we added grub-btrfs by Antynea to automatically add a list of snapshots to the grub boot menu.

Snapper-gui by Ricardo Vieira is another great tool we use to make our lifes easier.

Installation Overview

Installing Kali Linux with snapshotting functionality is very similar to a standard installation except that we install it with btrfs as file system.

After the installation, we will install some tools and create a default configuration for snapper.

Partitioning Scheme

When selecting “btrfs” as file system, the installer will automatically create the following subvolume layout:

Mount Point         | Subvolume         | Description

————————————————————————-

/                   | @                 | The root filesystem incl. /boot

/.snapshots         | @.snapshots       | Snapper’s snapshot directory

/home               | @home             | User home directories

/root               | @root             | The root user’s home directory

/var/log            | @var@log          | Log files

/srv                | @srv              | Site-specific data served by this system

/tmp                | @tmp              | Temporary files

/usr/local          | @usr@local        | Tertiary hierarchy for local data

 

Kali Linux BTRFS Installation Steps

Kali Linux Installation Procedure
  1. To start your installation, boot with your chosen installation medium. You should be greeted with the Kali Boot screen. Choose Graphical Install.
  2. The installation steps are identical to a default Kali installation except changing “ext4” to “btrfs” as file system:

At the “Partition Disk” screen, choose “Guided – use entire disk”:

Click “Continue”:

Double-click on the / partition:

Choose “btrfs”:

Select “Done setting up the partition” and continue:

Select “Finish partitioning and write changes to disk” and continue with the installation.

  1. Login after installation and run the following commands in a terminal:

# Set a secure root password or you’ll struggle to log into a recovery shell

$ sudo passwd

 

# Install some essential tools

$ sudo apt update && sudo apt install btrfs-progs snapper snapper-gui grub-btrfs

 

# Create the snapper configuration for the root filesystem “/”

$ sudo cp /usr/share/snapper/config-templates/default /etc/snapper/configs/root

$ sudo sed -i ‘s/^SNAPPER_CONFIGS=\”\”/SNAPPER_CONFIGS=\”root\”/’ /etc/default/snapper

 

# Prevent “updatedb” from indexing the snapshots, which would slow down the system

$ sudo sed -i ‘/# PRUNENAMES=/ a PRUNENAMES = “.snapshots”‘ /etc/updatedb.conf

 

  1. We need to tweak the desktop managers to work in read only snapshots. Pick your DE from the following:

GNOME:

# Reconfigure gdm to allow booting into read-only snapshots

# GDM needs to have write access to “/var/lib/gdm3” and “/var/lib/AccountService” during login.

# We have to create additional subvolumes for them:

 

$ mount # Pick your main partition, </dev/sda1> in our example, replace </dev/sda1> it with yours

$ sudo mount </dev/sda1> /mnt

$ sudo btrfs subvolume create /mnt/@var@lib@gdm3

$ sudo btrfs subvolume create /mnt/@var@lib@AccountsService

 

$ sudo mv /var/lib/gdm3/* /var/lib/gdm3/.* /mnt/@var@lib@gdm3

$ sudo mv /var/lib/AccountsService/* /var/lib/AccountsService/.* /mnt/@var@lib@AccountsService/

 

$ sudo vi /etc/fstab # Add the following (substitute the <UUID> with yours)

 

# /var/lib/gdm3 was on /dev/sda1 during installation

UUID=<dc1ca012-9349-4fcf-b761-ca323379b019> /var/lib/gdm3   btrfs   defaults,subvol=@var@lib@gdm3 0       0

 

# /var/lib/AccountsService was on /dev/sda1 during installation

UUID=<dc1ca012-9349-4fcf-b761-ca323379b019> /var/lib/AccountsService   btrfs   defaults,subvol=@var@lib@AccountsService 0       0

 

# Reboot for the changes to take effect

$ sudo reboot

 

KDE:

# KDE works out of the box, just reboot and enjoy

$ sudo reboot

 

XFCE:

# Reconfigure lightdm to allow booting into read-only snapshots

$ sudo sed -i ‘s/^#user-authority-in-system-dir=false/user-authority-in-system-dir=true/’ /etc/lightdm/lightdm.conf

$

$ sudo reboot

 

  1. The first reboot will create the first automatic snapshot. Reboot again to find the new boot menu entry for this snapshot:

Congratulations, you have just installed a Kali system with automatic snapshotting functionality! Next, we will cover some basic usage examples.

Usage

Modify configurations

Out of the box Kali creates snapshots of the root directory to allow system rollbacks. Snapshots are automatically created during apt operations, at specified time intervals, and on every boot. The configuration can be changed via the “snapper-gui” tool. Just click on the little icon in the top left hand corner and select “Properties”:

Create additional configurations

To create snapshots of your home directory, you can create a new configuration using snapper-gui.

Click on “New” -> “Create Configuration”

Create a snapshot

To manually create a snapshot using snapper-gui, select the appropriate configuration tab (home in this case) and click “New” -> “Create Snapshot”

List snapshots

Snapshots are listed in the snapper-gui:

Alternatively, snapshots on all configurations can be viewed using the snapper command line tool:

$ sudo snapper list -a

 

Delete snapshots

The easiest way to delete a snapshot is by using the snapper command line tool:

sudo snapper delete <number-or-number-range>

Voilà, easy.

Now is probably the right time to flick through the snapper command line options via:

snapper –help

Rollback

To roll back to a previous snapshot we have to remember two things:

  • The root / of the file system has been installed in a subvolume /@” and not the root of the btrfs partition /
  • A snapshot is treated like just another subvolume except that they are read-only
  • You can easily boot into your read-only snapshots to find the one you want to roll-back to.

Thus all we have to do is mount the btrfs partition and replace the current root subvolume @ with the last snapshot. To be safe we’ll backup the current root (@) subvolume.

E.g.:

# get the device that contains your “/” subvolume and remember it for the next step:

mount | grep ‘subvol=/@)’

 

# mount your root partition (replace “/dev/sda2” with yours from above):

sudo mount /dev/sda2 -o subvol=/ /mnt

 

# Move the old root away:

sudo mv /mnt/@ /mnt/@_badroot

 

# Roll back to a previous snapshot by creating a read-write copy of it as “@””:

sudo btrfs subvolume snapshot /mnt/@.snapshots/XXXXX/snapshot /mnt/@

 

# That’s it, reboot:

sudo reboot -f

 

Diff

Snapper is chock-a-block with powerful features like diffs between snapshots:

Browse snapshots

You can even browse the content of snapshots:

Full recovery from an unbootable system

Boot into a last known good snapshot

Let’s assume that the last upgrade broke our machine. Every run of “apt install” creates to snapshots, one “pre” snapshot is created before the installation and one “post” snapshot is created after the installation.

To undo the last “apt upgrade”, we would boot into the last “pre” snapshot and check if everything is working again:

Now you can login to the snapshot.

Please note that the snapshot is read only and you might receive an error message from an applet or two after logging in. Just ignore that.

Have a look around ensure that this is what you would like to roll-back to.

Rollback

Remember that “/” itself is the subvolume “@”. To rollback to a snapshot, all we have to do is replace “@” with the snapshot we want.

  1. First we have to mount the physical partition that holds all our subvolumes. Let’s find it first

mount | grep ‘subvol=’

and then mount it (/dev/sda2 in this example:

sudo mount /dev/sda2 -o subvol=/ /mnt

If we list the content of that partition we can see all the subvolumes, including the one containing our snapshots:

  1. Before we replace the current root with our snapshot, let’s move “@” away just to be safe:

sudo mv /mnt/@ /mnt/@_old

  1. Now we can create a read-write snapshot of the current read-only snapshot (in this example we booted into the read-only snapshot “6” according to the query above):

sudo btrfs subvolume snapshot /mnt/@.snapshots/6/snapshot /mnt/@

And that’s all there is to it, now we can reboot as if nothing ever happened to our beautiful machine:

References

Deploying Kali over Network PXE Install

It is possible to boot and installing Kali Linux over the network, using Preboot eXecution Environment (PXE). There is a range of environments where this beneficial such as a single laptop install with no CDROM or USB ports, to enterprise deployments supporting pre-seeding of the Kali Linux installation.

By using a “slimed down” image, network booting (Netboot), it only has the essential packages in order for the setup to work. Everything else is pulled down during installation, making sure everything is fully up-to-date after the installation.

We will cover a few different ways of using PXE. The first way will be how to manually set up PXE with dnsmasq. The final way will utilize netbootxyz, which hosts the PXE files and uses a separate DNS server to properly direct computers.

Manually setting up a PXE Server with dnsmasq

First, we need to install dnsmasq which will provide the DHCP/TFTP service:

kali@kali:~$ sudo apt install -y dnsmasq

[…]

kali@kali:~$

 

In dnsmasq.conf, enable DHCP, TFTP and PXE booting and set the dhcp-range to match your environment (we are using 192.168.101.100-200). If needed you can also define your DNS servers (8.8.8.8 & 8.8.4.4) and gateway (192.168.101.1) with the dhcp-option directive as shown below:

kali@kali:~$ cat <<EOF | sudo tee /etc/dnsmasq.conf

interface=eth0

dhcp-range=192.168.101.100,192.168.101.200,12h

dhcp-boot=pxelinux.0

enable-tftp

tftp-root=/tftpboot/

dhcp-option=3,192.168.101.1

dhcp-option=6,8.8.8.8,8.8.4.4

EOF

kali@kali:~$

 

Now in our above example, we used /tftpboot/ for the home directory of TFTP, which we now need to create, as this will hold the Kali Linux Netboot image:

kali@kali:~$ sudo mkdir -pv /tftpboot/

mkdir: created directory ‘/tftpboot/’

kali@kali:~$

 

With the edits in place, the dnsmasq service needs to be restarted in order for the changes to take effect:

kali@kali:~$ sudo systemctl restart dnsmasq

kali@kali:~$

kali@kali:~$ sudo systemctl enable dnsmasq

kali@kali:~$

kali@kali:~$ sudo systemctl status dnsmasq

[…]

kali@kali:~$

 

Download Kali PXE Netboot Images

We can now download the Kali Netboot image we wish to serve. Please pick ONE of the images below, either 64-bit OR 32-bit:

# 64-bit:

sudo wget https://http.kali.org/kali/dists/kali-rolling/main/installer-amd64/current/images/netboot/netboot.tar.gz -P /tftpboot/

 

# 32-bit:

sudo wget https://http.kali.org/kali/dists/kali-rolling/main/installer-i386/current/images/netboot/netboot.tar.gz -P /tftpboot/

 

The last step is to extract the contents and do a little bit of house keeping:

kali@kali:~$ sudo tar -zxpvf /tftpboot/netboot.tar.gz -C /tftpboot

[…]

kali@kali:~$

kali@kali:~$ sudo rm -v /tftpboot/netboot.tar.gz

removed ‘/tftpboot/netboot.tar.gz’

kali@kali:~$

 

Configure Target to Boot From Network

With everything configured, you can now boot your target system and configure it to boot from the network. It should get an IP address from your PXE server and begin booting Kali Linux.

Depending on the manufacture, will depending on the keyboard shortcut required to bring up the boot menu. Common keys are: ESC, F2, F8 and F12:

Afterwards, select the network card:

If everything works right, you should shortly see a screen similar to the following. Please note, it may take a few seconds in order to get an IP address:

Finally, you should see the Netboot GRUB:

Troubleshooting

If you see either of the following screens, it could be due to the machine unable to get an IP address from the PXE service:

The first thing would be to check the status of dnsmasq:

kali@kali:~$ sudo systemctl status dnsmasq

[…]

     Active: active (running) since Wed 2023-06-07 13:48:15 BST; 17s ago

[…]

Jun 07 13:48:15 kali dnsmasq-dhcp[1960]: DHCP, IP range 192.168.101.100 — 192.168.101.200, lease time 12h

Jun 07 13:48:15 kali dnsmasq-tftp[1960]: TFTP root is /tftpboot/

Jun 07 13:48:15 kali dnsmasq[1960]: reading /etc/resolv.conf

Jun 07 13:48:15 kali dnsmasq[1960]: using nameserver 8.8.8.8#53

[…]

Jun 07 13:48:31 kali dnsmasq-dhcp[1960]: no address range available for DHCP request via eth0

lines 1-23/23 (END)

 

The line which sticks out here is:

no address range available for DHCP request via eth0

A possible reason for this is the IP range (192.168.101.100 -> 192.168.101.200) is outside of the range used by the interface (192.168.0.3):

kali@kali:~$ ip a

[…]

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

[…]

    inet 192.168.0.3/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0

[…]

kali@kali:~$

 

We can have a go at dynamically, generating the configuration:

kali@kali:~$ interface=eth0

kali@kali:~$

kali@kali:~$ network=$( ip -4 addr show dev ${interface} | grep -oP ‘(?<=inet\s)\d+(\.\d+){2}’ )

kali@kali:~$

kali@kali:~$ cat <<EOF | sudo tee /etc/dnsmasq.conf

interface=${interface}

dhcp-range=${network}.100,${network}.200,12h

dhcp-boot=pxelinux.0

enable-tftp

tftp-root=/tftpboot/

dhcp-option=3,$( ip -4 route show dev ${interface} | grep -oP ‘(?<=default\svia\s)(\d+(\.\d+){3})’ )

dhcp-option=6,8.8.8.8,8.8.4.4

EOF

kali@kali:~$

kali@kali:~$ sudo systemctl restart dnsmasq

kali@kali:~$

kali@kali:~$ sudo systemctl status dnsmasq

[…]

 

Please note, you will need to disable your existing DHCP service, else there will be a race in which service is able to response quicker.

Post Installation

Now that you’ve completed installing Kali Linux, it’s time to customize your system. The General Use section has more information and you can also find tips on how to get the most out of Kali Linux in our User Forums.

Auto Updating

One last thing we need to do if we want to use this system in the future is set up a cron job to pull in the new Netboot images regularly in case of kernel updates. We will create a simple script and set its permissions:

kali@kali:~$ sudo mkdir -pv /opt/pxe/

mkdir: created directory ‘/opt/pxe/’

kali@kali:~$

kali@kali:~$ cat <<‘EOF’ | sudo tee /opt/pxe/tftpboot.sh

#!/usr/bin/env sh

 

## Our desired path for the PXE image to be saved to

tftp=/tftpboot

 

## amd64 (64-bit) vs i386 (32-bit)

arch=amd64

 

## Complete remove and create the previous directory containing the PXE image

rm -rfv “${tftp:?}”/*

 

## Download the newest version

wget “https://http.kali.org/kali/dists/kali-rolling/main/installer-${arch}/current/images/netboot/netboot.tar.gz” -O “${tftp}/netboot.tar.gz”

 

## Exract

tar -zxpvf /tftpboot/netboot.tar.gz -C “${tftp}”

 

## Clean up

rm -v “${tftp}/netboot.tar.gz”

EOF

kali@kali:~$

kali@kali:~$ sudo chmod 0700 /opt/pxe/tftpboot.sh

kali@kali:~$

kali@kali:~$ sudo chown root: /opt/pxe/tftpboot.sh

 

As we are going to quickly make a new user, tftp and set both folders permissions:

kali@kali:~$ sudo adduser –system –home /opt/pxe/ tftp

adduser: Warning: The home dir /opt/pxe/ you specified already exists.

Adding system user `tftp’ (UID 117) …

Adding new user `tftp’ (UID 117) with group `nogroup’ …

adduser: The home directory `/opt/pxe/’ already exists.  Not touching this directory.

adduser: Warning: The home directory `/opt/pxe/’ does not belong to the user you are currently creating.

kali@kali:~$

kali@kali:~$ sudo chown -R tftp: /opt/pxe/ /tftpboot/

kali@kali:~$

 

The last item left is to setup a schedule task. We will use cron:

kali@kali:~$ sudo crontab -u tftp -e

[…]

0 5 * * 2 /opt/pxe/tftpboot.sh >/dev/null

kali@kali:~$

 

Now, every Tuesday at 05:00, our Netboot image should self-update!

Pre-seeding PXE

Pre-seed file

We can use the following pre-seed file to automatically install our Kali instance. Be sure to change package selection, user information, region information, and hard drive to match what you are using. Alternatively, should you want to be prompted for any of those, just comment out the line:

kali@kali:~$ cat <<‘EOF’ | sudo tee /opt/pxe/preseed.cfg

# Package selection

d-i pkgsel/include string kali-linux-default kali-desktop-xfce

 

# User information

d-i passwd/user-fullname string kali

d-i passwd/username string kali

d-i passwd/user-password password kali

d-i passwd/user-password-again password kali

 

# Region Information

d-i time/zone string US/Eastern

d-i debian-installer/locale string en_US

d-i debian-installer/language string en

d-i debian-installer/country string US

d-i debian-installer/locale string en_US.UTF-8

d-i keyboard-configuration/xkb-keymap select us

 

# Hard drive

d-i grub-installer/bootdev string /dev/sda

 

d-i netcfg/get_hostname string kali

d-i netcfg/get_domain string unnasigned-domain

tasksel tasksel/first multiselect standard

d-i mirror/country string enter information manually

d-i mirror/suite string kali-rolling

d-i mirror/codename string kali-rolling

d-i mirror/http/hostname string http.kali.org

d-i mirror/http/directory string /kali

d-i mirror/http/proxy string

d-i partman-auto/method string regular

d-i partman-auto-lvm/guided_size string max

d-i partman-auto/choose_recipe select atomic

d-i partman-partitioning/confirm_write_new_label boolean true

d-i partman/choose_partition select finish

d-i partman/confirm boolean true

d-i partman/confirm_nooverwrite boolean true

d-i partman-md/confirm boolean true

d-i partman-partitioning/confirm_write_new_label boolean true

d-i partman/choose_partition select finish

d-i partman/confirm boolean true

d-i partman/confirm_nooverwrite boolean true

d-i grub-installer/only_debian boolean true

d-i grub-installer/with_other_os boolean true

d-i finish-install/reboot_in_progress note

d-i apt-setup/services-select multiselect

d-i apt-setup/non-free boolean true

d-i apt-setup/contrib boolean true

d-i apt-setup/disable-cdrom-entries boolean true

d-i apt-setup/enable-source-repositories boolean false

d-i pkgsel/upgrade select full-upgrade

d-i passwd/root-login boolean false

d-i preseed/early_command string anna-install eatmydata-udeb

d-i pkgsel/update-policy select none

popularity-contest popularity-contest/participate boolean false

encfs encfs/security-information boolean true

encfs encfs/security-information seen true

console-setup console-setup/charmap47 select UTF-8

samba-common samba-common/dhcp boolean false

macchanger macchanger/automatically_run boolean false

kismet-capture-common kismet-capture-common/install-users string

kismet-capture-common kismet-capture-common/install-setuid boolean true

wireshark-common wireshark-common/install-setuid boolean true

sslh sslh/inetd_or_standalone select standalone

atftpd atftpd/use_inetd boolean false

EOF

kali@kali:~$

 

Pre-seed integration to initrd

To incorporate this into our initrd to automatically run we must do the following:

Please note, we are using 64-bit/AMD64.

kali@kali:~$ cd /tftpboot/debian-installer/amd64/

kali@kali:/tftpboot/debian-installer/amd64$

kali@kali:/tftpboot/debian-installer/amd64$ sudo gunzip initrd.gz

kali@kali:/tftpboot/debian-installer/amd64$

kali@kali:/tftpboot/debian-installer/amd64$ sudo cp -v /opt/pxe/preseed.cfg preseed.cfg

‘/opt/pxe/preseed.cfg’ -> ‘./preseed.cfg’

kali@kali:/tftpboot/debian-installer/amd64$

kali@kali:/tftpboot/debian-installer/amd64$ echo preseed.cfg | sudo cpio -H newc -o -A -F initrd

6 blocks

kali@kali:/tftpboot/debian-installer/amd64$ sudo gzip initrd

kali@kali:/tftpboot/debian-installer/amd64$

 

Now all that is left to-do, is boot from network, and select “Install” and watch the unattended setup progress!

Using netbootxyz to host our PXE files

To install and use netbootxyz we recommend to follow the official documentation. This will allow us to set up a server and use our existing DHCP server to point to it, rather than creating a new DHCP server, as well as having a web interface to manage items.

Kali Installation Sizes

Kali has a lot of customization that can be done during the package selection part of installation. Specifically, there are a total of 20 ways to configure your system during package selection. To help give an idea of what storage size someone should look to have for their preferred packages, we have created this documentation reference page. In general, a disk size of about 60GB will allow for any installation and provide a bit of extra storage for use. If you want a more specific answer, then keep reading!

For this page we are going to break down the installations into five sections, each representing what tool metapackages are selected. In each section, we are also going to list out all four desktop environment choices.

The following table shows the total size of the installation based on which metapackage is chosen. The largest possible installation is 35G, while the smallest possible installation is only 1.8G.

 

Bare-bones Kali

Kali traditionally has been solely recommended as a penetration testing distribution, and for good reason. However, through the years Kali has become more stable and evolved into something that users can use no matter what their reasoning is. While still primarily a penetration testing distribution, we accept that many users may not even be in the cybersecurity field. For those users wanting to install Kali, but may not need the tools or just want the UI, this guide is for you.

Installing a bare-bones Kali

To get a Kali without any tools is quite easy. We will be following the hard disk install for the most part. The important part is to select the following packages:

Of course, you can select whichever desktop environment you wish. It is worth mentioning now that KDE has great support for Wacom tablets! Be careful not to mix KDE with another desktop distribution however, as there are some bugs that can occur when this happens.

Now that we are installed and logged in, there are a few things we should do. Keep in mind, these should always be done, not just for a daily use case! Let’s first change the root user’s password:

kali@kali:~$ sudo su

[sudo] password for kali:

root@kali:/home/kali#

root@kali:/home/kali# passwd

New password:

Retype new password:

passwd: password updated successfully

 

root@kali:/home/kali#

 

After this we can make sure our system is up-to-date:

kali@kali:~$ sudo apt update && sudo apt full-upgrade -y

….

kali@kali:~$

kali@kali:~$ [ -f /var/run/reboot-required ] && sudo reboot -f

 

We can now finish off our setup by making sure kali-tweaks is configured properly:

kali@kali:~$ kali-tweaks

 

What we are looking for are changes required in ‘Hardening’, unchecking any options to make our system more secure.

VMs- VMware, VirtualBox, Hyper-V, Parallels, Proxmox & Vagrant

Installing VMware on Kali (Host)

You can install VMware workstation or player on Kali Linux, allowing you to use Virtual Machines (VMs) inside of Kali Linux. However if you wish to use Kali Linux as a virtual machine, you will want our Kali Linux Guest VMware guide.

VMs are great, as there are many reasons why to use them. One of the being, able to run multiple Operating Systems at the same time. You can have your host machine “untouched”, and then only interact with the guest VMs. Another is when something is going right, take a snapshot. When something goes wrong, revert back.

VMware Workstation & Fusion is a commercial software (there is VMware Player which is free but it is limited in features). There are various free or open source solution (such as VirtualBox, QEMU, KVM/Xen with virt-manager).

Preparation

Before trying to install VMware, please make sure your version of Kali Linux is up-to-date, and if required, reboot the machine:

kali@kali:~$ sudo apt update

[…]

kali@kali:~$

kali@kali:~$ sudo apt full-upgrade -y

[…]

kali@kali:~$

kali@kali:~$ [ -f /var/run/reboot-required ] && sudo reboot -f

kali@kali:~$

 

Download

To start with, you will need to download VMware. You can do this by going to VMware’s download page. At the time of writing, the latest version is 15.5.1-15018445.

Alternatively, you can do the following command line method:

kali@kali:~$ sudo apt install -y curl

[…]

kali@kali:~$

kali@kali:~$ curl -A “Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0” \

 -o Downloads/vmware.bundle \

 -L https://www.vmware.com/go/getworkstation-linux

kali@kali:~$

kali@kali:~$ file Downloads/vmware.bundle

Downloads/vmware.bundle: a bash script executable (binary data)

kali@kali:~$

kali@kali:~$ ls -lah Downloads/vmware.bundle 

-rw-r–r– 1 kali kali 514M Oct  3 02:13 Downloads/vmware.bundle

kali@kali:~$

 

When everything is up-to-date, and ready to go, make sure the file is executable and then call it:

kali@kali:~$ chmod +x ~/Downloads/vmware.bundle

kali@kali:~$

kali@kali:~$ sudo ~/Downloads/vmware.bundle

Extracting VMware Installer…done.

Installing VMware Workstation 17.0.2

    Configuring…

[######################################################################] 100%

Installation was successful.

kali@kali:~$

 

We can see we have installed VMware Workstation 17.0.2. The version number may be needed later on.

After the installer is installed, you should be able to just run vmware to continue setup:

kali@kali:~$ vmware

kali@kali:~$

 

At this point, you should be be straight forward, often just clicking through.

Setup

The first part may be VMware Kernel Modules.

If vmware wasn’t called with superuser privileges, you may be prompted for a password.

At this point, it may not install correctly, and get the error message: Unable to install all modules. See log /tmp/vmware-kali/vmware-*.log for details. (Exit code 1). This is often due to Kali’s kernel being newer than what VMware is expecting.

Looking at the log may help with troubleshooting the issue as well as the guide at the end of this post, vmware-host-modules.

You will need to accept the legal agreement.

You may wish for it VMware to check for any updates.

You may wish to join “VMware Customer Experience Improvement Program”.

Enter the current username.

Enter a location for Shared VMs (this is different to each users own VMs).

Enter a port for HTTPS access

If you have a product key, you can enter it now, else it will be a trial for 30 days.

You may be once again prompt for superuser privileges if you didn’t execute the setup file with it.

The final screen should look like this.

If you now wish, you are able to install Kali Linux in a VMware VM (on Kali Linux).

Troubleshooting

libaio missing

If you see the following problem, upon trying to run vmware.

Try installing the libaio1 package:

kali@kali:~$ vmware

[AppLoader] Use shipped Linux kernel AIO access library.

An up-to-date “libaio” or “libaio1” package from your system is preferred.

kali@kali:~$

kali@kali:~$ sudo apt install -y libaio1

[…]

kali@kali:~$

 

Then the next time you start vmware, it should of gone away.

Missing Packages

From time to time, things may not go right. There could be a number of reasons why VMware may not install. The first thing to check would be you have all the necessary packages installed:

kali@kali:~$ sudo apt install -y build-essential linux-headers-$( uname -r ) vlan libaio1

[…]

kali@kali:~$

 

Try running vmware again, and see if now setup continues.

Too Newer Kernel

A common issue is because the setup file for VMware isn’t supporting the latest kernels, which could be an issue as Kali Linux is a rolling distribution and receives frequent updates. If this is the case, we can patch VMware modules to support this:

kali@kali:~$ sudo apt install -y git

[…]

kali@kali:~$

kali@kali:~$ sudo git clone \

 -b workstation-$( grep player.product.version /etc/vmware/config | sed ‘/.*\”\(.*\)\”.*/ s//\1/g’ ) \

  https://github.com/mkubecek/vmware-host-modules.git \

  /opt/vmware-host-modules/

[…]

kali@kali:~$

kali@kali:~$ cd /opt/vmware-host-modules/

kali@kali:/opt/vmware-host-modules$ sudo make

kali@kali:/opt/vmware-host-modules$

kali@kali:/opt/vmware-host-modules$ grep -q pte_offset_map ./vmmon-only/include/pgtbl.h && \

  sudo sed -i ‘s/pte_offset_map/pte_offset_kernel/’ ./vmmon-only/include/pgtbl.h

kali@kali:/opt/vmware-host-modules$

kali@kali:/opt/vmware-host-modules$ sudo make install

kali@kali:/opt/vmware-host-modules$

 

Try now to install VMware, by doing vmware.

If you are still having issues, you may need to restart your Kali Linux before trying one more final time.

vmware-host-modules + Kernel Updates

As VMware has various kernel modules, we need to make sure they are kept up-to-date and re-patched when Kali Linux’s kernel gets updated. This can be achieved by the steps in the following guide:

kali@kali:~$ sudo tee /etc/kernel/install.d/99-vmmodules.install << EOF

#!/bin/bash

 

export LANG=C

 

COMMAND=”\$1″

KERNEL_VERSION=”\${2:-\$( /usr/bin/uname -r )}”

BOOT_DIR_ABS=”\$3″

KERNEL_IMAGE=”\$4″

 

VMWARE_VERSION=\$(/usr/bin/grep player.product.version /etc/vmware/config | /usr/bin/sed ‘/.*\”\(.*\)\”.*/ s//\1/g’)

 

ret=0

 

{

    [ -z “\${VMWARE_VERSION}” ] && exit 0

 

    /usr/bin/git clone -b workstation-“\${VMWARE_VERSION}” https://github.com/mkubecek/vmware-host-modules.git /opt/vmware-host-modules-“\${VMWARE_VERSION}”/

    cd /opt/vmware-host-modules-“\${VMWARE_VERSION}”/

 

    /usr/bin/make VM_UNAME=”\${KERNEL_VERSION}”

    /usr/bin/make install VM_UNAME=”\${KERNEL_VERSION}”

 

    ((ret+=\$?))

 

} || {

    echo “Unknown error occurred.”

    ret=1

 

}

 

exit \${ret}

EOF

kali@kali:~$

 

Still can’t start up VMware? vmware-modconfi

If VMware is unsuccessful, we can dig a little further by running the following:

kali@kali:~$ sudo vmware-modconfig –console –install-all

[…]

kali@kali:~$

kali@kali:~$ sudo vmware-modconfig –console –install-all 2>&1 | grep error

[…]

kali@kali:~$

 

Looking at the output, may either give us the exact issue, or at the very least something to search the Internet for.

Can’t Power on a Virtual Machine

You may also face the following issues, when trying to power on a VM.

  • Failed to initialize monitor device
  • Could not open /dev/vmmon: No such file or directory. Please make sure that kernel module ‘vmmon’ is loaded
  • Unable to change virtual machine power state: Transport (VMDB) error -14: Pipe connection has been broken.

The quickest solution to fix these would be to reboot Kali Linux and try again.

Installing VMware on Apple Silicon (M1/M2/M3) Macs (Host)

You need to be running at least VMware Fusion 13.x.x.

Due to a limitation of the VMware updater software, if you are on an earlier version, it will report that there are no updates available. You need to go to VMware’s website and download and install manually.

We will first go to Get Fusion and select whether we would like to buy the Pro version, or start free.

After creating an account/registering with VMware this will allow you to request a personal use license for VMware Fusion.

Version 13.x.x Download.

Then install by double clicking.

Next download the “installer Image” from (https://www.kali.org/get-kali/#kali-installer-images). Just make sure to choose the Apple Silicon (ARM64) Image.

Take note of the directory where the .iso is saved, as we will need it for installing in VMware Fusion.

After installing VMware Fusion 13, and opening the application for the first time, it forces the user to create a new machine. Once you’ve created your machine, if you would like to create another you will need to select “create new machine” fomr the options.

Open the directory in which the .iso was saved after downloading. Drag the freshly downloaded .iso to the window and begin the installation (Debian 12.x 64-bit Arm). We can also just simply click on “install from disk or image”, or “use another disc, or disc image” option from the VMware Fusion application window.

Installing VirtualBox on Kali (Host)

You can install VirtualBox on Kali Linux, allowing you to use virtual machines (VMs) inside of Kali Linux. However if you are wanting to install Kali Linux as a VM, you want our Kali Linux Guest VirtualBox guide.

VMs are great. There are many upsides with using them. One of the being, able to run multiple Operating Systems (OSs) at the same time. You can have your host machine “untouched”, and then only interact with the guest VMs. Another is when something is going right, take a snapshot. When something goes wrong, revert back.

VirtualBox is free and open source. There are a few other software such as QEMU, KVM/Xen with virt-manager. Then there is also VMware Workstation & Fusion, which is a commercial software (there is VMware Player which is free but it is limited in features).

VirtualBox is officially available in kali-rolling repositories.

There are two ways to install virtualbox: 1.From Kali repositories. 2.From Oracle repository.

Preparation

Before trying to install VirtualBox, please make sure your version of Kali Linux is up-to-date, and if required, reboot the machine:

kali@kali:~$ sudo apt update

[…]

kali@kali:~$

kali@kali:~$ sudo apt full-upgrade -y

[…]

kali@kali:~$

kali@kali:~$ [ -f /var/run/reboot-required ] && sudo reboot -f

kali@kali:~$

 

1. From Kali Linux repositories

Add contrib component to /etc/apt/sources.list.

deb http://http.kali.org/kali kali-rolling main contrib non-free

 

Update the list of available packages:

kali@kali:~$ sudo apt update

 

Install virtualbox:

kali@kali:~$ sudo apt install virtualbox

 

The extension pack can be installed through:

kali@kali:~$ sudo apt install virtualbox-ext-pack

 

2. From Oracle Virtualbox third-party repository

Preparation

Before trying to install VirtualBox, please make sure your version of Kali Linux is up-to-date, and if required, reboot the machine:

kali@kali:~$ sudo apt update

[…]

kali@kali:~$

kali@kali:~$ sudo apt full-upgrade -y

[…]

kali@kali:~$

kali@kali:~$ [ -f /var/run/reboot-required ] && sudo reboot -f

kali@kali:~$

 

Download

The first thing we are going to do is import VirtualBox’s repository key:

kali@kali:~$ curl -fsSL https://www.virtualbox.org/download/oracle_vbox_2016.asc|sudo gpg –dearmor -o /etc/apt/trusted.gpg.d/oracle_vbox_2016.gpg

[…]

kali@kali:~$ curl -fsSL https://www.virtualbox.org/download/oracle_vbox.asc|sudo gpg –dearmor -o /etc/apt/trusted.gpg.d/oracle_vbox.gpg

[…]

kali@kali:~$

 

We then move onto adding VirtualBox’s repository. We add this to a separate file, so it does not interfere with Kali Linux’s main repository. We also will be making sure to state where the keyring is at so the files can be properly signed. Our CPU architecture is amd64. You may need to alter the example below if yours is different.

One thing to bear in mind, Kali Linux is based on Debian, so we need to use Debian’s current stable version (even though Kali Linux is a rolling distribution). At the time of writing, its “bullseye”:

kali@kali:~$ echo “deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian bullseye contrib” | sudo tee /etc/apt/sources.list.d/virtualbox.list

kali@kali:~$

 

As we have altered our network repository, we need to re-build the cache:

kali@kali:~$ sudo apt update

[…]

kali@kali:~$

 

As VirtualBox has various kernel modules (e.g. vboxdrv, vboxnetflt and vboxnetadp), we need to make sure they are kept up-to-date when Kali Linux’s kernel gets updated. This can be achieved using dkms:

kali@kali:~$ sudo apt install -y dkms

[…]

kali@kali:~$

 

Setup

Now its time to install VirtualBox itself (along with its Extension Pack to expand VirtualBox’s advanced features):

kali@kali:~$ sudo apt install -y virtualbox virtualbox-ext-pack

[…]

kali@kali:~$

 

When prompted, read and accept the license.

You can now find VirtualBox in the menu or start it via the command line:

kali@kali:~$ virtualbox

kali@kali:~$

 

If you now wish, you are able to install Kali Linux in a VirtualBox VM (on Kali Linux).

Kali inside Parallels (Guest VM)

This guide is about virtualizing Kali Linux inside of Parallels, allowing you to have a Kali VM. This is a great way to use Kali, as it is completely separate from the host, allows you to interact with other VMs (as well as the host, and other machines on the network), and allows you to revert to snapshots.

Wizard

Upon starting up Parallels, select the Plus symbol.

This will launch the Installation Assistant

Now we choose Install Windows or another OS from a DVD or image file

On this screen, we select the Kali Linux image to use to install from. We select “Choose Manually”, and navigate to the location of the ISO that we downloaded. For more information on what image to download, we have written up a guide.

Either drag the ISO file or choose Select a file… to navigate to the downloaded ISO.

Parallels does not recognize the OS on the ISO, so we will choose Continue to proceed anyway.

Once we have clicked Continue, we want to choose Ubuntu from the drop down list. Normally we would choose Debian however, there is a bug with the Parallels Tools, that does not occur when using Ubuntu.

The next screen is “Name and Location”, which is where you name the VM. This name is also used as the filename (such as the configuration, hard disk and snapshot – which is not changed from this point).

We also want to mark the check box for Customize settings before installation

We are keeping it generic in this guide, by using “Kali Linux” (as Kali Linux is a rolling distribution, and we update Kali Linux).

This will bring up the Configuration screen for the Virtual Machine.

The next screen is “Processors”. Here we can start to define how many resources we give the VM. Kali will be able to perform more tasks simultaneously and quicker if it is allocated more resources. We select “2 processors” and “** 2048 MB ** “, giving a total of 2 cores and 2GB of RAM. You may wish to use more or less depending on your system requirements.

Now we want to choose Hard Disk so we can resize the hard disk.

Select the Properties button

And reduce the size to 32GB. You may wish to leave it at 64GB, or increase it, depending on your system requirements.

Click Apply and you will be prompted to Continue

Click Continue

We can now close the Kali Linux Configuration window, and be back at the Installation Assistant screen.

After all this is done, we save, start up the VM, and then continue installing Kali Linux as we normally would for a bare metal install.

Kali inside Vagrant (Guest VM)

Vagrant is, according to their website, “a tool for building and managing virtual machine environments in a single workflow.” This is all controlled through a single configuration file that has a large amount of configurations to tweak the virtual machine (VM) to your needs. We will look at what the default configuration file is doing, but much more than that is beyond the scope of this page.

System Setup

In order to properly use Vagrant we need two things. Vagrant itself, and a supported hyper-visor. The Kali Vagrant file supports two, VirtualBox and VMware.

We first will download Vagrant.

If we are on Windows, we will need to follow the previous link and download the proper version (open Settings then go to About, download amd64 if 64 bit or 686 if 32 bit). This will also work for macOS, simply download Vagrant and complete setup.

If we are on a Debian-based Linux system (like Kali Linux), we likely have the vagrant package available for download:

kali@kali:~$ sudo apt search vagrant

Sorting… Done

Full Text Search… Done

[…]

vagrant/kali-dev,kali-dev,kali-rolling,kali-rolling,now 2.2.19+dfsg-1 all [installed]

  Tool for building and distributing virtualized development environments

 

vagrant-cachier/kali-dev,kali-dev,kali-rolling,kali-rolling 1.2.1-3.1 all

  share a common package cache among similar VM instances

 

vagrant-hostmanager/kali-dev,kali-dev,kali-rolling,kali-rolling 1.8.9-1.1 all

  Vagrant plugin for managing /etc/hosts on guests and host

 

vagrant-libvirt/kali-dev,kali-dev,kali-rolling,kali-rolling,now 0.8.0-1 all [installed,automatic]

  Vagrant plugin that adds an Libvirt provider to Vagrant

 

vagrant-lxc/kali-dev,kali-dev,kali-rolling,kali-rolling 1.4.3-2 all

  Linux Containers provider for Vagrant

 

vagrant-mutate/kali-dev,kali-dev,kali-rolling,kali-rolling 1.2.0-4.1 all

  convert vagrant boxes to work with different providers

 

vagrant-sshfs/kali-dev,kali-dev,kali-rolling,kali-rolling 1.3.6-1 all

  vagrant plugin that adds synced folder support with sshfs

kali@kali:~$

 

Otherwise, we should follow the instructions on Vagrant’s download page.

We next need to download a hypervisor. For the purposes of this guide we will download the free VirtualBox. If we are on Windows or macOS we can click the respective download link and complete setup. Otherwise, we can look for our distribution on the Linux Hosts page. If we are using Kali Linux, there is already documentation we can follow.

Using Vagrant

Now that we have our hypervisor and Vagrant installed, we can pull our first configuration file.

We must be in a command line and create a new folder/directory that is empty. For this guide we will be using a Kali Linux host system, however the commands that start with vagrant will be the same no matter what host is being used:

kali@kali:~/vagrant$ vagrant init kalilinux/rolling

A `Vagrantfile` has been placed in this directory. You are now

ready to `vagrant up` your first virtual environment! Please read

the comments in the Vagrantfile as well as documentation on

`vagrantup.com` for more information on using Vagrant.

 

kali@kali:~/vagrant$

kali@kali:~/vagrant$ cat Vagrantfile | grep -v ‘#’

 

Vagrant.configure(“2”) do |config|

 

  config.vm.box = “kalilinux/rolling”

 

end

 

kali@kali:~/vagrant$

 

We can see it is a very minimal configuration file, however this will start up a VM with the latest release of Kali Linux and take up approximately 10GB after being downloaded and started.

To start this machine, we will run the following command:

kali@kali:~/vagrant$ vagrant up

Bringing machine ‘default’ up with ‘virtualbox’ provider…

==> default: Box ‘kalilinux/rolling’ could not be found. Attempting to find and install…

    default: Box Provider: virtualbox

    default: Box Version: >= 0

==> default: Loading metadata for box ‘kalilinux/rolling’

    default: URL: https://vagrantcloud.com/kalilinux/rolling

==> default: Adding box ‘kalilinux/rolling’ (v2024.1.1) for provider: virtualbox

    default: Downloading: https://vagrantcloud.com/kalilinux/boxes/rolling/versions/2024.1.1/providers/virtualbox.box

==> default: Successfully added box ‘kalilinux/rolling’ (v2024.1.1) for ‘virtualbox’!

[…]

==> default: Machine booted and ready!

==> default: Checking for guest additions in VM…

==> default: Mounting shared folders…

    default: /vagrant => /home/morales/vagrant

 

kali@kali:~/vagrant$

 

kali@kali:~/vagrant$ vagrant ssh

Linux kali 5.16.0-kali7-amd64 #1 SMP PREEMPT Debian 5.16.18-1kali1 (2022-04-01) x86_64

 

The programs included with the Kali GNU/Linux system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.

 

Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent

permitted by applicable law.

kali@kali:~$

kali@kali:~$ exit

 

kali@kali:~/vagrant$

 

kali@kali:~/vagrant$ vagrant halt

==> default: Attempting graceful shutdown of VM…

 

kali@kali:~/vagrant$

 

If we want to tweak our configuration file we can do something like the following:

# -*- mode: ruby -*-

# vi: set ft=ruby :

 

Vagrant.configure(“2”) do |config|

  config.vm.box = “kalilinux/rolling”

 

  # Create a forwarded port

  config.vm.network “forwarded_port”, guest: 80, host: 8080

 

  # Create a private network. In VirtualBox, this is a Host-Only network

  config.vm.network “private_network”, ip: “192.168.33.10”

 

  # VirtualBox specific settings

  config.vm.provider “virtualbox” do |vb|

    # Hide the VirtualBox GUI when booting the machine

    vb.gui = false

 

    # Customize the amount of memory on the VM:

    vb.memory = “4096”

  end

 

  # Provision the machine with a shell script

  config.vm.provision “shell”, inline: <<-EOF

    sudo apt update

    sudo apt install -y crowbar

  EOF

end

 

Which we can then load into a running Vagrant instance by running the following command:

kali@kali:~$ vagrant reload

kali@kali:~$

 

If we want to re-provision our VM, which normally only runs the first time the machine boots, we can do one of the following commands:

$ vagrant provision  # provision the powered on VM

$ vagrant up –provision  # when VM is powered off, power it on then provision

$ vagrant reload –provision  # reboot the VM then provision

 

There are a lot more configuration options that can be found in Vagrant’s docs.

Kali inside VMware (Guest VM)

This guide is about virtualizing Kali Linux inside of VMware, allowing you to have a Kali VM. This is a great way to use Kali, as it is completely separate from the host, allows you to interact with other VMs (as well as the host, and other machines on the network), and allows you to revert to snapshots.

If you are trying to install VMware on Kali Linux (as a host), please see our guide.

The guide below is what we use to generate our pre-made Kali Linux VMware images. You may alter this to your needs. We always generate the images using the latest version of VMware Workstation, as Player and Fusion don’t have the same level of functionally and controls over settings.

You will need to enable virtualization in your BIOS/UEFI for (e.g. Intel VT-x/AMD-V)

Wizard

Upon starting up VMware Workstation, select “Create a New Virtual Machine”.

When you have the option, select “Custom (advanced)” for the Virtual Machine Configuration, as this will allow us to have more control over the creation of the VM.

The next screen is “Virtual Machine Hardware Compatibility”, which we use “Workstation 8.x”.

This allows for more users to benefit from Kali Linux out of the box (without having to edit the .vmx file to downgrade). If you are using a later version of VMware than v8, upon start up, VMware will prompt about upgrading the VM. This will remove any limitations caused by older VMware profiles. However, most users do not have their Kali Linux VM using all these extra resources (see screenshot below), so they wouldn’t benefit from having the latest profile, which is why we ship with a older profile.

On this screen, we select the Kali Linux image to use to install from. We select “Browse”, and navigate to the location of the ISO that we downloaded. For more information on what image to download, we have written up a guide.

When you see the “Guest Operating System” screen, select “Linux”, and then the latest version of Debian for the version (as Kali is based on Debian). In this example, its Debian 10. We are going to be use the x64 image to install Kali, so we have selected 64-bit.

The next screen is “Virtual Machine Name”, which is where you name the VM. This name is also used as the filename (such as the configuration, hard disk and snapshot – which is not changed from this point).

We are keeping it generic in this guide, by using “Kali Linux” (as Kali Linux is a rolling distribution, and we update Kali Linux). However for our releases, we use the version number in the name as it is a fixed release (kali-linux-YYYY.N-vmware-ARCH. Example: kali-linux-2024.1-vmware-amd64).

The next screen is “Processors”. Here we can start to define how many resources we give the VM. Kali will be able to perform more tasks simultaneously and quicker if it is allocated more resources. We select “2 processors” and “2 cores per processors”, giving a total of 4 cores. You may wish to use more or less depending on your system requirements.

“Memory” is the next section, where we can define how much RAM to use. Again, the higher amount of RAM, the more applications can be open and at increased performance. Various tools inside of Kali can be demanding of resources. When we make the general VMs, we select 2GB (2048 MB) for RAM, but we often increase this for our personal machines as we have high-performing devices with spare RAM which Kali can utilize.

We are then presented with “Network Connection”. We default to using a NAT connection. However, this can easy be altered (even when the VM is powered on). This allows for Kali VM to talk to the Internet, as well as the rest of the LAN connection, without it taking up an additional IP address. The downside to this is it will not be able to receive reverse shells (without port forwarding inside of VMware).

Next is “I/O Controller Types”. We accept the default value of “LSI Logic”.

Next is “Virtual Disk Type”. We accept the default value of “SCSI”

The following screen is “Disk”, which allows us to “create a new virtual disk”

This screen below, “Disk Size”, allows us to define how large the virtual hard disk will be. We use “80 GB” for our VMs.

We also don’t have it in a single file, but instead “Split virtual disk into multiple files”. The VM hard disk will grow over time, to the maximum size, as we do not enable the “Allocate all disk space”.

It is possible to increase/decrease the hard disk after the VM has been created, however, if you have installed Kali, you’ll need to then also grow or shrink the partition for the space to reflect that.

When it comes to the “Disk File” screen, we accept the default value, which has been defined from our VM name earlier in the setup process.

We are then presented the final screen for the VM setup wizard, which gives us an overview of the settings we picked.

We are happy with what’s shown to us, so we then press “Finish”. If you try and “Customize Hardware” at this stage, before the VM is fully created, not every setting is visible.

If this is the first time using the wizard, you may have the following prompt explaining how installing “VMware tools” will give you a better experience when using the VM.

After reading and understanding the page, you may wish to tick the “Don’t show this page again”, before pressing close.

Edit Settings

Before we start up the VM, we now edit its settings, by pressing “Edit virtual machine settings”.

We do not have a use for a printer, so we remove it. Navigate to the “Printer” section, and then press “Remove”.

You may wish to edit the “USB” settings to alter how USB devices behave. Here we have disabled “Automatically connect new USB devices(may not have the option depending on your VMware version) and enabled “Show all USB input devices”.

Another item to point out is in the “Display” section. Make sure that “Accelerated 3D graphics” is disabled, as people have reported that causes issues.

We then move over to the “Options” tab, and move down to “Power”. We choose to enable “Report battery information to guests”, as it is a handy thing for users who use Kali on a laptop/notebook.

In “Shared folders”, we select “Always enable”. At this stage, do not share any paths, as some users may not wish for it.

The final option we alter is “VMware Tool”, where we enable “Synchronize guest time with host”.

After all this is done, we save, start up the VM, and then continue installing Kali Linux as we normally would for a bare metal install.

During Kali Linux setup process, the install wizard should detect if its inside a VM. If it is, should then automatically install any additional tools (such as open-vm-tools) to give a better user experience. If you want to manually re-install it, you can see our VMware Guest Tools Guide.

Import Pre-Made Kali VMware VM

Importing the Kali VMware image is very easy.

We first need to extract the VMware image:

kali@kali:~$ 7z x kali-linux-2024.1-vmware-amd64.7z

[…]

kali@kali:~$

 

If we are using Windows we can instead use the official 7z app. Note if we are on Windows 11 the option will be hidden behind the context menu “Show more options”.

We then launch VMware:

From here we will be wanting to select ‘Open a Virtual Machine’. We then navigate to the location our VM is downloaded and find the .vmx file:

We select this then we are able to continue forward:

We can verify the settings that will be set here, and if we need to change any we can. Once we are happy we can select boot the VM and use it as normal. Remember the default login is kali for the user and kali for the password!

Kali inside VirtualBox (Guest VM)

This guide is about virtualizing Kali Linux inside of VirtualBox, allowing you to have a Kali VM. This is a great way to use Kali, as it is completely separate from the host, allows you to interact with other VMs (as well as the host machine and other machines on the network), and allows you to revert to snapshots.

You may wish to follow our other guide if you are trying to install VirtualBox on Kali Linux (as a host).

The guide below is what we use to generate our pre-made Kali Linux VirtualBox images. You may alter this to your needs. We always generate the images using the latest version of VirtualBox.

You may need to enable virtualization in your BIOS/UEFI for (e.g. Intel VT-x/AMD-V)

Wizard

Upon starting up VirtualBox, select “New” (Machine -> New).

The next screen is “Name and operating system” which is where you name the VM. This name is also used in any filenames (such as the configuration, hard disk and snapshot – which isn’t changed from this point).

We are keeping it generic in this guide (as Kali is a rolling distribution, and we update it), however for our releases, we use the version number in the name as it is a fixed release (kali-linux-YYYY.N-vbox-ARCH. Example: kali-linux-2024.1-vbox-amd64).

For the “Type”, we set it as Linux. For the “Version”, we are going to be using the x64 desktop image, so we are going to select Debian (64-bit).

“Memory size” is the next section, where we can define how much RAM to use. Again, the higher the amount of RAM, the more applications can be open and at increased performance. Various tools inside of Kali can be demanding of resources. When we make the general VMs, we select 2048 MB (2GB) for RAM, but we often increase this for our personal machines as we have high-performing devices with spare RAM which Kali can utilize.

This screen below, “Hard disk”, allows us to Create a new virtual disk now.

For the “Hard disk file type”, we select VDI (VirtualBox Disk Image) (and its the default option).

For the following screen, “Storage on physical hard disk”, we go with the default option of Dynamically allocated.

Now with “File location and size”, we can now define how large the virtual hard disk will be. We use 80.00 GB for our VMs.

After clicking on “Create”, the wizard is complete.

Now we click on “Settings”, to customize the VM further.

In “General” -> “Advanced”, we make sure to set “Shared Clipboard” to bidirectional, as well as “Drag’n’Drop” to bidirectional

In “System” -> “Motherboard”, we change the “Boot Order” to make sure Hard Disk is top and Optical is the second. Everything else is disabled.

In “System” -> “Processor”, we increase the “Processor(s)” to be 2.

At the same time, we also enable “Extended Features” for Enable PAE/NX.

In “Display” -> “Screen”, we make sure to have “Video Memory” set to 128 MB

Another item to point out is to make sure that “Accelerated 3D graphics” is disabled, as people have reported that causes issues.

The final settings view looks like the following:

When we are ready to go, press “Start”.

The first time we run it, we will get a prompt saying do we wish to mount an image to use as a “start-up disk”. We want to use our Kali image, rather than a physical drive, so we select the icon to the side of the drop down.

A new pop up will open, “Optical Disk Selector”. We will now press “Add”, then navigate to where our ISO is located.

After pressing “Open”, we can see its been added, so we make sure its selected and press “Choose”.

All that is left now to do is press “Start”.

After all this is done, we save, start up the VM, and then continue installing Kali Linux as we normally would for a bare metal install.

During Kali Linux setup process, the install wizard should detect if its inside a VM. If it is, should then automatically install any additional tools (such as virtualbox-guest-x11) to give a better user experience. If you want to manually re-install it, you can see our VirtualBox Guest Guide.

Import Pre-Made Kali VirtualBox VM

Importing the Kali VirtualBox image is very easy.

We first need to extract the VirtualBox image:

kali@kali:~$ 7z x kali-linux-2024.1-virtualbox-amd64.7z

[…]

kali@kali:~$

 

If we are using Windows we can instead use the official 7z app.

We then launch VirtualBox:

From here we will be wanting to select ‘Add’. We then navigate to the location our VM is downloaded and find the .vbox file:

We select this then we are able to continue forward:

We can verify the settings that will be set here, and if we need to change any we can. Once we are happy we can select boot the VM and use it as normal. Remember the default login is kali for the user and kali for the password!

Kali inside Hyper-V (Guest VM)

For most Windows users Hyper-V is already enabled. However, in case it isn’t enabled on your system you can follow one of the following docs pages from Microsoft:

After we enable Hyper-V we can create a new VM very easily. We first need to download an installer iso. Then we can boot Hyper-V:

We will need to select our computer on the left-hand side under ‘Hyper-V Manager’:

We can then select ‘Quick Create…’ on the right-hand side:

We will have to configure some things on this screen. We first be sure to have selected ‘Local installation source’ and then select our iso after selecting ‘Change installation source…’. After this we can de-select the option ‘This machine will run Windows’ and can also use the drop-down ‘More options’ menu to name our virtual machine.

Once we are happy we can select ‘Create Virtual Machine’ and wait for it to finish. We will then see this screen:

From here we can either select ‘Connect’ if we are confident in Windows’s selections for options, or we can select ‘Edit Settings…’:

In the case of this machine, the only change needed was for the number of virtual processors. We dropped it down from 6 to 2. We are then ready to connect to our VM and continue setup like normal

Import Pre-Made Kali Hyper-V VM

Importing the Kali Hyper-V image is very easy.

We first need to extract the Hyper-V image. For that we need to use the official 7z app. Note if we are on Windows 11 the option will be hidden behind the context menu “Show more options”.

We just unzipped a directory named kali-linux-<VERSION>-hyperv-amd64. Then we double-click on the file install-vm.bat file. If we’re not administrator, we will get a popup window asking for approval, we click Yes:

After approving the popup, a console appears, and the script run a series of steps in order to setup the Kali Linux Virtual Machine. If all goes well, we should see the following screen:

We then launch the Hyper-V Manager, right-click on the Kali VM, click Start, then right-click again and click Connect. We should see the usual Kali login screen, or rather, just have a glimpse of it, before a popup window appear in the foreground:

We click Connect, and a new login screen appears. The default credentials are kali and kali as usual:

That’s it! We are now logged in our Kali VM!

A brief technical note: we are connected over XRDP. This is the so-called Enhanced Session Mode, we can see that by hovering over some buttons on top:

Copying and pasting from host to guest, and the other way round, should work out of the box. File sharing as well. However drag and drop doesn’t work, as well as screen resizing. See the section below for more details.

Troubleshooting and extra tips

Moving the Virtual Hard Disk

At this point, we have a Kali Linux VM up and running. However, we can’t move the Virtual Hard Disk (ie. the file named kali-linux-<VERSION>-hyperv-amd64.vhdx) anymore, as it’s linked to the Virtual Machine. Or, at least, I strongly suppose that we can’t do that…

It seems that Hyper-V usually stores its Virtual Hard Disks at C:\ProgramData\Microsoft\Windows\Virtual Hard Disks\. So if we like to keep our computer neat and tidy, we can restart the procedure above, except that we should move the unzipped files to this location before running the script install-vm.bat.

Changing the screen resolution

At this point it seems that the screen resolution must be set at boot time, hence it needs to be configured in the kernel cmdine. To do so, we open a terminal, and run:

kali@kali:~$ sudoedit /etc/default/grub 

 

In this file, we update the value of the GRUB_CMDLINE_LINUX_DEFAULT variable as below:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet video=hyperv_fb:1920×1080″

 

Here 1920×1080 is the screen resolution of the host machine. You need to change this value as per your host machine resolution.

Finally, we rebuild the GRUB config files:

kali@kali:~$ sudo update-grub

 

Then reboot the VM to test.

Kali inside UTM (Guest VM)

To install and set up a UTM VM it is pretty straightforward. We first download UTM and then launch the app. After this we can click create VM and start the short process:

We will select Virtualize, as we will be using a Kali Apple M1 installer iso which will bring us to the next page:

From here, we will select “Other” which will again bring us to the next page:

Now we are only going to change one item, which is selecting our “Boot ISO Image” and choosing the ISO we downloaded previously. Once that is done we can hit continue:

We won’t change any of the settings here, and will just continue forward:

Here we will be sure to lower or raise the size of the drive to what we will need. In our case, we will be lowering it to 20GB and continue:

We again will skip changing anything on this page, however if you want a shared directory feel free to add it:

Now we are at the summary and we can re-name our VM to be “Kali Linux”. Once complete, we will hit save and then press the settings button. Due to a bug in the current UTM version, we will have to install Kali in console only mode.

From here we can add the device “Serial” under “Devices”:

Now we can save and press play on the VM. Once prompted, we select “Install”:

Once the install is finished we can go back to the settings and remove the “Serial” device by right-clicking and selecting “Remove”:

We should also update the Display Card emulation. Select the virtio-gpu-pci option:

We can now use our VM like normal.

Kali inside QEMU/LibVirt with virt-manager (Guest VM)

We understand there are a lot of options for interfacing with KVM and QEMU to create different VMs, however for the purposes of this guide we will be using the most common option.

To get a Debian based system prepared for this, we can simply run the following command:

kali@kali:~$ sudo apt update && sudo apt install virt-manager -y

[…]

 

This will pull in all of the necessary packages and will allow us to create our VM just fine.

After virt-manager is installed, we can launch it and put in our password as we need elevated permissions for some tasks.

From here we can select the “+” and begin to create our VM:

We want to ensure we select local ISO file:

We choose our ISO and also de-select guessing the OS and input “Debian 11”:

We make sure to use 2GB of memory and 2 CPU cores:

We set our system to be 20GB:

We can now finalize setup by changing the system name to “kali-linux”:

From here we can follow the normal Kali Linux installation

Troubleshooting Kali VMware VM

Fix copy/paste, drag and drop with KDE desktop

This is for users of the Kali KDE desktop, within a VMware virtual machine. It is a known issue that copy/paste and drag and drop won’t work out of the box. As a workaround, it’s possible to disable the systemd user instance, and use KDE’s legacy boot mechanism instead. To do so, open a terminal and type the following command:

kali@kali:~$ kwriteconfig5 –file startkderc –group General –key systemdBoot false

 

As a verification, you can check that this command created the file ~/.config/startkderc with the following content:

kali@kali:~$ cat ~/.config/startkderc

[General]

systemdBoot=false

 

Then logout and log back in: the issue should be fixed.

This issue has been reported upstream, one can have a look at the following places for more details:

Improving Virtual Machine Performance for VMware

Setting Memory Limits for your Virtual Machines

When you are running a virtual machine on your host operating system, they tend to not behave well when they run low on free memory for their own use. In certain situations, a Windows or Linux host operating system may not have enough memory for even its own use. This will cause the virtual machine to thrash as it constantly swaps parts of the system memory between the hosts pagefile that is on disk.

With VMware you can set a limit on the number of virtual machines that can run at once based on the amount of memory by applying the changes in the application settings. This will prevent the virtual machines from causing them to perform poorly while using your host operating system.

To change this setting, select Edit > Preferences (CTRL+P) and select Memory.

Lets take a look at the settings we currently have. As you can see we have 28GB reserved on the host system that can be used to run our virtual machines.

In the “Additional memory” section you will see three options:

  • Fit all virtual machine memory into reserved host RAM — Strictly apply the reserved memory limit set. This setting enables a variety of tight restrictions based on the number and memory size of virtual machines that may run at a given time. Since the virtual machines are running entirely in RAM, they have the best possible performance.
  • Allow some virtual machine memory to be swapped — This will allow the host operating system to swap a certain amount of virtual machine memory to disk if necessary. Using this setting can increase the number or memory size of virtual machines that can run on the host system at a given time. However, It may also result in reduced performance if virtual machine memory must be transferred between the virtual machine memory and host storage.
  • Allow most virtual machine memory to be swapped — Allows the host operating system to swap as much virtual machine memory to disk as desired. By enabling this setting it will allow you to run more virtual machines with more memory than the intermediate setting does. However, performance may be lower if virtual machine memory must be shifted between RAM and disk.

Between all three options selecting “Fit all virtual machine memory into reserved host RAM” will apply a reserved memory limit to have the best possible performance.

References

Installing VMware Tools (Guest Tools) 

Installing “Guest Tools”, gives a better user experience with VMware VMs. This is why since Kali Linux 2019.3, during the setup process it should detect if Kali Linux is inside a VM. If it is, then automatically install any additional tools (in VMware case, open-vm-tools and open-vm-tools-desktop). The Guest Tools are also pre-installed in the Live image since Kali Linux 2021.3.

As of September 2015, VMware recommends using the distribution-specific open-vm-tools (OVT) instead of the VMware Tools package for guest machines.

Open-VM-Tools

Should you decide to create your own VMware installation of Kali Linux (rather than using our pre-made VMware images), and you want to force a manual reinstall of open-vm-tools (as something has gone wrong), first make sure you are fully updated, then enter the following:

kali@kali:~$ sudo apt update

[…]

kali@kali:~$

kali@kali:~$ sudo apt install -y –reinstall open-vm-tools-desktop fuse

[…]

kali@kali:~$

kali@kali:~$ sudo reboot -f

kali@kali:~$

 

Adding Support for Shared Folders When Using OVT

Unfortunately, shared folders will not work out of the box, some additional scripts are needed. Those can be installed easily with kali-tweaks:

kali@kali:~$ kali-tweaks

 

In the Kali Tweaks menu, select Virtualization, then Install additional packages and scripts for VMware. Congratulations, you now have two additional tools in your toolbox!

The first one is a little script to mount the VMware Shared Folders. Invoke it with:

kali@kali:~$ sudo mount-shared-folders

 

And with a bit of luck, checking /mnt/hgfs/ you should see your shared folders.

The second script is a helper to restart the VM tools. Indeed, it’s not uncommon for OVT to stops functioning correctly (e.g. such as copy/paste between the host OS and guest VM stops working). In this case, running this script can help to fix the issues:

kali@kali:~$ sudo restart-vm-tools

 

For older versions of Kali Linux, here is our previous guide.

Installing VirtualBox Guest Addition (Guest Tools)

Installing “Guest Addition”, gives a better user experience with VirtualBox VMs (e.g. proper mouse and screen integration, as well as folder sharing). This is why since Kali Linux 2019.3, during the setup process it should detect if Kali Linux is inside a VM. If it is, then automatically install any additional tools (in VirtualBox’s case, virtualbox-guest-x11). The Guest Addition is also pre-installed in the Live image since Kali Linux 2021.3.

You must use VirtualBox 4.2.xx or higher in order to take advantage of the improvements, including compatibility updates, and enhanced stability of both the core application and the Guest Additions.

virtualbox-guest-x11

Should you decide to create your own VirtualBox installation of Kali Linux (rather than using our pre-made VirtualBox images), and you want to force a manual reinstall of virtualbox-guest-x11 (as something has gone wrong), first make sure you are fully updated, then enter the following:

kali@kali:~$ sudo apt update

[…]

kali@kali:~$

kali@kali:~$ sudo apt install -y –reinstall virtualbox-guest-x11

[…]

kali@kali:~$

kali@kali:~$ sudo reboot -f

kali@kali:~$

 

For older versions of Kali Linux, here is our previous guide.

Installing Hyper-V Enhanced Session Mode (Guest Tools

Installing “Guest VM Packages”, gives a better user experience with VMs in general. This is why since Kali Linux 2019.3, during the setup process it should detect if Kali Linux is inside a VM. If it is, then automatically install any additional tools (in Hyper-V’s case, hyperv-daemons). The Kali Linux Live image also comes with hyperv-daemons pre-installed since Kali Linux 2021.3.

However this is not the end of the story, and more can be done to improve the experience afterwards. This is because Hyper-V can connect to Virtual Machines using Remote Desktop Protocol (RDP).

This article will help you to enable the Enhanced Session Mode, which improves latency and opens up the possibility of clipboard sharing and windows resizing.

Configurating Kali

To configure Kali for Hyper-V Enhanced Session Mode, run kali-tweaks:

kali@kali:~$ kali-tweaks

 

In the menu, select Virtualization, then Configure the system for Hyper-V enhanced session mode. And that’s all there is to do on Kali’s side.

Changing the Setting of the Virtual Machine

You now need to change the transport type from VMBus to HVSocket.

First, log out of the current Kali’s session:

On the Windows host now: disconnect the Kali VM, open a PowerShell (with Administrator privileges) and issue the following command:

> Set-VM “(YOUR VM NAME HERE)” -EnhancedSessionTransportType HVSocket

 

Test and Troubleshooting

We can test to see if it’s been a success by starting the virtual machine again, and check if you can see the following screen when trying to use xrdp.

If this test doesn’t succeed, you might need to reboot, either the Kali VM, either the Windows host. Do what’s the most convenient for you, but if ever you’re using the Kali Live image, keep in mind that rebooting means losing all your changes: you’ll have to redo the configuration step on Kali’s side.

Disabling Hyper-V Enhanced Session Mode

If ever you find out that this mode was not what you wanted, it’s possible to undo the configuration on Kali’s side. Not difficult but you need to do the steps in the right order, so let’s detail it here.

First, log out of the current Kali’s session.

Then on the Windows host, disconnect the Kali VM, open a PowerShell (with Administrator privileges) and disable Enhanced Session Mode:

> Set-VM “(YOUR VM NAME HERE)” -EnhancedSessionTransportType VMBus

 

Next, log into Kali, open a terminal and just use kali-tweaks again:

kali@kali:~$ kali-tweaks

 

In the Virtualization menu, you will find a setting to disabled Hyper-V Enhanced Session Mode.

Further notes

More details and troubleshooting can be found in the following conversation on GitLab.

This feature was made possible thanks to the work of Satoshi Mimura who ported the scripts (initially for Ubuntu) to Kali Linux, and Shane Bennett who helped to rework it for kali-tweaks, and provided most of the material for this documentation. Thanks!

Converting VMX to an OVA

VMware has VMX format which works for VMware products. The other commonly found format which is OVF, as this is a open standard (OVA is OVF but compressed into a single file). There are times where converting between the two formats is required.

In order to convert from VMware’s VMX to a OVA file, we will use ovftool. If you already have either VMware workstation or VMware fusion pre-installed, you may already have it (else it can be downloaded as a standalone program for free). Its default locations are:

  • Linux: /usr/bin/ovftool
  • OS X/macOS: /Applications/VMware Fusion.app/Contents/Library/VMware OVF Tool/ovftool
  • Windows: C:\Program Files (x86)\VMware\VMware Workstation\OVFTool\ovftool.exe

We will be using the official Kali Linux VMware image to convert. To start with unzip it to get access to the vmx within:

kali@kali:~$ 7z x kali-linux-2024.1-vmware-amd64.7z

[…]

kali@kali:~$

kali@kali:~$ ls kali-linux-*-vmware-amd64.vmwarevm/*vmx

kali-linux-2024.1-vmware-amd64.vmwarevm/kali-linux-2024.1-vmware-amd64.vmx

kali@kali:~$

 

We can now start to convert by doing the following:

kali@kali:~$ ovftool kali-linux-*-vmware-amd64.vmwarevm/*vmx kali-linux-rolling-amd64.ova

Opening VMX source: kali-linux-2024.1-vmware-amd64.vmwarevm/kali-linux-2024.1-vmware-amd64.vmx

Opening OVA target: kali-linux-rolling-amd64.ova

Writing OVA package: kali-linux-rolling-amd64.ova

[…]

Transfer Completed

Completed successfully

kali@kali:~$

kali@kali:~$ file kali-linux-rolloing.ova

kali-linux-rolloing.ova: POSIX tar archive

kali@kali:~$ ls -lah kali-linux-rolloing.ova

-rw-r–r– 1 kali kali 3.4G Nov 10 23:18 kali-linux-rolloing.ova

kali@kali:~$

 

That’s it!

The OVA file can be now move and used where needed such as to ESXi (if the in-built upload feature is not working) or migrate to VirtualBox (You may need to install Guest Addition if so).

 

0

7

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P