Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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