Yes, you absolutely can install Kali Linux as a WSL distribution without using the Microsoft Store.
This is done by manually importing the distribution from a .tar.gz archive provided by Offensive Security (the creators of Kali).
Here are the steps:
Ensure WSL is Enabled: If you haven't already enabled WSL on your Windows system, you need to do that first. You can do this via PowerShell (run as Administrator):
powershell
wsl --install --no-distribution
(This command enables the necessary Windows features for WSL 2 but doesn't install a distro). Alternatively, go to "Turn Windows features on or off" and enable "Windows Subsystem for Linux". You might need to restart your computer.
Download the Kali WSL .tar.gz: Go to the official Kali Linux downloads page specifically for WSL. You can find it here:
https://www.kali.org/get-kali/#kali-wsl
Download the .tar.gz file provided in the "Download Kali Linux WSL" section. Save it to a location you can easily access (e.g., C:\Temp).
Create a Directory for the Installation: Choose a location on your Windows filesystem where you want the Kali filesystem to reside. Do not choose a system folder like Program Files. A good practice is to create a folder under your user profile, e.g.:
code
C:\Users\YourUsername\wsl_distros\kali-manual
Create this folder before the next step.
Import the Distribution: Open Command Prompt or PowerShell and use the wsl --import command. The syntax is:
(Adding --version 2 is highly recommended to ensure it uses WSL 2)
Press Enter and wait for the import process to complete. This might take a few minutes.
Launch and Configure (Set Default User):
Once the import is finished, you can launch your new Kali instance by typing the <DistroName> you chose in Command Prompt or PowerShell:
cmd
wsl -d Kali-Manual
By default, you will be logged in as the root user. It's highly recommended to create a standard user and set it as the default.
Inside the Kali terminal (while logged in as root):
Create a new user: adduser <your_username> (Follow prompts to set a password and user info)
Add the new user to the sudo group so they can run commands as root: usermod -aG sudo <your_username>
Exit the Kali instance: exit
Set the New User as Default (Optional but recommended): To have WSL automatically log you in as your new user instead of root, you need to create or edit the /etc/wsl.conf file inside the Kali instance.
Launch Kali again as root: wsl -d Kali-Manual
Edit the config file (using nano or vim): nano /etc/wsl.conf
Add the following lines:
ini
[user]
default=<your_username>
(Replace <your_username> with the user you created in the previous step).
Save the file (Ctrl+X, Y, Enter in nano).
Exit the Kali instance: exit
Important: To apply this change, you need to terminate the WSL instance. Open Command Prompt or PowerShell and run:
cmd
wsl --terminate Kali-Manual
(Replace Kali-Manual with your distro name).
Now, the next time you launch wsl -d Kali-Manual (or just wsl if this is your default distro), you will be logged in as the user you created.
This method allows you to get Kali WSL running without any interaction with the Microsoft Store.
User
so can I do wsl --install --distribution kali-linux with wsl2 and it will install?
Assistant
Okay, let's clarify based on the previous conversation:
No, you cannot use wsl --install --distribution kali-linux if your goal is to install Kali without using the Microsoft Store.
Here's why:
wsl --install Functionality: The wsl --install command is designed to simplify the setup process. When you use --distribution <distro_name> with it, it specifically fetches and installs that distribution from the Microsoft Store.
Store Dependency: The names like kali-linux, Ubuntu, Debian that work with wsl --install --distribution are linked to the packages available in the Microsoft Store.
So, if you run wsl --install --distribution kali-linux:
It will install Kali.
It will likely set it up using WSL2 (as wsl --install defaults to WSL2 on compatible systems).
But it willuse the Microsoft Store to get the Kali distribution package.
If your requirement is strictly to avoid the Microsoft Store, then the wsl --import method (using the .tar.gz file from the Kali website) is the only way to achieve that. The wsl --install command is not the method to use in that scenario.