WSSL Tips and Tricks: Launching graphical applications on Ubuntu 20.04 with Xming

Introduction:

In this guide I will be showing you how you can launch graphical applications from your Windows Subsystem for Linux install. This guide will be aimed at Ubuntu users although it should work on any Debian based distro (and probably others too).

Requirements

To do this, you will need the following:

Exporting your display

First thing we need to do is to launch our Linux shell and edit our bashrc file using our editor of choice. Il be using nano in this guide but feel free to use vim, emacs or whatever you feel like!

nano ~/.bashrc

In this file, scroll down to the bottom and add the following:

export DISPLAY=:0

Save and exit the file (for nano users, that Ctrl +o and then enter to save and Ctrl + x to exit). We then want to source our bash file to apply our new export

source ~/.bashrc

Getting a X Server for Windows

We now need an X Server for windows. The one we shall be using is named Xming. This can be download this here. If you like this project, please go and donate at the Xming website.

Once downloaded, go ahead and install it. Spam clicking next and accepting the defaults should work fine. On the last window, check the Launch Xming box and click finish.

Launching applications

At this point, as long as Xming is running, you should be good to run any graphical application you like. To prove the point, I've installed the x11-apps to get access to xcalc.

sudo apt install x11-apps

Once installed, a calculator can be launched using this command

xcalc