How to Install Kali Linux on WSL2 Windows10 | Kali Linux Installation Guide

 

Watch the full video for installing Kali Linux on WSL2 windows10.


Windows Subsystem for Linux (WSL) is a awesome feature in Windows10 which  enables us to run Linux Binary Executables natively in Windows10 and Windows server 2019.

WSL feature is not pre-enabled in Windows10. We need to enable it manually.
For installing a Linux Operating System in GUI-Mode, we need to move to WSL version 2.

Comparing WSL and WSL 2


WSL 2 uses the finest and the latest in virtualization technology for running a full Full Linux Kernel inside of a very light weight Virtual Machine (VM)

Features

WSL 1

WSL 2

Integration between Windows and Linux

Fast boot times

Small resource foot print compared to traditional Virtual Machines

Runs with current versions of VMware and VirtualBox

Managed VM

Full Linux Kernel

Full system call compatibility

Performance across OS file systems


Basic System Requirements for WSL version2

  • For x64 systems: Version 1903 or higher, with Build 18362 or higher.
  • For ARM64 systems: Version 2004 or higher, with Build 19041 or higher.
  • Builds lower than 18362 do not support WSL 2, Update your windows with  Windows Update Assistant



How to install Kali Linux on Windows10 wsl, kali Linux Wsl2
Kali Linux on Windows10 WSL2

Installing Kali Linux on WSL Windows10

Official Documentation for WSL Microsoft Windows:
Windows Subsystem for Linux Installation Guide for Windows 10

Enabling WSL and Virtual Machine Platform Feature

Here are the full process of installing Kali Linux OS on WIndows10 with some simple clicks.
But before we move on we need to enable the features called Windows Subsystem for Linux & Virtual Machine Platform from Windows Features.

First Go to Start Menu in the bottom left corner on your Desktop, and search for "Turn Windows Features On or Off" and click on Turn Windows Features On or Off.

After clicking there, a window will appear on your screen, now scroll down and look for Windows
Subsystem for Linux & Virtual Machine Platform. Now click the boxes before these names ().
Now click OK  and Restart your computer.

Setting WSL version 2 as Default Version

Open PowerShell from the Start Menu by searching "Powershell".
Now type the following command for setting WSL version 2 as default.

wsl --set-default-version 2


The output of the above command should be look like this

For information on key differences with WSL 2 please visit https://aka.ms/wsl2


Installing Kali Linux on WSL2 on Windows

Now open Microsoft Store and search for Kali Linux and Install that.
After completing the installation, you can check if Kali Linux is installed properly on WSL2 or not.
For that, Run the following command on your Windows PowerShell

 wsl -l -v

//Expected Output

  NAME          STATE           VERSION

* kali-linux    Stopped         2


Now Launch the app(Kali Linux).
A black windows will then appear on your screen, that is your Kali Linux Terminal, it may take some time to load the window.

Now it will ask you to choose your new username for Kali Linux, choose your username(whatever you want) and hit enter.
Then it will again ask you to choose your new password for Kali Linux, type your password(your password is not going to appear in the screen while typing the password, don't worry for that) and hit enter.
Now you need to type your password again for verification, type it and hit Enter.

You are all set now!
Try your Linux commands on the terminal.

Installing Kali Linux on GUI Mode in WSL2

Here we will cover two methods of using Kali Linux in GUI mode on WSL2 on Windows 10.

Using Win-KeX

Win-KeX peovides awesome Desktop Experience for WSL2
But, for installing Win-KeX you need to have at least 800MB of Internet Data excluding updating and upgrading data costs.

Now, for installing you just copy and paste the following three commands on your Kali Linux Terminal which is installed on WSL2.

$ sudo apt update -y

$ sudo apt upgrade -y

$ sudo apt install kali-win-kex -y



These commands will completely install Win-KeX on your Kali Linux.

Now type :

$ kex


It will ask you to choose a new password for Win-KeX client server, type it and hit Enter.
It will again ask you to verify your password, type it and hit Enter.

Now a pop-up menu will appear, type the password there and click Ok.
That's all! Enjoy!
Remember: Press F8 to open context menu(For closing/minimizing Kali GUI).

Using Remote Desktop Connection

Remote Desktop Connection is a windows component that allows us to connect to our virtual computer over network(IP).

For using our Kali Linux OS in Windows in GUI Mode, we have to install xrdp on our Kali Linux.
xrdp is a a service that allows us to connect to Microsoft RDP Server-that enables Operating Systems other than Microsoft Windows to provide a fully functional RDP-compatible Remote Desktop Experience(source: Wikipedia)

Installing xrdp on Kali Linux

Copy the following command and paste it on your Kali Linux Terminal which is installed on WSL2 on Windows 10 for installing xrdp.

$ sudo apt install xrdp -y


Now install a Desktop Environment for Kali Linux

$ sudo apt install kali-desktop-xfce


After installing all these, type the following commands

$ sudo service xrdp start


then,

$ sudo ifconfig


Copy the IP address from the output.

Now open Remote Desktop Connection form the Start Menu by Searching "Remote desktop connection".
A window will appear on your screen, paste your IP there and click Connect.

Booyaaah!
You have finished  it successfully!

If you are not comfortable with this blog, you can watch our video Tutorial on it..




Thank You so much for spending a great time with us!


0 Comments