WLS2 (win10 subsystem) Linux graphical GUI tutorial win-kex
Remarks
2020/8/25 Tuesday
A few days ago, Kali Linux officially released a software win-kex suitable for WSL2 win10 subsystem. This is a Linux GUI software running under win10. From then on, win10 can also coexist friendly with Linux.
1. Preparation before starting
1. Update the Windows version
First, open Windows settings, select Update and Security
Find the OS internal version information
Find the version number in the Windows specifications
Version numbers lower than 2004 need to be updated.
Just update to the latest version in Windows Update.
2. Turn on Windows features
Go back to the settings page and find the application
Select program and function
Enabling and disabling Windows features
Check the Windows subsystem and virtual machine platform suitable for Linux and confirm.
Restart the computer after a while.
Two, the installation of Linux subsystem
1. Download WSL
Enter the Microsoft Store
Search for Linux and choose to download kali Linux
Wait for the download to complete and click to start, the first start will take a long time
Enter Linux username and password to complete the first boot
2. WSL version conversion
In general, the subsystems we install are based on WSL1, and if we want to start the graphical GUI interface, we need to convert it to the WSL2 version. The method is very simple, enter the cmd command line or power shell, and enter the command
wsl -l -v
You can view the current version and subsystem name, enter the command
wsl --set-version kali-linux 2
The version can be converted to WSL2 after a while, but sometimes the installation will fail, and we will be asked to visit the official website of Microsoft.
https://docs.microsoft.com/zh-cn/windows/wsl/wsl2-kernel
This situation is generally caused by the lack of the WSL2 Linux kernel. Just visit the website and download and install the corresponding kernel file.
The file is an .msi file, which needs to be trusted and installed (the official Microsoft software will also report warnings, which is funny)
Re-execute the conversion command after the installation is complete, if the conversion still fails, you can use it
wsl --set-default-version 2
The default installation version is changed to WSL2, then uninstall the installed Linux subsystem and reinstall it.
3. Configure the software source
The official software source of the Linux system is abroad, and it will be very slow to download directly using the command. Therefore, the source mirror is generally used for downloading. The detailed tutorial can be searched by yourself. I only provide a simple method here.
Just execute the following command (here I chose the mirror image 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
Three, configure and optimize the environment
The following steps do not affect the installation and startup of the graphical interface, and are a terminal beautification I suggest.
Find and install Windows terminal in the Microsoft Store
After startup, find the lower triangle pattern in the tab bar and enter the settings
The settings of Windows terminal are based on .json files. If you don’t have a suitable editor, you can download VSCode or Sublime text.
Find the label named kali-linux in the list label, and copy the guid (including quotation marks and brackets)
Paste the just copied guid into the defaultProfile label at the beginning of the file, and save the file to realize the default startup as the Linux subsystem
You can modify various attributes of the terminal by adding the following tags to the defaults tag under profiles. Among them, only the translucent option is set to true and the transparency option can work.
"useAcrylic": true, //半透明
"acrylicopacity": 0.6, //透明度
"fortFace": "Hack NF", //字体
"fontSize": 12, //字体大小
"colorScheme": "Campbell" //主题
Finally, you can add a variety of theme colors in the square brackets of the schemes tag. The lesson can be obtained by searching by myself. I only provide one color scheme that I am using here (after setting the theme, remember to modify the theme name in the profiles accordingly)
Fourth, install win-kex graphical interface
Finally, after so much preparation, the actual GUI installation becomes very simple, only a simple line of commands is required
sudo apt install -y kali-win-kex
It is normal that the download fails, and you only need to execute the command again.
Just select the first English on the keyboard, and then wait for the installation to complete.
Then we directly enter the command
kex
You can run the GUI. When you start it for the first time, you will be asked to set a password, and then you will be prompted whether to set a read-only password. You can choose according to your personal needs. Usually, you don't need a read-only password for your own computer.
After the configuration is complete, you can enter the GUI interface (press F8 to exit the full screen).
Five, other
Since this is a subsystem, many commonly used software in Kali are not installed. If you need to install a more complete Kali, you only need to execute
sudo apt install kali-linux-large
In addition, this situation may occur when the kex command is executed.
This is caused by not executing in your home directory. Solution:
cd ~
There is another situation that
this is caused by the service not being started correctly, the solution:
kex stop
Then execute the kex command.
2020/12/1
I haven't configured the environment for a long time. I encountered a problem that I haven't encountered before. After installing the graphical interface and executing kex, an Unable to contact settings server error occurred.
After searching, it is found that the permissions are insufficient, just execute
sudo apt-get install x11-xserver-utils dconf-editor dbus-x11 -y
It can be solved.
If you are helpful, I hope you can like to support it. If you have any other questions, you can leave a message in the comment area or contact me by private message, thank you