I'm not really asking a question, but this ___ website won't allow me to do this any other way.

I ran into a problem today using GTK under Win10's Linux subsystem (specifically Ubuntu 18.04). The error msg was:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

Someone else ran into this while using Steam, and there are some answers here: Steam libGL error. The second answer, "Windows Subsystem for Linux (WSL) has same error", is the one that led me to the solution, however that answer didn't work out of the box.

Their answer concerns a directory /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1. That directory does not exist in my system, but I'll provide the solution that did work on my stem in my answer (to myself).

I realize this is a terribly clumsy way to answer this question. However, I felt it was important to answer it, because it took me a lot of fiddling around to find an answer that worked for me, and others may have the same issue. I couldn't leave an answer on the original question, because it's been closed; and I couldn't comment on the answer that led me to the solution, because I don't have sufficient reputation. And I couldn't post to the meta-questions either. Can you say "Catch-22"? I knew you could.

  • Answering your own question is totally okay. No need to apologize. – Parto Mar 19 '19 at 19:26
  • Thanks--it just seems like doing this results in a proliferation of questions on the same/ similar topics. I would think it would be better if I could have commented to the answer on the original question, but that's not allowed (I don't have sufficient reputation). – Mike Maxwell Mar 19 '19 at 21:11

Add LIBGL_ALWAYS_INDIRECT variable to /etc/bash.bashrc solved my error.


Don't know what's the actual usage. But maybe useful, because XLauch confg says it requires this.

My error occurs when invoke emacs from wsl2, and display in XLauch (vcxsrv):

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

I find the solution according to:

  • Actually, when you launch XLaunch, in the final step of settings, under Native opengl, it reminds you to export LIBGL_ALWAYS_INDIRECT. – npojo Jan 13 at 15:00

Again, apologies for answering my own question, but this seems to be the only way to put up an answer to the problem, as I detailed in my question.

On my Win10 Linux Ubuntu subsystem, the mesa drivers were in this directory: /usr/lib/x86_64-linux-gnu/; unlike the answer linked to above, there was no Mesa (or mesa, or...) subdirectory. So I created a tmp dir somewhere else, and moved the mesa drivers (two, plus two links) to that tmp dir. And now my GTK-based app works.

The two drivers were /usr/lib/x86_64-linux-gnu/libEGL_mesa.so.0.0.0 and /usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0.0.0; the two links were /usr/lib/x86_64-linux-gnu/libEGL_mesa.so.0 and /usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0. The cmd to move the files was sudo mv /usr/lib/x86_64-linux-gnu/*mesa* tmp/ (make sure the tmp/ dir is not in a place where library files live).

I make no claims about whether the mesa drivers are needed for something else, which is why I moved them to a tmp/ dir rather than deleting them. But after moving them, my GTK app worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.