2

I've started using the Win-Kex package in order to create a GUI for WSL2 Kali Linux. It runs okay, however the tigerVNC viewer appears blurry & hard to read. enter image description here After investigating, I discovered that it is caused by Windows scaling and layout setting (which is set to the default of 150%). If I change this to 100% Kali Linux appears fine, however then Windows icons and text is too small. enter image description here I knew there used to be a trick to change the high DPI settings for individual apps (however, as the exe is hosted in WSL I am unable to use this setting)

Any idea's on how to fix this?

Thanks, Jack

Jack
  • 21
  • 2
  • 2
    I’m voting to close this question because it seems to be how to configure the (non-Unix) display host's windowing system, not about anything within the Unix or Linux world. It might be better suited to [su]. – Toby Speight Jul 07 '23 at 12:32

3 Answers3

0

I think I got this figured out on Windows 11. I set my scaling to 100%. Then I adjusted test size in Settings > Accessibility > Text Size.

0

Changing text size sadly also applies to external non high-dpi screens.

Also, at least on my Windows 10 laptop, the text scaling looks very ugly (distroying the styling of apps) and only applies to some text elements, leaving others and also icons much too small.

Therefore, I was very unhappy with this solution and searched on:

The Windows taskmanager tells us the executable path of our VNC client: "\wsl.localhost\kali-linux\usr\lib\win-kex\TigerVNC\win-kex-win-x64"

Copying that over to our Windows drive (and adding the .exe file-extension) enables us to change the compatiblity settings:
Windows Explorer -> file context menu -> Properties
-> Tab: Compatibility -> Change high DPI settings
-> Check: "Override high DPI scaling behavior."
-> Dropdown select: "Application"

searching for the binaries name in Windows' registry shows us what that did:

Folder: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
Key: C:\path-to-copy\win-kex-win-x64.exe
Type: REG_SZ
Value: ~ HIGHDPIAWARE

Disconnecting the autostarted VNC client (F8 -> dis_c_onnect) And using the copy to connect to kali_linux_ip:5901 Allows kali's X server to make use of the native resolution of your screen.

Open questions:

  • Can we somehow apply the same compatiblity setting to the original client's path?
    Changing the registry key from "C:\path-to-copy\win-kex-win-x64.exe"
    to "\wsl.localhost\kali-linux\usr\lib\win-kex\TigerVNC\win-kex-win-x64" sadly doesn't seem to do anything.
  • How can we make kex start the X-server with the correct native resolution?
xogoxec344
  • 11
  • 3
0

You can try this solution, it is based on the answer of @xogoxec344 and makes a few changes, we can locate and modify the executable program responsible for starting the Kali WSL distribution and adjust its DPI settings. I succeeded through this approach.

According to the WSL documentation, we can start the Kali WSL distribution in the Windows host system's CMD / PowerShell by executing kali, which is the abbreviated form of kali.exe in CMD / PowerShell. In reality, kali.exe corresponds to an executable file located in one of the paths within the system environment variable Path.

So you can try these steps:

  1. find the path to kali.exe using the command

    Get-Command -ShowCommandInfo kali
    
  2. open the folder containing kali.exe using Windows Explorer

  3. Right-click on kali.exe and select Properties from the context menu.

  4. Go to the Compatibility tab and click on Change high DPI settings.

  5. In the resulting sub-window, select Use this setting to fix scaling problems for this program instead of the one in settings

you can also refer to my post https://www.pwn.fan/en/post/Issues-Series-Blurry-Screen-in-Kali-When-Connecting-By-Win-KeX-In-WSL/ for the details.

pwnfan
  • 1
  • 1