I work on WSL with an Ubuntu terminal. I have a problem with the display opening. I'm new to this stuff and would need help.
I downloaded Xming, run through XLaunch and in the part "Specify parameter settings" select "No Access Control". I executed export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0.
Then I executed export DISPLAY=:0 and xeyes but I still have the error message: Error: Can't open display: :0.
I tried to find a solution on the internet but could not solve the problem. Thank you very much for your help.
export DISPLAY=${hostname}.local:0.0. This uses mDNS per this post. You'll still need to make sure all of the other stuff (firewall rules, etc.) are in place, though. – NotTheDr01ds Dec 29 '21 at 15:38export DISPLAY=127.0.0.1:0.0in your bashrc or profile and you are done. With WSL2, you have an assigned virtual IP I think.. (I run WSL1 and could be wrong). Also, you can skip the scripted crap and figure out the IP you are trying to export to and type the actual IP addr in by hand until you get it working. Then backtrack to what isn't working to get that IP (or hostname) into your exported DISPLAY variable. – Señor CMasMas Dec 29 '21 at 18:51