Kali Linux APPS on Windows in 5min (WSLg)

3 min read 2 months ago
Published on Sep 02, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial will guide you through the process of installing and using Kali Linux applications on Windows using WSL 2 and WSLg. By following these steps, you can seamlessly run Linux GUI apps on your Windows 11 desktop, enhancing your development and security capabilities.

Step 1: Check Requirements

Before you start, ensure that your system meets the following requirements:

  • Windows 11 (WSLg is available only on this version)
  • Virtualization enabled in BIOS
  • Internet connection for downloading necessary components

Step 2: Enable Virtualization

To run WSL 2 effectively, you need to enable virtualization:

  1. Restart your computer and enter BIOS/UEFI settings (usually by pressing F2, Delete, or Esc).
  2. Look for an option labeled "Virtualization Technology" or similar.
  3. Enable this option and save changes.
  4. Exit BIOS and boot into Windows.

Step 3: Install WSL 2

Follow these steps to install WSL 2:

  1. Open PowerShell as an administrator.
  2. Run the command to enable the WSL feature:
    wsl --install
    
  3. This command will install WSL and set WSL 2 as your default version.
  4. Restart your computer if prompted.

Step 4: Set Up Ubuntu

After installing WSL, set up an Ubuntu distribution:

  1. Open the Microsoft Store.
  2. Search for "Ubuntu" and select the version you want (e.g., Ubuntu 20.04).
  3. Click "Get" or "Install" to download and install Ubuntu.
  4. Once installed, launch Ubuntu from the Start menu.
  5. Follow the prompts to create a user account and set a password.

Step 5: Install WSLg

To enable GUI support for Linux applications:

  1. Ensure you have the latest updates installed for Windows.
  2. WSLg should be automatically included with your WSL installation, but confirm it by running:
    wsl --update
    
  3. Restart WSL for changes to take effect:
    wsl --shutdown
    

Step 6: Launch Your First Linux GUI App

To test if everything is working, launch a GUI app:

  1. Open your Ubuntu terminal.
  2. Install a simple GUI app, such as gedit, by running:
    sudo apt update
    sudo apt install gedit
    
  3. Launch the app:
    gedit
    
  4. The gedit text editor should appear on your Windows desktop.

Step 7: Install Other Linux Distros

You can also install other Linux distributions:

  1. Open the Microsoft Store.
  2. Search for your desired distribution (e.g., Kali Linux).
  3. Install it similar to how you installed Ubuntu.
  4. Set it up by launching the terminal and following the prompts.

Step 8: Install Kali Linux

To install Kali Linux specifically:

  1. Follow the same steps as with other distributions in the Microsoft Store.
  2. Once installed, launch Kali and set up your user account.

Step 9: Set Up Win-Kex for Kali

Win-Kex allows you to run Kali Linux GUI apps on Windows:

  1. Open your Kali terminal.
  2. Install Win-Kex by running:
    sudo apt install -y kali-win-kex
    
  3. Start Win-Kex with:
    kex
    
  4. A new window will open, allowing you to use Kali Linux GUI applications.

Conclusion

In this tutorial, you learned how to install and set up Kali Linux applications on Windows using WSL 2 and WSLg. By following these steps, you can effectively run Linux GUI applications alongside your Windows environment. For further exploration, consider experimenting with different Linux distros and applications to enhance your development experience.