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.
Does not work
I don’t have the folder c:\ProgramData\Microsoft\WSL\
use this command in powershell
notepad “$env:USERPROFILE/.wslgconfig”
Doesn’t work for me
For the ones that does not work, in the .wslgconfig file, instead use the property:
WESTON_RDP_FRACTIONAL_HI_DPI_SCALING=true
I was facing the same problem, but after reading some documentation at https://github.com/microsoft/wslg/wiki/WSLg-Configuration-Options-for-Debugging, i see that the property might change.
It star working for me when using this new property.
I got it to work by the following:
1. As administrator wsl –shutdown
2. as user create / edit file .wslgconfig in your c:\users\name\
In that file put the following lines:
[system-distro-env]
WESTON_RDP_DISABLE_FRACTIONAL_HI_DPI_SCALING=false
WESTON_RDP_FRACTIONAL_HI_DPI_SCALING=true
not work for me 🙁
Chris Bruner solution worked, make sure that you replace c:\users\{YOURNAMEHERE}\.wslgconfig