SDL failed to initialize on pipeline server- installing Mir

I have been getting an SDL error “Failed to connect to the Mir Server” in my pipeline test builds. I tried installing Mir with the command “apt-get install -y unity-system-compositor && apt-get install -y ubuntu-desktop-mir && restart lightdm” as per https://wiki.ubuntu.com/Mir/Installing in .gitlab-ci.yml but then the process involves selecting a country for the keyboard at which point it can no longer continue as it is waiting for input.

How can I fully automate the installation? Or is there another way of doing this? Any help would be appreciated.