I tried to run echo $DISPLAY
but it doesn't return anything, just a blank line.
I read that it's supposed to return something like :0
. Why is this happening and how do I fix it?
I tried to run echo $DISPLAY
but it doesn't return anything, just a blank line.
I read that it's supposed to return something like :0
. Why is this happening and how do I fix it?
DISPLAY
variable, since Windows 10 WSL doesn't support Linux graphical apps by default. See this question for ways to do that on Windows 10 or Windows 11 - What's the easiest way to run GUI apps on Windows Subsystem for Linux?. Thanks! – NotTheDr01ds Apr 19 '22 at 10:54export DISPLAY=:0
and at least now I get:0
when runningecho $DISPLAY
. Plus I get a different error in the code I'm trying to run, so I guess that's progress! – qwertpoi Apr 19 '22 at 11:02:0
will only work under WSL1. As noted in my answer on the question I linked, on WSL2 (with Windows 10, as I assume you are using), you'll needexport DISPLAY="$(hostname).local:0"
. You'll also need a third-party X11 server such as VcXsrv. – NotTheDr01ds Apr 19 '22 at 11:05echo "$(hostname).local:0"
? As for the X server, there are quite a few links to VcXsrv in the question linked above. I think some others are mentioned and linked as well in there. – NotTheDr01ds Apr 30 '22 at 21:18