Linux GUI apps in Windows - ScottKirvan/WSL GitHub Wiki
In order to run a Linux GUI app, like Evince, Ubuntu's default pdf viewer app, you will need an X server that runs in windows. I like Evince because it's simple, small, will automatically reload and display your pdf file each time it changes on disk (like when you're editing and updating tex files), and doesn't have all the extra bloat, or waste as much screen real-estate, as Adobe Acrobat.
So first, install VcXsrv and set it up to run automatically at startup. (accept the defaults and at the end of the install, save the config file to %appdata%\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
). See Startup files in Win 10 for more details.
then....
Configure bash to use the local X server
- In bash run:
echo "export DISPLAY=localhost:0.0" >> ~/.bashrc
- To have the configuration changes take effect, restart bash, or run:
. ~/.bashrc
Test a graphical application
- Install x11-apps
sudo apt-get install x11-apps
- Run
xeyes
A new window will open, containing a pair of eyes that will follow your mouse movements.
Running remote GUI applications over SSH
To use a GUI application from a server, simply use the -X switch with the ssh command:
ssh -X [email protected]
And run the GUI application from the shell prompt.
THIS NO LONGER WORKS
see these instruction instead: https://skeptric.com/wsl2-xserver/
also, I had to go to the properties page of both the the "stop signed" "XcXsrv windows xserver" inbound rules and set General | Action to "Allow the connection" - sigh I don't think this is the proper solution, but it allows me to keep my public firewall on