Exploring Kali Linux on Windows: A Guide to Installing and Configuring WSL
Introduction
Kali Linux is an indispensable tool for penetration testers and IT security analysts, as well as many other technical enthusiasts who prefer Linux over Windows. However, most people are accustomed to using Windows because of its user-friendly interface. Moreover, encountering difficulties when accessing a specific operating system becomes a common issue when running dual operating systems on the same computer. While installing virtual box or VMware is a viable solution, they are third-party applications that consume additional memory and require setup and configuration. To address these challenges, Windows introduced a feature called WSL (Windows Subsystem for Linux).
Windows Subsystem for Linux
WSL is a Windows feature that allows for Linux access within the Windows environment. It is also incredibly easy to install various Linux distributions that are readily available on the internet. Ubuntu, in particular, is highly recommended for individuals who are keen on learning about the Linux operating system.
Precautions
Before using WSL, it is crucial to determine the status of WSL on your system, as it may not be active by default. To check, navigate to "Windows Features" and search for the option labeled "Windows Subsystem for Linux." Ensure that it is enabled.
Another important aspect to consider is virtualization. Virtualization is a technology that emulates a system's hardware, allowing software applications to function as servers on a single computer system. Through virtualization, users can create multiple virtual servers on a single computer system.
To access Linux on Windows, users need to enable both Windows Subsystem for Linux (WSL) and Virtualization features in Windows. It is also important to ensure that virtualization is enabled in the BIOS. If virtualization is disabled in the BIOS, Linux cannot be run on the Windows operating system. Since BIOS settings vary across different hardware, users must check their BIOS settings. However, an easy way to check if virtualization is enabled or disabled is to use the Task Manager. Simply select the "Performance" option in the Task Manager, where you can view the performance graph and check the virtualization status.
Known Obstacles:
While installing Kali Linux, I personally encountered some issues, such as a package error and a connection error between the Microsoft server and my system. Upon researching the internet, I discovered that many people have experienced similar problems due to various reasons. Initially, I resolved the package error by installing the latest Linux kernel Microsoft installer package. However, the connection error proved to be more challenging. Despite trying numerous workarounds, none of them were successful. After conducting extensive research, I eventually stumbled upon an interim solution that may not be suitable for everyone but definitely resolved the issue. The method involved using a VPN server if you are a VPN user and changing your IP from your current location to another location. Surprisingly, this approach solved the server connection problem.
Actually, VPN services typically require a subscription fee, which may not be convenient for everyone. While there are free VPN tools available, they often impose limitations on data transfer speed. Therefore, I highly recommend opting for a paid VPN service for a more reliable and efficient experience.
Installation:
To enable WSL, the user needs to navigate to the Windows features and enable it along with virtualization. Once done, follow these steps:
1. Open the Command Prompt in administrator mode.
2. Run the following command:
wsl --install -d kali-linux
Here, the '-d' flag indicates the Linux distribution (in this case, Kali Linux). Users can install other Linux distributions as well. To find out which Linux distributions are supported, use the following command:
wsl --list –online
This command will provide a list of available Linux distributions online.
After a successful installation, the system will prompt the user to set up a username and password. If the setup process does not proceed correctly or if any other errors occur after the installation is complete, it is necessary for the user to install the 'wsl_update_x64.msi' package. This package is crucial for performing certain critical operations as it installs the latest Linux kernel.
Additional Kali Tools
After installing Kali Linux, it is important to update it to the latest version. You can achieve this by running the command sudo apt update, which will update the installed version to the latest one available. The initial installation of Kali Linux provides a basic version with all the essential features of a command-line Linux distribution. However, it may lack certain tools that are considered integral to Kali Linux. To install the full version of Kali Linux with all the necessary tools, you can use the following command.
sudo apt install kali-linux-large -y
If you have already installed another Linux distribution and you want to set Kali Linux as the default one, you can use the following command. Please note that this command should be executed in the command prompt, not the Kali command line.
wsl –set-default kali-linux
The command-line configuration is now complete. However, if you need to access Kali Linux with a graphical user interface (GUI), you can execute the following command:
sudo apt install kali-win-kex
Please note that executing every command line takes some time as it downloads repositories from the internet. Therefore, patience is required during the process.
To access the graphical user interface (GUI) of Kali Linux, you can run the following command:
kex –win -s
In conclusion, Windows Subsystem for Linux (WSL) provides an excellent solution for accessing Linux within the Windows environment. By enabling WSL and virtualization features, you can easily install and use Kali Linux, a powerful tool for penetration testing and IT security analysis. It is important to be aware of any potential obstacles during the installation process, such as package errors or connection errors, which can be resolved through troubleshooting or using a VPN server as a workaround.
Remember to update Kali Linux after installation and consider installing additional Kali tools to enhance its functionality. Whether you prefer the command-line interface or the graphical user interface, you can configure Kali Linux to suit your needs.
By following the installation and configuration steps outlined in this guide, you can successfully utilize Kali Linux on your Windows system and explore its vast range of security testing capabilities.
Subscribe to my newsletter
Read articles from Kannan Balakrishnan R directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Kannan Balakrishnan R
Kannan Balakrishnan R
I am a web developer and cybersecurity enthusiast. I will share my knowledge through articles focusing on updated, trending technology-related topics.