WSL Tutorial (3) Configuring SSH and Desktop Environment

1. Install SSH

WSL's Ubuntu does not seem to have an automatic SSH service, which needs to be installed:

Bash
1
sudo apt install openssh-server

2. Configure SSH

After the installation is complete, the SSH port can be modified:

Bash
1
sudo sed -i '/Port /c Port 2222' /etc/ssh/sshd_config

That is, change the port to 2222. If you are really not used to the command line, you can use the pagoda to modify it.

Reference article:

Install Pagoda 7.9.0 Enterprise Edition
https://blog.tsinbei.com/archives/293/

3. Set key login

Reference article:

4. Install the desktop environment

4.1, install X Server

First install X Server in Windows, download address:

VcXsrv Windows X Server
https://sourceforge.net/projects/vcxsrv/

The download speed is very slow, it is recommended to use the Qingbei network disk, the peak download speed is 100Mbps:

Comment first then view it after your comment is approved. Join QQ Group to display all hidden texts.

After the download is complete, click the button all the way to complete the installation, I don’t need to teach you (

4.2, install Ubuntu desktop

implement:

Bash
1
2
echo "y"|sudo apt-get install ubuntu-desktop unity compizconfig-settings-manager
dpkg-reconfigure dbus && service dbus restart

Then click on X Launch on the Windows desktop:

X Launch

Keep going to the next step until a black window with no title bar appears, return to WSL, enter:

Bash
1
2
export DISPLAY=localhost:0
sudo ccsm

Back to X Launch, configure:

Gerneral

Effect

Utility

Switch back to WSL and execute:

Bash
1
sudo compiz

Go back to X Launch again, done!

Effect display

5. Install Chinese support

implement:

Bash
1
sudo apt-get -y install language-pack-zh-hans

Will

Text
1
2
3
4
export DISPLAY=localhost:0
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8

Add to /etc/profile and reload:

Bash
1
2
source /etc/profile
locale-gen

The desktop environment will run as the root user.

refer to

Run any Desktop Environment in WSL
https://github.com/Microsoft/WSL/issues/637

WSL Tutorial (3) Configuring SSH and Desktop Environment

https://blog.tsinbei.com/en/archives/690/

Author
Hsukqi Lee
Posted on

2023-05-18

Edited on

2023-05-18

Licensed under

CC BY-NC-ND 4.0

Comments

Name
Mail
Site
None yet