GL on headless server

I’m able to use vaapi encoders on my server, but not GL:

$ gst-launch-1.0 gltestsrc ! fakesink -v
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstGLTestSrc:gltestsrc0.GstPad:src: caps = video/x-raw(memory:GLMemory), format=(string)RGBA, width=(int)320, height=(int)240, framerate=(fraction)30/1, texture-target=(string)2D
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw(memory:GLMemory), format=(string)RGBA, width=(int)320, height=(int)240, framerate=(fraction)30/1, texture-target=(string)2D
Got context from element 'gltestsrc0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayEGL\)\ gldisplayegl0";
ERROR: from element /GstPipeline:pipeline0/GstGLTestSrc:gltestsrc0: Failed to initialize egl: EGL_NOT_INITIALIZED

I built gst with:

gst-plugins-base 1.24.6

    GL api     : gles2, gl
    GL platform: egl, glx
    GL winsys  : egl, surfaceless, wayland, x11

Any idea how I can make this work?

Looks like I was missing gbm here, it works with it!