Skip to content

Instantly share code, notes, and snippets.

@seklyza
Created December 9, 2020 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seklyza/6b265a85843076c005907e2b385b6e45 to your computer and use it in GitHub Desktop.
Save seklyza/6b265a85843076c005907e2b385b6e45 to your computer and use it in GitHub Desktop.

Installing xserver on WSL 2:

sudo apt install xorg

append this to your bashrc:

export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -f2 -d' ')
export DISPLAY=$WSL_HOST:0.0
export LIBGL_ALWAYS_REDIRECT=1

Make sure to run source ~/.bashrc OR reopen your terminal.

Installation on Windows:

Install Vcxsrv (https://sourceforge.net/projects/vcxsrv/) for Windows.

Then try to run a GUI application, for example xclock. That's it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment