WSL2 configuration GUI-MATE

  • Author:ZERO-A-ONE
  • Date:2022-06-25

I personally feel that MATE is more beautiful and compatible with Ubuntu than XFCE recommended by most tutorials, and the Chinese compatibility is very good

0x1 install

Install xrdp (an open source Remote Desktop Protocol (RDP) server)

sudo apt-get update
sudo apt-get install xrdp 

Install a desktop environment (running on a Unix-like operating system, providing a lightweight desktop environment)

#MATE桌面
sudo apt-get install mate-desktop mate-core mate-desktop-environment mate-notification-daemon

Configure xrdp default startup environment

sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n mate-session \n' /etc/xrdp/startwm.sh

Open the port and restart the xrdp service

# allow just RDP through the local firewall
sudo ufw allow 3389/tcp
# restart xrdp 
sudo /etc/init.d/xrdp restart

0x2 Configure Chinese

Open another terminal on WSL and execute the following command to install Chinese support (if the current user is not root, add sudo before the command)

apt-get -y install language-pack-zh-hans

Add the following environment variables to /etc/profile the file

export DISPLAY=localhost:0

export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8

Reloadprofile

source /etc/profile

redonelocale

sudo locale-gen

If you need to start the desktop environment with other users, you must reconfigure ccsm and other components. Of course, we can also copy the configured configuration files to other accounts. The method is: put the user directory of the configured desktop environment (cd ~) Copy the .cache folder to other user directories

0x3 remote connection

You can use the Microsoft remote desktop link to view the IP of the machine in WSL, fill in and connect

Guess you like

Origin blog.csdn.net/kelxLZ/article/details/125463833