Skip to content

Instantly share code, notes, and snippets.

@NobodyXu
Last active January 23, 2020 03:23
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 NobodyXu/326c4ce36ec6ff77f2d8f574500c739b to your computer and use it in GitHub Desktop.
Save NobodyXu/326c4ce36ec6ff77f2d8f574500c739b to your computer and use it in GitHub Desktop.
Run WSL with GUI

cygwin/x

First, install cygwin/x. If no mirror are found, google 'cygwin/x mirrors' and you shall find many. Make sure xorg is always installed. Then, open "XWin server" file location from start menu, add -- -listen tcp to the end of target.

WSL

Inside wsl, copy /mnt/c/cygwin64/home/${YOUR_USERNAME_HERE}/.Xauthority to ~/, and then add export DISPLAY=:0 to ~/.bashrc. Then restart your bash by exec bash or run source ~/.bashrc to read in the configurations.

Test

Run sudo apt install -y x11-apps to install x11 apps like xclock, xeyes and etc, then run xclock/xeyes or any GUI application. It shall work fine now.

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