I have been setting up Ubuntu on Windows 10 WSL 2 so that I can start to ssh into a workstation at my school. I haven't had issues with ssh-ing into the remote computer, but haven't been able to open a GUI with an X server.
Ubuntu 20.04.1 LTS
Windows 10.0.19041 N/A Build 19041
Issue: Whenever I try to open an X server GUI I get this- after a minute pause: Can't Open Display Error
I am running VcXsrv xLaunch with these settings that I have found in other guides.
I make sure to run export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
before I make any attempts, but I have also added it to ~/.bashrc so it shouldn't really matter.
I have modified the ssh_config and sshd_config files to uncomment the X11 forwarding.
Just in case it is important, I have been using xeyes or xclock to test.
I have been having a really tough time with this so I would appreciate absolutly anything that helps push me in the right direction. I would be happy to provide any additional information if it could help solve this issue.
Thanks to everyone!!
Quick Edit: I realized that I don't have a .Xauthority file and I am unable to generate one (gives xauth: (argv):1: unable to open display ":0".
when I try). I'm not sure if this is part of the issue.
Edit: Based on a suggestion from @harrymc I created a new vcxsrv profile using these flags: "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -ac -terminate -lesspointer -multiwindow -clipboard -wgl -dpi auto
I ran netstat -abno|findstr 6000
in an admin Powershell, and got this result, but I'm not sure how to interpret it.
Next, I installed terminator to test my changes, but no GUI window was opened and my terminal gave me these messages, with a several minute delay between [1] 47, and the second message.
Edit: Changed ~/.bashrc to export DISPLAY=localhost:0.0
. The error remains basically the same Error: Can't open display: localhost:0.0
. I am attempting to debug the DISPLAY command now.
netstat -abno|findstr 6000
in admin Powershell. Here were the results, but I wasn't sure how to interpret them. Finally, the guide had me install terminator and use it to test if it had worked. No GUI window opened, it only output this to the terminalDISPLAY=$(...
command to see what went wrong. I would have liked better the commandexport DISPLAY=localhost:0.0
, as is said in this link.