Windows 11 has a lot of new features, but one particularly welcome feature is the Windows Subsystem for Linux or WSL. WSL users can now run graphical Linux applications as well as standard command line programs. 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
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:
To force restart, use the following command:
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:
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”.
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 will need to use options -X or -Y 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.
Source link: How to Run Linux GUI Applications with WSL2 on Windows