0

I configured vcxsrv on windows 10 and other steps required for GUI to work. Now I typed in gvim command on WSL after around 5-10 mins it showed the following error messages

E233: cannot open display
Press ENTER or type command to continue
E852: The child process failed to start the GUI

Have also added the following line to the .bashrc file
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
If I run the command startxfce4 it just displays the message :
/usr/bin/startxfce4: X server already running on display 172.26.32.1:0 and then freezes
what could be the reason for this? Any ideas how to go about running GUI on WSL2?

sunny
  • 1

1 Answers1

0

BTW,I would have put this in a comment (as it is not a complete solution for you) but there isn't enough room in a comment for all of this information.

For starters, you don't run a full window manager as your exported display.

This isn't VNC (it's much better).

WINDOWS vcxsrv is your window manager in this context.

First, skip the fancy export DISPLAY command.. just type it in by hand until you get it working. as in export DISPLAY=<IPADDR_HERE>:0.0

Get that address from windows using the command wsl hostname -I.

Now, add xterm and use it to test if the exported display is working (it has as few dependencies as possible).

Now, use that xterm to try to fire up gvim.

When you get this scenario working, you can go back to trying to automate the functionality.

There is nothing special about using x11 forwarding under WSL1 or WSL2.. you can take the advice from people in Linux forums explaining how to do it.