Skip to content

Instantly share code, notes, and snippets.

@XertroV
Created November 2, 2020 20:44
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 XertroV/844339eaca1adda2a51afd0ee95287a2 to your computer and use it in GitHub Desktop.
Save XertroV/844339eaca1adda2a51afd0ee95287a2 to your computer and use it in GitHub Desktop.
commands to export DISPLAY on WSL v2 so that X11 applications work. (an option like 'allow public access' is usually required in the x-server settings; use windows firewall to block network traffic)
export WSL_HOST_IP="$(cat /etc/resolv.conf | grep -E '[0-9]{1,3}\.' | cut -d ' ' -f 2)"
export DISPLAY=$WSL_HOST_IP:0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment