Kali Linux on Windows with GUI by Using WSL 2 (10 Steps)
If you are a person fed up with using a virtual box or any other VM providing software and as well as if you are a person who loves to use Kali Linux on Windows 10. Then, be happy geeks you are in the right place. Ok, before starting the tutorial I would like to mention that this only works in the WSL 2 (Windows Subsystem for Linux 2). To update to WSL 2 your Windows 10 should be updated to version 2004, Build 19041, or higher. To check the Windows version press Windows key + R type winver.
If it is lower than this version please be sure to update the windows by simply using the Windows update in the settings menu.
Ok if you are ready let’s start to rock by installing Kali on Linux😋.
1. First, run Windows PowerShell with administration privileges and run the below command to enable the WSL.
“Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux”
2. Then restart the computer
3. Then again run the Windows PowerShell as the administrator and add below command to enable the virtual machine feature.
“dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestar”
After this process completed run below command and do a restart.
“dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart”
4. Then we need to download the latest Linux kernel package to update to WSL 2 for that you have to visit the below link and download the latest WSL 2 Linux kernel update package for *64 machines.
Download link :- Install Windows Subsystem for Linux (WSL) on Windows 10 | Microsoft Docs
5. Set WSL 2 as your default version for that enter below command in PowerShell.
“wsl — set-default-version 2"
To check the version you can use “ wsl — list — verbose”
6. Then, we can install Kali Linux as an app from the Windows Store.
7. After installation of Kali Linux run it through the windows start menu. Consider that we still do not have the GUI😣. This only provides the CLI and set up it by entering a username and password.
8. Ok now let’s start to add GUI for the Kali Linux for that you have to run these commands in the Kali Linux terminal.
“sudo apt update && sudo apt upgrade -y”
Then you have to add a desktop environment for that you have to execute the below command. This will take some time to complete.
“sudo apt install kali-desktop-xfce -y”
After that, you will get a window like this to select the language
9. Now we should install xrdp to Kali to get a graphical login to remote machines using RDP(Microsoft Remote Desktop). To install xrdp run below command in Linux terminal.
“sudo apt install xrdp -y”
Then start the xrdp service by entering the below command
“sudo service xrdp start”
10. Now we can connect to our kali VM remotely by using windows remote desktop connection for that we need to get the IP address of our Kali VM firstly, that enter the below command,
“ip add”
Then open the Remote Desktop Connection
Then enter the IP Address and hit connect.
Then you will get a UI like this
Enter the username and password to get into Kali Linux VM and hit OK.
Sometimes you get an error that noticed you as “Unable to get session bus: Failed to execute child process “dbus-launch” (No such file or directory) while x-forwarding” (Actually I got this). In this case You only have to install dbus-x11(It fixed for me).
Then You have the Kali GUI😋
Enjoy the GUI.
Thank You.
DOiZ