Table of Contents
This tip is about the how to Use WSL2 to Run Linux GUI Apps on Windows PC. So read this free guide, How to Use WSL2 to Run Linux GUI Apps on Windows PC step by step. If you have query related to same article you may contact us.
How to Use WSL2 to Run Linux GUI Apps on Windows PC – Guide
With more applications being developed on Linux than ever before, Microsoft realized it needed to provide developers with an easy way to build, test, and run Linux applications without leaving the Windows desktop. Windows Subsystem for Linux (WSL) was originally developed to provide a Linux terminal environment integrated into Windows without the need to set up up and manage a virtual machine (VM). But what if you want to run a Linux GUI editor or other GUI application with WSL?
Microsoft announced on April 21 that WSL now supports Linux GUI apps on Windows 10 Insider Preview Build 21364. So, with build 21364 and higher, developers can run their favorite GUI editors and tools to test and build Linux apps without the hassle of installing an X server. In this article, I will show you how to update WSL to support GUI applications, how to install a GUI app on Ubuntu and finally see how Linux GUI apps integrate with the Windows UI.
Install Linux GUI applications via WSL on Windows 10
To install a Linux GUI application on Windows 10, use these steps:
In the command, replace APP-NAME with the graphical application you want to install.
This example installs the gedit text editor application:
sudo apt-get install gedit -y
After completing the steps, the application will be installed and registered in the Start menu, which means that you can start the application by running the application name in the Windows Subsystem for Linux (WSL) console or in the Start menu.
The instructions above outline the steps to install a simple app from known repositories, but depending on the app, the steps can be different. The good news is that the installation process is the same as for any other Linux application, so you can follow the developer’s steps to install virtually any application, such as VLC, Audacity, web admin, etc.
If you start the Linux GUI application from the Windows 10 Start menu, you will find entries in the “Recently Added” list or you can also find them inside the folder (distro name) below the Linux distro entry.
When starting the application, the virtual machine will spin up and run (in a few seconds) without the need to open the WSL console. You will also notice that the taskbar will show the icon with a Linux logo, indicating that you are not running a Windows 10 application.
The experience of using a Linux graphical application on Windows 10 feels native, but it isn’t. The app is rendered with all the Linux visual styles for the frame, menus and other elements, and there’s even a shadow around the frame, and each window works independently.
Install or update WSL on Windows 10
The ability to run Linux GUI applications requires integration of the Windows subsystem for Linux 2, which means you need to have the latest version of feature and distribution to install and run your applications.
If you already have WSL2 installed, you will need to update the feature.
Before installing or updating WSL2, the device will need to be running build 21364 or higher. If not, use these steps first to enroll your computer in the Windows Insider Program to update your system to the latest build on the Dev Channel, then continue with the steps below.
In addition, as a prerequisite, you also need to install the preview driver to enable a virtual GPU (vGPU) to use hardware-accelerated OpenGL rendering before installing the applications. Here are the download links:
Install WSL2 on Windows 10
These instructions will show you how to install WSL2 and Ubuntu Linux distribution to start running GUI applications. To install WSL2 components to run Linux GUI applications, use these steps:
wsl -install
After completing the steps, the necessary Linux components will be installed automatically and the command will also download the latest version of the Ubuntu Linux distribution. After installation, you just need to open the distribution from the Start menu and continue with the onscreen instructions to complete the setup.
Update WSL2 on Windows 10
If you already have the Windows subsystem for Linux 2 installed, you want to make sure the latest updates are installed to run GUI applications.
To update WSL2 to download GUI support for Linux applications, use these steps:
wsl -update
Final note
I hope you like the guide How to Use WSL2 to Run Linux GUI Apps on Windows PC. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.