How to Run Linux GUI Apps With WSL2 on Windows

How to Run Linux GUI Apps With WSL2 on Windows

With the latest version of Windows Subsystem for Linux (WSL2), you can now run graphical Linux apps on Windows.


laptop-with-notebook

Windows 11 has a lot of new features, but one is particularly welcome for users of the Windows Subsystem for Linux, or WSL. WSL users can now run graphical Linux apps as well as standard command-line programs. This used to be a feature limited to Windows Insider members, but regular Windows users can now take advantage of this feature as well.

If you just upgraded to Windows 11 and are eager to try this out, read on.

Install Graphics Drivers


Links to update windows graphics drivers

To be able to run GPU-accelerated Linux GUI apps, you’ll have to install the latest video drivers for your hardware. Microsoft has helpfully created links to driver software for the three major GPU makers: Intel, AMD, and NVIDIA.

Download: Graphics drivers for WSL2

Follow the appropriate link to download your graphics driver installation program. If you don’t know what kind of video hardware you have, open up Device Manager from the Control Panel and click “Display adapters.” This should show what kind of video card you have.

Once you’ve downloaded the executable, run it to install the latest drivers for your system. You may have to restart your computer when it’s finished.

Updating WSL Version to WSL2

Assuming you already have a working WSL installation, you just have to make sure you’re using the latest version. To do that, just run this command in a PowerShell window as administrator:

MAKEUSEOF VIDEO OF THE DAY
wsl --update

To force a restart, use this command:

wsl --shutdown

Open WSL again and you will now be ready to run graphical Linux apps on Windows.

Running Graphical Apps


wslg-gvim

To run graphical apps, 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’d type this at the shell:

gvim

This will launch Vim in a window. You can also launch Linux GUI apps from the Start menu. They’ll appear in a folder with the name of the distro you’re using. For example, with Ubuntu, they’ll be in the “Ubuntu” folder.

Running GUI Apps Over the Network


wslg-ssh

The great thing about X11 programs is that they’re network-transparent, meaning that they can run on one machine while displaying their output on another machine over a network.

To do this with WSL, SSH into a remote server that has 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 Apps in Windows

The ability to run Linux GUI apps in Windows is a welcome addition and makes Windows Subsystem for Linux much more usable, as you’re no longer limited to just text-based apps.

If you don’t just want to run a single app but a whole Linux desktop on Windows, you can do that too.


run-linux-windows-subsystem
How to Run a Linux Desktop Using the Windows Subsystem for Linux

Windows Subsystem for Linux comes without a desktop. Here’s how to install a WSL desktop environment like GNOME or LXDE on Windows.

Read Next


About The Author

Original Link

Leave a Comment

Your email address will not be published.