Windows Subsystem for Linux (WSL) Has Same Error
In Windows Subsystem for Linux (WSL) under Windows 10 there the file /usr/lib/i386-linux-gnu/mesa/libGL.so.1
does not exist. Instead there is the file /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
seems to replace it. However if you delete the replacement file the library doesn't work at all.
Rename library then rename back solves problem
If you rename the file and then rename it back the errors disappear and it works a lot faster:
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ lock-screen-timer
Linux version 4.4.0-43-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1-Microsoft Wed Dec 31 14:42:53 PST 2014
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ sudo ldconfig -p | grep -i gl.so
libwayland-egl.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1
libcogl.so.20 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcogl.so.20
libQt5OpenGL.so.5 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
libGL.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
libEGL.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ sudo rm /usr/lib/i386-linux-gnu/mesa/libGL.so.1
rm: cannot remove '/usr/lib/i386-linux-gnu/mesa/libGL.so.1': No such file or directory
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ sudo mv /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.ORIGINAL
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ lock-screen-timer
Linux version 4.4.0-43-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1-Microsoft Wed Dec 31 14:42:53 PST 2014
/usr/bin/zenity: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ sudo mv /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.ORIGINAL /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ lock-screen-timer
Linux version 4.4.0-43-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1-Microsoft Wed Dec 31 14:42:53 PST 2014
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$
I verified the change is persistent, ie close the WSL terminal window and open a new window.
Quick Fix From Comments
In comment below it is suggested to try https://stackoverflow.com/a/63450299/6929343:
export LIBGL_ALWAYS_INDIRECT=1
For a quick test, run:
glxinfo -B | grep renderer
NOTE: I haven't tested this solution.
What's Using the Library?
The library is used by yad
in the lock-screen-timer bash script upgraded with hybrid support for WSL in addition to Ubuntu. Yad is a fork of Zenity
which is why you see the Zenity-like Gtk-Message:
reference in the third error message above.
Here's what the yad
window looks like in Ubuntu (in WSL it's slightly different):

rm /usr/lib/i386-linux-gnu/libGL.so.1
And enjoy your cookie :)
– FabricioFCarv Feb 16 '18 at 01:22mesa
folder in/usr/lib/i386-linux-gnu/
. I tried removing/usr/lib/i386-linux-gnu/libGL.so.1
, and steam said:You are missing the following 32-bit libraries, and Steam may not run: libGL.so.1
– alephalpha Jul 05 '18 at 07:08sudo rm -rf /lib/x86_64-linux-gnu/libGL.so.1
fix it – Antoine Boucher Jan 31 '20 at 00:48