Windows 10’s Bash shell doesn’t officially support graphical Linux desktop applications. Microsoft says this feature is designed only for developers who want to run Linux terminal utilities. But the underlying “Windows Subsystem for Linux” is more powerful than Microsoft lets on.
It is possible to run graphical Linux applications in Windows 10, but bear in mind that it isn’t officially supported. Not every piece of Linux software works, and graphical applications are even more complex and less tested. But these should become more stable over time as Microsoft improves the underlying Windows Subsystem for Linux.
Windows 10’s Bash shell only supports 64-bit binaries, so you can’t install and run 32-bit Linux software.
Step One: Install an X Server
There are several different X servers you could install on Windows, but we recommend Xming. Download it and install it on your Windows 10 PC.
The installation process is simple: You can just accept the default settings. It will then automatically launch and run in your system tray, waiting for you to run graphical programs.
Step Two: Install the Program
You can install graphical Linux desktop programs like you can any other program, using the apt-get command in the Ubuntu-based Bash environment. For example, let’s say you’d want to install the graphical, GTK-based vim editor. You’d run the following command in the Bash window:
sudo apt-get install vim-gtk
It will go through the installation process in the command line window, just like it does on Ubuntu.
Step Three: Set Your Display Environment Variable
Now, you’ll need to set the “DISPLAY” environment variable to point at the X server running on your Windows 10 PC. If you don’t do this, graphical applications will simply fail to launch.
To do this, run the following command in the Bash environment:
This setting only applies to your current Bash session. If you close the window, Bash will forget it. You’ll have to run this command each time you reopen Bash and want to run a graphical application.
Step Four: Launch an Application
You can now just launch a graphical application by typing the name of its executable, like you’d type any other command. For example, to launch vim-gtk, you’d run:
It’s that simple. If the application crashes after launching, the Linux system calls it requires may not be supported by the Windows Subsystem for Linux. There’s not much you can do about this. But give it a shot, and you may find that the apps you need work decently well!
You can also combine the third and fourth steps, if you like. Rather than exporting the DISPLAY variable once for an entire Bash shell session, you’d just run a graphical application with the following command:
For example, to launch gvim, you’d run: