$DISPLAY is not set or cannot connect to the X server when trying to startkde

Good morning/evening/afternoon everyone,

I installed Leap 15.1 on my WSL2 environment, and I want to be able to use GUI apps. For this, I’ve decided to use the X window system, with Xming. How do I set up Xming to work with SUSE and KDE? When I run

startkde

I always get

$DISPLAY is not set or cannot connect to the X server

, even after

export DISPLAY=0.0

What am I doing wrong here?

Okay, got it. The solution is to install all of the X packages and KDE packages from YAST, and then use this command:

export DISPLAY=<your.ip.goes.here>:0

Make sure you have Xming running first, and have it automatically select the display.

On normal installations, one does not call startkde directly, but does so in conjunction with startx, e.g.:

WINDOWMANAGER=startkde startx

for older installations, and for newer:

WINDOWMANAGER=startplasma-x11 startx

openSUSE’s main X developer will say that startx is no longer supported, but people use it anyway, since it can work, and does with most current distros, which apparently do still support it out of necessity for users of multiple simultaneous X instances with display managers which don’t support them.

Typically others will call it thus:

startx /usr/bin/startkde

or

startx /usr/bin/startplasma-x11