How to Run Linux GUI Applications with WSL2 on Windows
This used to be a limited feature for Windows Insider members, but regular Windows users can now take advantage of the feature as well.
If you have just upgraded to Windows 11 and want to try this feature, continue reading the following article.
Install the graphics driver
Microsoft provides driver software for 3 major GPU manufacturers: Intel, AMD and NVIDIA
To be able to run GPU-accelerated Linux GUI applications, you will have to install the latest video drivers for the hardware. Microsoft has helpfully created links to driver software for the three major GPU manufacturers: Intel, AMD, and NVIDIA.
Click on the appropriate link to download the graphics driver installation program. If you don't know what type of video hardware you have, open Device Manager from Control Panel and click Display adapters. This will show what type of video card you have.
Once you have downloaded the executable, run it to install the latest driver for the system. You may have to restart your computer when the process is complete.
Update WSL version to WSL2
Assuming you already have a working WSL installation, you just need to make sure you're using the latest version. To do that, just run this command in a PowerShell window with admin rights:
wsl --update
To force restart, use the following command:
wsl --shutdown
Open WSL again and you should now be ready to run graphical Linux applications on Windows.
Run graphical application
To run graphical applications, you can call them from the command line as you would on any other Linux system. For example, to run the graphical version of Vim, you must enter the shell:
gvim
This will launch Vim in a window. You can also launch Linux GUI applications from the Start menu. They will appear in a folder with the name of the distribution you are using. For example, with Ubuntu they will be in the "Ubuntu" folder.
Run GUI applications over the network
The great thing about X11 programs is that they can run on one machine while displaying the output on another machine over the network.
To do this with WSL, go through the process using SSH to log into a remote server with X11 forwarding enabled. On the client side, you'll need to use the -X or -Y options to enable X forwarding to your machine.
Now you can run Linux GUI applications in Windows
The ability to run Linux GUI applications in Windows is a welcome addition and makes the Windows Subsystem for Linux much more useful, as you are no longer limited to only text-based applications.
If you don't just want to run a single application but run the entire Linux desktop on Windows, you can do that too.
You should read it
- WSL2 now supports connecting Localhost from Windows 10 applications
- Run Windows applications on Linux, macOS and other platforms
- Microsoft released Windows Terminal 1.0, announcing support for the GPU and Linux GUI application in WSL
- How to use Zsh (or other Shells) on Windows 10?
- How are Linux kernel updates distributed on Windows Update?
- Linux GUI applications can run on Windows 10
- Convert data, applications from Windows to Linux in minutes
- How to convert a web application to a desktop application on Peppermint Linux
May be interested
- 5 very interesting and useful websites for Linux usershere are some websites that are well worth your time to visit, to find useful information, as well as interesting usage tips related to linux.
- How to Update Desktop MATE 1.26 on Ubuntu 21.04ubuntu mate is a flashback version of ubuntu that allows you to continue using ubuntu almost entirely the way it worked more than a decade ago.
- How to manage packages on RPM-based Linux distributions with DNFthis tutorial will show you how to install and manage software packages on rpm-based linux distributions like fedora and red hat enterprise linux (rhel) using dnf.
- How to install Laravel framework on Ubuntularavel is an open source, cross-platform php framework that is widely acclaimed by web developers. laravel is built by the symfony framework and works on the model-view-controller model.
- 7 things Ubuntu does better than Windowsyou may have heard of the linux operating system called ubuntu. if you haven't tried it yet, you may be missing out on some great features.
- How to enable minimize on click in Ubuntumany ubuntu users who come to linux after switching from windows are having to find a way to make their new linux system minimize open windows when clicking on the taskbar icon or the corresponding toolbar.