Replies: 1 comment 3 replies
-
Take a look at https://github.com/microsoft/wslg/wiki |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This might help some of you get WSLg to work.
In WSL2, prior to WSLg it was necessary to add an export DISPLAY= entry to your .bashrc if you wanted to use VcXsrv.
Those recommended entries look like this:
export DISPLAY=$(/sbin/ip route | awk '/default/ { print $3 }'):0
OR
export DISPLAY="$(grep nameserver /etc/resolv.conf | sed 's/nameserver //'):0"
and you'll find many sites recommend one of these for WSL2 with VcXsrv.
With WSLg I found that removing these lines allowed X apps (gedit or xeyes for example) to work perfectly.
I started by just renaming .bashrc to .bashrc_old and then starting an Ubuntu command prompt. It worked fine so I did a bisect search to figure out what was the offending line.
My suggestion would be to add something to the WSLg instructions to tell users to remove any prior "export DISPLAY" command. Better still would be to prompt the user whether it's OK to comment those lines out during installation.
Beta Was this translation helpful? Give feedback.
All reactions