Skip to content

Instantly share code, notes, and snippets.

@esdandreu
Last active November 30, 2021 13:04
Show Gist options
  • Save esdandreu/3c4cdcd8dc7be4d950c050386563604d to your computer and use it in GitHub Desktop.
Save esdandreu/3c4cdcd8dc7be4d950c050386563604d to your computer and use it in GitHub Desktop.
DISPLAY variable in WSL
export PYTHONPATH=${PYTHONPATH}:/usr/lib/python3/dist-packages
export PATH=${PATH}:/home/esdandreu/.local/bin
# set DISPLAY to use X terminal in WSL
# in WSL2 the localhost and network interfaces are not the same than windows
export DISPLAY=$(route.exe print | grep 0.0.0.0 | head -1 | awk '{print $4}'):0.0
export LIBGL_ALWAYS_INDIRECT=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment