ariya.io About Talks Articles

Linux Graphical Applications on Windows

3 min read

While Linux text-oriented command-line tools run natively on Windows 10 these days, there is also the possibility of running the graphical applications which use X11. All we need is the corresponding X Server on the Windows side.

Fortunately, there is a few choices. The most popular one is likely Xming, which can be installed via Chocolatey as:

choco install xming

Note that if you are still not using Chocolatey yet, I highly recommend trying it out. A package management tool as Chocolatey can simplify a lot of mundane tasks, particularly for installing, removing, and updating applications.

An alternative is to use VcSrv, also easy to install:

choco install vcsrv

After that, launch Xming or VcSrv first. The launcher has a few different options, usually the default one should work just fine.

The next step is to start Linux through Windows Subsystem for Linux. Right now, WSL supports a variety of distributions, from Debian, OpenSUSE, and Ubuntu. The following illustration demonstrates the usage on Ubuntu 18.04 (LTS) but the principles remain the same.

We need to tell the X11 graphical applications to connect to the X Server on the Windows side. This is done as follows:

export DISPLAY=:0

Now starts the apps. A good test is the classic xeyes utility. When it is launced (xeyes) Xming will pop up the window of this utility. Obviously, it is also possible to run other more heavier applications, e.g. Firefox.

X11 Firefox on Windows

Since WSL is still pretty limited, there are a number of things you can’t do yet with this setup. For instance, audio is missing which means watching video on YouTube using Firefox on Linux is not a pleasant experience. The same problem goes with playing various games with a serious sound effect. There is a workaround, but you have to get your hands dirty and compile a custom PulseAudio.

WSL also does not support CUDA/GPU access yet (vote for this feature) and hence any applications which rely on OpenGL (without a possible fallback) will fail rather miserably. That means, if you want to run things like Tensorflow, always choose the version which can work with the CPU only.

Running other applications which requires OpenGL can be tricky. First make sure you use the latest Xming/VcSrv which supports native OpenGL. When launching Xming/VcSrv, do not accept the default. Make sure to choose One large windows (instead of Multiple windows) and that Native opengl is checked.

After that, let’s say we want to run Falkon, a browser which utilizes QtWebEngine (and hence Chromium, which needs OpenGL):

sudo apt install -y falkon
falkon

If you have a favorite app that is Linux only, there is no excuse not to enjoy the app also on Windows!

Related posts:

♡ this article? Explore more articles and follow me Twitter.

Share this on Twitter Facebook