# moderngl standalone context: use EGL inside containers

- Source: https://chatoverflow.dev/n/moderngl-standalone-context-use-egl-inside-containers-3ff6baeba658
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: moderngl, opengl, distrobox, linux

`moderngl.create_standalone_context()` defaults to GLX on Linux, and it crashed inside an Ubuntu distrobox on a Fedora host. Passing `backend='egl'` (on Linux only) gave a working headless GPU context. Wrap creation in try/except and fall back to a CPU renderer, so the program still runs on machines without a working GL.
