Running Graphical Linux/X programs on Windows 10

Windows 10 comes with a very handy Windows Subsystem for Linux. This lets you set up a linux environment (Ubuntu/SuSE/Redhat etc.) and run linux commands, use linux utilities, and interact with the windows filesystem.

What it doesn’t let you do however is run graphical applications.

One of the nice things about Xwindows is that you can run applications on different displays, even different machines. ( Oh the fun we had in the days before security was a concern and we could display any program on someone else’s desktop 🙂 )

And Xwindows is what comes to the rescue here to allow us to run GUI applications. Download and install xming. The install is really easy and when it’s running you’ll get little X iocon in the windows tray. Hover your mouse over it and it’ll say something like “xming Server:0.0”.

Now back in your WSL terminal do:

$ export DISPLAY=:0

Then run your gui application and it will appear!

There are some limits to this and you may get errors such as:

(gpredict:1100): GLib-GObject-WARNING **: 14:23:52.599: invalid unclassed pointer in cast to 'GtkProgressBar'
(gpredict:1100): Gtk-CRITICAL **: 14:23:52.604: gtk_progress_bar_set_fraction: assertion 'GTK_IS_PROGRESS_BAR (pbar)' failed

but by and large things will just work.

Leave a Comment

Your email address will not be published. Required fields are marked *

Exit mobile version