Skip to content Skip to footer

How to Install Kali Linux in WSL 2

is a well-known and widely used distribution primarily used for penetration testing and security auditing. It is a favorite among security researchers and ethical hackers due to its extensive collection of pre-installed tools and designed for security testing and analysis.

In recent years, Windows 10 has become popular among users for its user-friendly interface and compatibility with a wide range of applications. However, running Linux applications on a Windows machine can be challenging. Fortunately, the release of Windows Subsystem for Linux 2 (WSL 2) has made it possible to run Linux applications seamlessly on Windows 10.

This tutorial will guide you through installing in WSL 2. We will cover all the necessary steps, from enabling the WSL feature in Windows 10 to downloading and installing in WSL 2. Following this tutorial, you can set up on your Windows machine and use its powerful tools and for security testing and analysis.

Step 1: Install WSL 2

To install in WSL 2, we must first ensure that WSL 2 is installed on our Windows 10 machine. Here are the detailed steps to install WSL 2:

1. Open the Microsoft Store app through the Start menu or taskbar.

2. In the search bar of the Microsoft Store app, type “WSL 2” and select the “Ubuntu 20.04 LTS” app from the search results.

3. Click the “Get” button to download and install the app. The installation process may take some time, depending on your internet speed.

4. launch the app and follow the on-screen instructions to set up your Ubuntu environment once the installation is complete. You will be prompted to create a username and password for your Ubuntu account.

5. After you have set up your Ubuntu environment, you can enable WSL 2 on your Windows 10 machine by opening PowerShell as an administrator and running the command “dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart”.

6. Finally, you must update the WSL 2 kernel by downloading and installing the latest kernel package from the official Microsoft website.

From Microsoft: 

=====================================================

Upgrade version from WSL 1 to WSL 2

New Linux installations, installed using the wsl –install command, will be set to WSL 2 by default.

The use –set-version command can be used to downgrade from WSL 2 to WSL 1 or to update previously installed Linux distributions from WSL 1 to WSL 2.

To see whether your Linux distribution is set to WSL 1 or WSL 2, use the command wsl -l -v.

Suppose you manually installed WSL before the wsl –install command is available. In that case, you may also need to enable the virtual machine optional component used by WSL 2 and install the kernel package if you still need to.

To learn more, see the Command reference for WSL for a list of WSL commands, Compare WSL 1 and WSL 2 for guidance on which to use for your work scenario, or Best practices for setting up a WSL development environment for general guidance on setting up a suitable development workflow with WSL.

=====================================================

Once you have completed these steps, you will be ready to install in your WSL 2 environment.

Step 2: Download and Install

Now that we have WSL 2 installed, we can download and install . Here's how:

1. Go to the Kali Linux download page in your web browser.

2. Select the appropriate version of Kali Linux for your system architecture (32-bit or 64-bit).

3. Click the “Download” button to download the Kali Linux image.

4. launch the Ubuntu app we installed in Step 1 once the download is complete.

5. In the Ubuntu terminal, run the following command to update the package list:

sudo apt-get update
Bash

6. Run the following command to install the “wget” package, which we will use to download the Kali Linux image:

sudo apt-get install wget
Bash

7. Run the following command to download the Kali Linux image:

wget https://cdimage.kali.org/kali-2021.1/kali-linux-2021.1-wsl-amd64.tar.gz
Bash

8. Once the download is complete, run the following command to extract the Kali Linux image:

tar -xf kali-linux-2021.1-wsl-amd64.tar.gz
Bash

9. Run the following command to install Kali Linux:

./kali-linux-2021.1-wsl-amd64/install.sh
Bash

Step 3: Launch Kali Linux

Now that we have installed Kali Linux in WSL 2, we can launch it by following these steps:

1. Launch the Ubuntu app that we installed in Step 1.

2. In the Ubuntu terminal, run the following command to launch Kali Linux:

kali-linux
Bash

3. Follow the on-screen instructions to set up your Kali Linux environment.

That's it! You now have Kali Linux in WSL 2 on your Windows 10 machine. You can use Kali Linux to perform security audits and penetration testing tasks from your Windows 10 desktop.

Leave a comment

Newsletter Signup
Address

The Grid —
The Matrix Has Me
Big Bear Lake, CA 92315

01010011 01111001 01110011 01110100 01100101 01101101 00100000
01000110 01100001 01101001 01101100 01110101 01110010 01100101

You would probably lose your header if it weren't compiled on.Tron

Deitasoft © 2024. All Rights Reserved.