In Windows 11, WSLg is automatically activated when you install WSL. Unlike X410 which is an X-Window server, WSLg is a Wayland server. However, WSLg also has a compatibility layer for supporting X-Window client programs. The following post summarizes the differences between X410 and WSLg:

X410 vs. WSLg

If you want to disable WSLg and simply use X410, you can follow the steps described below:

Create a .wslconfig file in your Windows home folder

Your Windows home folder is usually at 'C:\Users\<Your-Windows-User-Name>'. You should also be able to open your Windows home folder by entering %USERPROFILE% to Windows File Explorer.

Add the following lines to .wslconfig

[wsl2]
guiApplications=false





Shutdown WSL

You can shutdown WSL by entering the following command from PowerShell or Windows Command Prompt:

wsl --shutdown


When you re-open your WSL distro terminal, WSLg should no longer be active; you will not see any environment variable related to WSLg (ex. WAYLAND_DISPLAY, DISPLAY or etc.).

Once WSLg is disabled, you can set up the DISPLAY environment variable for X410 as mentioned in the following post:

Using X410 with WSL2

Using WSLg and X410 together

As mentioned above, WSLg is a Wayland server in its core. Hence you can actually run both WSLg and X410. In such case, you can simply set the DISPLAY environment variable to X410 instead of WSLg.

For some GTK based X-Window client programs, you may also need to set the GDK_BACKEND environment variable to x11; some of those programs get confused when both DISPLAY and WAYLAND_DISPLAY environment variables are set.

export GDK_BACKEND=x11





Share This Story, Choose Your Platform!