3

I try to use GUI Apps on Windows 11 via WSL and WSLg. Unfortunately my GUI app needs some custom fonts (specifically xfonts-100dpi and xfonts-75dpi). Since WSLg does not include those fonts, my GUI App crashes.

How can I install those fonts and make them available for WSLg (the x11 server)?

I've installed them for WSL itself, but it does not look like they get shared with WSLg. Even manually copying the font files from /usr/share/fonts to /mnt/wslg/fonts did not change anything.

1 Answer 1

0

It sounds like you may be running the older release of WSL that came with Windows 11 as a Windows feature.

Support for using fonts from your distribution in WSLg was added fairly recently in the WSL release that you can now install as an application package from the Microsoft Store. It does this by mounting your current distribution into the WSLg system distribution and (presumably, but I haven't double-checked) symlinking or bind-mounting /usr/share/fonts within WSLg to point to your distributions equivalent.

To install the new version, either:

  • Make sure you are on Windows 11 22H2

  • Exit WSL

  • Start a regular PowerShell (non-admin) shell and:

    wsl --shutdown
    wsl --update
    wsl --version
    
  • If that doesn't work, or if you are on Windows 11 21H2, then just manually install the new release from its Microsoft Store page.

Side-note: Windows 10 users can now also update to this release (and use WSLg). See this question for more details on the prerequisites.

2
  • This did not solve my issue. I tried the update wsl before. The update command says no updates are available and I'm currently on version 5.10.102.2. As far as I can see the fonts option is only added recently to WSL, which means in a pre-release. So is it possible that I can't update it via the command since it's only a prerelease? Im on windows 12 btw.
    – CrownUpKid
    Dec 18, 2022 at 10:30
  • @CrownUpKid Windows 12 must be a typo -- Did you mean Windows 11 22H2? Regardless, did you try my "If that doesn't work" fallback of installing from the Store page? All Windows 11 releases (which you said you were on in the main question) support the new release. Also, it's no longer in Preview -- It's generally available for all users. Dec 18, 2022 at 11:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .