Graphical Linux applications in WSL2 too small?
In Windows 11, the new Linux environment (WSL2) can now also run graphical programs. These are displayed in a separate window and can be used like normal Windows programs.
However, there are problems with devices that use a high resolution, such as my Microsoft Surface Pro 7.
The Linux applications were displayed with the native resolution by default, not with the Windows scaling. The display was thus very small and barely legible.
Configure High DPI for Linux Applications for Windows Subsystem for Linux
For the configuration, we create a file named “.wslgconfig” in the following folder:
c:\ProgramData\Microsoft\WSL\
Admin rights are necessary for access. To do this, we best start an editor with admin rights. In the file we insert the following lines:
[system-distro-env] WESTON_RDP_DISABLE_FRACTIONAL_HI_DPI_SCALING=false
Done! Now we have to restart the Linux subsystem. For this we open a Powershell, also with admin rights. With the following command, we restart the Linux subsystem:
wsl --shutdown
If we now start the GUI application again, it will scale like our Windows applications.