UE5 Headless Dedicated server crashing on startup Linux

Hi there,
We recently moved project from ue4 to ue5

after updating our build scripts and project
we made a linux dedicated server build.

but it always crashes on startup with :

error: XDG_RUNTIME_DIR not set in the environment.
LogInit: Warning: Could not initialize SDL: No available video device
LogLinux: Warning: MessageBox: Plugin 'OpenXR' failed to load because module 'OpenXRHMD' could not be found.  Please ensure the plugin is properly installed, otherwise consider disabling the plugin for this project.: Message: No available video device:

UE4 server worked fine without any issues.

UE5 throws the error above,
Ive tried to manually re-build the plugin.
ive tried to disable it. (plugin still tries to load, and no we dont use it, nor is it enabled in project)
tried disabling anything VR related i could find

and anything else i could find on google with no luck so far.
at this point I’m not even sure if the crash is related to this “OpenXR” plugin at all

PS: we used to get the :
“LogInit: Warning: Could not initialize SDL: No available video device”
message in ue4 builds as well ,but everything worked fine.

and by now im out of ideas.
Any help would be appreciated.

wouldnt say we got it fixed more of a workaround,
We got around it by physically removing the OpenXR plugin from engine prior to making a build. That did stop the plugin from being included and the crash from happening.

@Sarr
It could be another plugin, that OpenXR utilizes, that you also need to enable. I think its the OpenXRHMD. Other than that, everything else I’ve found online for this error is related to the server.
I hope this can help!
-Zen

@Sarr
To remove reference to the plugin (even if it’s not active). Close your project, then open up the .uproject file in a text editor. Remove the JSON code that references against the OpenXR entry from the file. It’ll probably look like this…

{
			"Name": "OpenXR",
			"Enabled": true,
			"SupportedTargetPlatforms": [
				"Win64",
				"Linux",
				"Android",
				"HoloLens"
			]
		} ,

Make sure the JSON delimiter syntax is correct between plugin entries. Save the .uproject file.
Then restart the project.

as i stated in the initial post, the plugin isnt enabled, it was not even mentioned in the uproject file.

also we building the server on a headless, as in no graphical user interface

@ZenLeviathan tried that too, didnt help.

we also tried to adding the json code bit to the project and setting “Enabled” : false and it still tried to load the OpenXR plugin, untill we physically deleted it from the engine.