Setup and Problem-Solving in WSL2

Notes about working in WSL!

How to set up working X11 forwarding on WSL2?

  • Installing the desktop (GUI) in WSL
1
2
sudo apt update
sudo apt upgrade

Then by the following command, we can install the light ubuntu desktop

1
sudo apt install lxde

In the next step, the VcXsrv Windows X Server utility should be installed in windows.
After installation, we should open VCxsrv software and set the Initial setting.
Then we should run the following commands in ubuntu terminal1.

make sure to check ‘disable access control’ when configure Xlancher

Add the following to your ~/.bashrc2:

1
2
3
4
5
export DISPLAY=$(ip route list default | awk '{print $3}'):0
export LIBGL_ALWAYS_INDIRECT=1
startlxde
# main command to run the desktop
# each time that we want to use it we should rerun the last three commands

*: If you use VcXSrv you can enable public access for your X server by disabling Access Control on the Extra Settings.

Install SNAP in WSL

Download SNAP and Install

1
2
3
4
yuchi@DESKTOP-C79LC47:~/Downloads/snap$ wget https://download.esa.int/step/snap/8.0/installers/esa-snap_sentinel_unix_8_0.sh

yuchi@DESKTOP-C79LC47:~/Downloads/snap$ chmod +x esa-snap_sentinel_unix_8_0.sh
yuchi@DESKTOP-C79LC47:~/Downloads/snap$ ./esa-snap_sentinel_unix_8_0.sh

SNAP install in WSL

All DONE! Enjoy SNAP in WSL.

Suddenly all worked out when download snap2stamps in WSL2, but not runing in actural windows..

Enjoy processing!