First, the preparation before the start

1. Update Windows

Kali Linux official released a suitable for WSL2 Win10 subsystem software win-kex, which is a Linux GUI software running under Win10, from now on Win10 can also coexist with Linux

First, open Windows Settings and select Update and Security

Find the OS internal version information

Find the version number in Windows Specs

If the version number is lower than 2004, it needs to be updated. Directly in Windows Update, update to the latest version.

2. Enable the Windows function

Go back to the Settings page and find the app

Select programs and features

Enable and disable Windows functions

Select Windows subsystem and VM platform for Linux and click Ok.

Wait and restart the computer.

Second, the installation of Linux subsystem

1. Download the WSL

Enter the Microsoft Store

Search for Linux and select Download Kali Linux

Wait until the download is complete and click Start. It takes a long time to start for the first time

Press Enter all the time, do not open the password and the root user

2.WSL version conversion

Generally, the subsystem we installed is based on WSL1, and to launch the graphical GUI interface we need to convert it to WSL2. It is as simple as entering the CMD command line or power shell and typing the command

wsl -l -v

To view the current version and subsystem name, enter the command

wsl –set-version kali-linux 2

(Look at you, wSL2 is not compatible with virtual machine emulators, but VMare is now compatible, most Android emulators do not support it, but the future WSA is based on WSL so don’t worry too much)

It takes a while to convert the version to WSL2, but sometimes the installation fails and requires us to visit the Microsoft website

Docs.microsoft.com/zh-cn/windo…

This is usually caused by the lack of a WSL2 Linux kernel, which can be solved by visiting the web site and downloading and installing the corresponding kernel file.

The nic’s brother is concerned about male V: CXYY1106 and sends WSL message answers

This file is a.msi file, which needs to be trusted and installed.

After the installation is complete, run the conversion command again. If the conversion fails, you can use it

wsl –set-default-version 2

Change the default installation version to WSL2, uninstall the installed Linux subsystem, and reinstall it.

3. Configure software sources

The official software source of Linux system in foreign countries, the direct use of command to download will be very slow, so generally will use the source image to download, detailed tutorial can be searched, I only provide a simple method here.

Directly execute the following command (here I use the mirror of Beijing Foreign Studies University)

sudo sed -i ‘s/http.kali.org/mirrors.bfsu.edu.cn/g’ /etc/apt/sources.list

sudo apt update && sudo apt upgrade

I think there’s a few more in the back

First look at the source file in Kali, which has the official source by default.

(Vim does not have VI)

To control the file, press ESC first

Dd delete a row

: wq Save the changes and exit

