Sunday, March 13, 2022

Installing Kali Linux on WSL1 (not recommended)

I found Kali linux is ready for WSL and it's easy to install. Following list is distribution list that can be installed from Microsoft Store.

PS C:\> wsl --status
Default Version: 1

Windows Subsystem for Linux was last updated on 11/15/2021
WSL automatic updates are on.

Kernel version: 5.10.60.1


PS C:\> wsl -l -o
The following is a list of valid distributions that can be installed.
Install using 'wsl --install -d '.

NAME            FRIENDLY NAME
Ubuntu          Ubuntu
Debian          Debian GNU/Linux
kali-linux      Kali Linux Rolling
openSUSE-42     openSUSE Leap 42
SLES-12         SUSE Linux Enterprise Server v12
Ubuntu-16.04    Ubuntu 16.04 LTS
Ubuntu-18.04    Ubuntu 18.04 LTS
Ubuntu-20.04    Ubuntu 20.04 LTS



If WSL has been installed already, just execute following command is fine.

wsl --install -d kali-linux
 

PS C:\> wsl --install -d kali-linux
Downloading: Kali Linux Rolling
Installing: Kali Linux Rolling
Kali Linux Rolling has been installed.
Launching Kali Linux Rolling...



Once it is installed new window is popping up and username and password would be required to input.



Next step is to install the latest versions of all the installed packages. Following 2 commands need to be executed.

sudo apt-get update
sudo apt-get upgrade

This time I got strange error like this.

tmlocal@local:/$ sudo apt-get update
[sudo] password for tmlocal:
Get:1 http://linux3.yz.yamagata-u.ac.jp/pub/linux/kali kali-rolling InRelease [30.6 kB]
Err:1 http://linux3.yz.yamagata-u.ac.jp/pub/linux/kali kali-rolling InRelease
  The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository 
Fetched 30.6 kB in 1s (21.3 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://linux3.yz.yamagata-u.ac.jp/pub/linux/kali kali-rolling InRelease: The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository 
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease  The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository 
W: Some index files failed to download. They have been ignored, or old ones used instead.



Hence I downloaded kali-archive-keyring_2022.1_all.deb from this URL and installed.

tmlocal@local:/mnt/c/users/tmlocal/Downloads$ sudo apt install ./kali-archive-keyring_2022.1_all.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'kali-archive-keyring' instead of './kali-archive-keyring_2022.1_all.deb'
The following packages will be upgraded:
  kali-archive-keyring
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/5,140 B of archives.
After this operation, 2,048 B disk space will be freed.
Get:1 /mnt/c/users/tmlocal/Downloads/kali-archive-keyring_2022.1_all.deb kali-archive-keyring all 2022.1 [5,140 B]
(Reading database ... 17118 files and directories currently installed.)
Preparing to unpack .../kali-archive-keyring_2022.1_all.deb ...
Unpacking kali-archive-keyring (2022.1) over (2018.1) ...
Setting up kali-archive-keyring (2022.1) ...
Installed kali-archive-keyring as a trusted APT keyring.
    
After this update and upgrade was successfully completed.

However, this environment is not recommended because WSL1 is slower than WSL2 and has compatibility challenges.

No comments:

Post a Comment

Installing Kali Linux on WSL2

In the last post I installed Kali Linux on WSL1, but actually it was not recommended as WSL2 is better than WSL1 obviously. Here is compari...