I have Ubuntu 18.04 LTS WSL in y Windows 10 pro. To set graphic user interface in Linux bash shell I installed XLaunch. But to use GUI in my WSL for every login in my pc I need to launch XLaunch. Is it possible some how to launch XLaunch once and it remains as long as I use bash shell in windows 10.
Thanks,
Best Answer
Let have some background first. To configure general X11 connection, we have to set the
DISPLAY
variable in WSL with this commandexport DISPLAY=:0
. Also don't forget to use thisexport LIBGL_ALWAYS_INDIRECT=1
command which enables direct rendering. If these were done then go to the next step: configuring VcxSrv.VcxSrv has many command line options (XWin man page). You can get the option details with
vcxsrv.exe --help
command. For WSL, mainly three options are required (can be changed).The command will be:
vcxsrv.exe :0 -multiwindow -clipboard -wgl
.Now the final step is to launch it before WSL launches. There may be multiple ways to do this. Here I mention two of them.
E:\VcXSrv\vcxsrv.exe :0 -multiwindow -clipboard -wgl
. Here is a screenshot.Then put that shortcut in
%AppData%\Microsoft\Windows\Start Menu\Programs\Startup
folder to automatically start VcxSrv when PC boots up.Follow any one of the above two methods, not both.
VcxSrv.exe
will launch when you restart your PC.