diff --git a/fossils-win.spec b/fossils-win.spec
index 3862edbbb060c5584c048ce5339e8d21fc1b6303..4884ff97b07782ff844f7d467b5df2549bbae11b 100644
--- a/fossils-win.spec
+++ b/fossils-win.spec
@@ -2,7 +2,7 @@
 
 # BUILD DIST:
 #   load environment
-#   pyinstaller --noconfirm fossils.spec
+#   pyinstaller --noconfirm fossils-win.spec
 
 block_cipher = None
 
@@ -63,13 +63,29 @@ exe = EXE(
     entitlements_file=None,
     icon='gui/icons/fossils.ico',
 )
-coll = COLLECT(
-    exe,
-    a.binaries,
-    a.zipfiles,
-    a.datas,
-    strip=False,
-    upx=False, # works well but slower runtime
-    upx_exclude=[],
-    name='fossils',
-)
+
+# when using VBox + mesa drivers installed on c:\Python310\python.exe, 
+# mesa dlls are copied into the installer which makes
+# gmsh display crash at runtime.
+# => we manually remove the libraries related to openGL (they are not present when built outside a vbox)
+# see https://stackoverflow.com/questions/58097858/how-to-exclude-opengl32sw-dll-from-pyqt5-library-when-using-pyinstaller
+to_keep = []
+to_exclude = {'opengl32.dll', 'libglapi.dll', 'libgallium_wgl.dll'}
+for (dest, source, kind) in a.binaries:
+    if os.path.split(dest)[1].lower() in to_exclude:
+        print(f'removing {source}')
+        continue
+    to_keep.append((dest, source, kind))
+a.binaries = to_keep
+
+if 1:
+    coll = COLLECT(
+        exe,
+        a.binaries,
+        a.zipfiles,
+        a.datas,
+        strip=False,
+        upx=False, # works well but slower runtime
+        upx_exclude=[],
+        name='fossils',
+    )