WSL installs a graphical interface and accesses it through xrdp/X-Launch

foreword

Although it does look cool to use WSL directly, it will always be useful when the graphical interface is used. Through experimentation, I have installed gnome, xfce4, and lxde three desktops. By comparison, gnome has obvious freezes, while lxde focuses on lightweight graphics services. This article mainly introduces the process by installing xfce4.

text

After installing the graphical interface for WSL, there are two main access methods. One is to access through Microsoft's own xrdp, and the second is to access through X-Launch. Both methods have their own advantages, and it depends on which one is more suitable for you. Plant it.

1. Access via X-Launch

1. Install the VcXsrv software, just download and install it directly. If you don’t understand English, you can directly default to the next step.

https://sourceforge.net/projects/vcxsrv/

2. Install WSL

2-1 Settings - Applications - Programs and Features - Enable or disable Windows features - Windows Subsystem for Linux .

2-2 Search ubuntu in the windows application store, select the appropriate version to install, and you need to set the account password for the first time to open

3. Install the xfce4 graphical interface

Update the software package (of course, the first thing to do is to replace the apt source address, this is not exhaustive)

sudo apt-get update && sudo apt-get upgrade -y

Install the XFCE desktop environment

sudo apt-get install xfce4 -y

Install additional software to the XFCE desktop

sudo apt-get install xfce4-goodies -y

4. Configure X-Launch

4-1 Open the X-Launch software, select One large window, and select 0 for Display number

4-2 and then the crazy next step until the black window appears (ignore kun kun love song)

4-3 Add environment variables for ubuntu

export DISPLAY=localhost:0

4-4 After adding the environment variable, it needs to be updated before it can be used

source /etc/profile

4-5 Open xfce4, you need to enter this command every time you use it

startxfce4

After 4-6 is successfully opened, the previous black screen will become the xfce4 desktop environment. As shown below

4-7 This step is considered successful, but there are still several problems, such as the default browser and network problems, because there is no plan to use the WSL graphical interface frequently, so there is no management, and you can check the information online if you need it

2. Access through xrdp

1. Install the xfce visual desktop, same as above

2、xrdp

2-1xrdp introduction

Xrdp是一个开源工具,允许用户通过Windows RDP访问Linux远程桌面。 除了Windows RDP之外,xrdp工具还接受来自其他RDP客户端的连接,如FreeRDP,rdesktop和NeutrinoRDP。 Xrdp现在支持TLS安全层。

2-2 install xrp

sudo apt-get install xrdp -y

2-3 Change the port from 3389 to 3388, because the previous default 3389 port has been reserved for ubuntu shell

sudo sed -i 's/3389/3388/g' /etc/xrdp/xrdp.ini

2-4 Enable the XRDP service to allow the XFCE desktop of ubuntu to accept remote connections, and the xrdp service needs to be enabled for each connection after disconnection

sudo /etc/init.d/xrdp start

3. Connect mstsc through the built-in remote desktop connection on windows

3-1 Enter mstsc in win+r and press Enter and output localhost:3388

3-2 Enter account name and password

3-3 After the connection is successful, it should be as shown in the figure below

Summarize

This is the end of using the WSL graphical interface through xrdp or X-Launch. I will not comment on the pros and cons of these two methods. You can choose the one that suits you!

Guess you like

Origin blog.csdn.net/love906897406/article/details/126077508