vcxsrv
Note: This setup of VcXsrv seems not necessary on Windows 11 clients. You still might have to adjust your .bashrc file (see below).
When using the Windows Subsystem for Linux one often also wants to install a X-server for connecting the graphical output of the WSL to the Windows desktop. We recommend to use VcXsrv Links to an external site.. Once installed there should be a program called XLaunch .
After installation there are a couple of configuration tweeks that have to be done in order for it to work correctly.
When using XLaunch for the first time select Multiple Windows, then Start no client, then All extra settings and Disable access control. After this save the configuration somewhere easily accessible, e.g. on the desktop.
Double clicking on the configurastion file will start a client. After starting a client there should be a firewall message. Private and global access for VcXsrv has to be granted.
The last step is to adjust the configuration inside the WSL Linux system by adding the following two lines the .bashrc file in the home directory. This can be done as follows:
nano $HOME/.bashrc
Scroll to the end of this file and add these two lines:
export DISPLAY=$(/sbin/ip route | awk '/default/ { print $3 }'):0
export LIBGL_ALWAYS_INDIRECT=1
Save with Ctrl-S and quit the editor with Ctrl-X.
To activate this new configuration the WSL should simply be restarted (close the terminal and start again).