Then add the domestic sources we found and annotate the official sources. (preceded by a “#”). Below are domestic and foreign sources.

# kali official source

deb http.kali.org/ moto main non-free contrib 

deb-src http.kali.org/ moto main non-free contrib

deb security.kali.org/ moto/updates main contrib non-free 

deb-src security.kali.org/ moto/updates main contrib non-free

# USTC Kali Source

deb mirrors.ustc.edu.cn/kali kali main non-free contrib 

deb-src mirrors.ustc.edu.cn/kali kali main non-free contrib 

Deb mirrors.ustc.edu.cn/kali-securi… kali/updates main contrib non-free

# Singapore Kali source

 deb mirror.nus.edu.sg/kali/kali/ kali main non-free contrib 

 deb-src mirror.nus.edu.sg/kali/kali/ kali main non-free contrib 

Deb security.kali.org/kali-securi… kali/updates main contrib non-free

Deb mirror.nus.edu.sg/kali/kali-s… kali/updates main contrib non-free

Deb – SRC mirror.nus.edu.sg/kali/kali-s… kali/updates main contrib non-free

# Aliyun Kali source

deb mirrors.aliyun.com/kali kali main non-free contrib 

deb-src mirrors.aliyun.com/kali kali main non-free contrib 

Deb mirrors.aliyun.com/kali-securi… kali/updates main contrib non-free

# 163 Kali source

deb mirrors.163.com/debian wheezy main non-free contrib 

deb-src mirrors.163.com/debian wheezy main non-free contrib 

deb mirrors.163.com/debian wheezy-proposed-updates main non-free contrib 

deb-src mirrors.163.com/debian wheezy-proposed-updates main non-free contrib 

Deb – SRC mirrors.163.com/debian-secu… wheezy/updates main non-free contrib

Deb mirrors.163.com/debian-secu… wheezy/updates main non-free contrib

# USTC

deb mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib 

deb-src mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib

# zhejiang university

deb mirrors.zju.edu.cn/kali kali-rolling main contrib non-free 

deb-src mirrors.zju.edu.cn/kali kali-rolling main contrib non-free

# Neusoft University

deb mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib 

deb-src mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib

# Tsinghua University

deb mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free 

deb-src mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free 

Several commands are used in the update source.

Apt-get update: Updates the source list. If you modify the source list or want to do a synchronous refresh or add new sources, you should execute the command above.

Apt-get upgrade: This command will try to download all packages with updates on the APT server and then install them when pressing “y”.

Apt-get dist-upgrade: This command also updates all packages. However, when upgrade is updated, errors may be reported or stopped if the dependencies cannot be resolved, but the dist-upgrade command can automatically resolve the dependencies. Therefore, dist-upgrade may update undesired software, causing some software that relies on older packages to fail to run.

Therefore, apt-get dist-upgrade should be used with caution. Generally, apt-get update && apt-get upgrade can ensure the integrity of the system.

Then clean up. apt-get clean

Restart. reboot

Three, configuration optimization environment

The following steps do not affect the graphical interface installation startup, is my recommendation for a terminal beautification. Find and install Windows Terminal in the Microsoft Store

After startup, find the lower triangle pattern in the TAB bar and enter Settings

The Windows terminal setup is based on. Json files, which can be downloaded from VSCode or Sublime text if the appropriate editor is not available

Find the tag with name kali-Linux in the list tag and copy the GUID (including quotes and parentheses)

Paste the guID you just copied into the defaultProfile TAB at the beginning of the file and save the file to boot as a Linux subsystem by default

The latest software can be set graphically without opening this file

In the square brackets of schemes you can add various theme colors, I’ll search for them myself, I’ll just provide the one I’m using (after setting the theme, please change the theme name in profiles accordingly)

Windows Terminal configuration:

// This file was initially generated by Windows Terminal 1.4.3243.0 // It should still be usable in newer versions, but newer versions might have additional // settings, help text, or changes that you will not see unless you clear this file // and let us generate a new one for you. // To view the default settings, hold "alt" while clicking on the "Settings" button. // For documentation on these settings, see: https://aka.ms/terminal-documentation { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", // You can add more global application settings here. // To learn more about global settings, visit https://aka.ms/terminal-global-settings // If enabled, selections are automatically copied to your clipboard. "copyOnSelect": true, // If enabled, formatted data is also copied to your clipboard "copyFormatting": false, // A profile specifies a command to execute paired with information about how it should look and feel. // Each one of them will appear in the 'New Tab' dropdown, // and can be invoked from the commandline with `wt.exe -p xxx` // To learn more about profiles, visit https://aka.ms/terminal-profile-settings "profiles": { "defaults": { // Put settings here that you want to apply to all profiles. "fontFace": "Fira Code", "fontSize": 11, "startingDirectory": "./" }, "list": [ { // Make changes here to the powershell.exe profile. "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Windows PowerShell", "commandline": "powershell.exe", "hidden": False, "useAcrylic" : true, "acrylicOpacity" : 0.75, "colorScheme" : "Afterglow" }, { // Make changes here to the cmd.exe profile. "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "Command Prompt", "commandLine ": "cmd.exe", "hidden": false, "useAcrylic" : true, "acrylicOpacity" : 0.75,}, {"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", // "hidden": false, "hidden": true, "name": "Azure Cloud Shell", "source": "Windows.Terminal.Azure" }, { "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}", "hidden": false, "name": "Ubuntu-20.04", "source": "windows.terminal.wsl"}, {" guID ": "{2c4de342-38b7-51cF-b940-2309A097f518}", "hidden": false, "name": "Ubuntu", "source": "Windows.Terminal.Wsl", "useAcrylic" : true, "acrylicOpacity" : 0.75, "colorScheme" : "ubt" } ] }, // Add custom color schemes to this array. // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes "schemes": [ { "name": "Afterglow", "black": "#151515", "red": "#ac4142", "green": "#7e8e50", "yellow": "#e5b567", "blue": "#6c99bb", "purple": "#9f4e85", "cyan": "#7dd6cf", "white": "#d0d0d0", "brightBlack": "#505050", "brightRed": "#ac4142", "brightGreen": "#7e8e50", "brightYellow": "#e5b567", "brightBlue": "#6c99bb", "brightPurple": "#9f4e85", "brightCyan": "#7dd6cf", "brightWhite": "#f5f5f5", "background": "#001c33", // "background": "#212121", "foreground": "#d0d0d0" }, { "name": "ubt", "black": "#151515", "red": "#ac4142", "green": "#7e8e50", "yellow": "#e5b567", "blue": "#6c99bb", "purple": "#9f4e85", "cyan": "#7dd6cf", "white": "#d0d0d0", "brightBlack": "#505050", "brightRed": "#ac4142", "brightGreen": "#7e8e50", "brightYellow": "#e5b567", "brightBlue": "#6c99bb", "brightPurple": "#9f4e85", "brightCyan": "#7dd6cf", "brightWhite": "#f5f5f5", //"background": "#2f0012", "background": "#212121", "foreground": "#d0d0d0" }, ], // Add custom actions and keybindings to this array. // To unbind a key combination from your defaults.json, set the command to "unbound". // To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings "actions": [ // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json. // These two lines additionally bind them to Ctrl+C and Ctrl+V. // To learn more about selection, visit https://aka.ms/terminal-selection { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" }, { "command": "paste", "keys": "ctrl+v" }, // Press Ctrl+Shift+F to open the search box { "command": "find", "keys": "ctrl+shift+f" }, // Press Alt+Shift+D to open a new pane. // - "split": "auto" makes this pane open in the direction that provides the most surface area. // - "splitMode": "duplicate" makes the new pane use the focused pane's profile. // To learn more about panes, visit https://aka.ms/terminal-panes { "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" } ] }Copy the code

If you’re more used to using Windows PHOTOSHOP, but you find the interface ugly, here’s how to beautify it. WPS beautify Windows Terminal is also developed by Microsoft, produced by Microsoft, must be a fine product

= = =

Refer to the article

Blog.csdn.net/l1447320229…

This article uses the article synchronization assistant to synchronize