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.


  • You can accept the answer by clicking the tick mark on left side of answer. – Biswapriyo Nov 10 '18 at 9:20

Let have some background first. To configure general X11 connection, we have to set the DISPLAY variable in WSL with this command export DISPLAY=:0. Also don't forget to use this export 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).

Run the server in multiwindow mode.

Enable [disable] the clipboard integration. Default is enabled.

Enable the GLX extension to use the native Windows WGL interface for hardware-accelerated OpenGL.

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.

  1. Create a shortcut with that previous command. You should mention the full path in that command. e.g. 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.

  1. Another way is to add the full command in registry with this command as administrator:
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /V VcxSrv /D "E:\VcXSrv\vcxsrv.exe :0 -multiwindow -clipboard -wgl"

Follow any one of the above two methods, not both. VcxSrv.exe will launch when you restart your PC.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.