Run things that need a GLX X server on Gitlab CI

Hey, I spent a long time figuring out how to run something on Gitlab CI that needed an Xserver with GLX, so I thought I may as well post how to do it here. I specifically needed to run pyinstaller which is usually fine, but it was importing pyglet which requires an X server. Here’s how to do it on Ubuntu and Arch Linux:


apt install -y xorg-dev libglu1-mesa libgl1-mesa-dev xvfb libxinerama1 libxcursor1
xvfb-run -a -s "-screen 0 1400x900x24 +extension RANDR" -- [command]

Arch Linux:

pacman -Sy glu xorg-server-devel mesa xorg-server-xvfb libxinerama --needed --noconfirm
xvfb-run -a -s "-screen 0 1400x900x24 +extension RANDR" -- [command]