# Unreal Engine Defaults to Headless Mode

**URL:** <https://forums.unrealengine.com/t/unreal-engine-defaults-to-headless-mode/421245>\
**Category:** Platform & Builds\
**Tags:** compiling, UE4-19, Linux, unreal-engine, bug-report, CPP, question\
**Created:** [March 29, 2018, 6:02pm UTC](https://forums.unrealengine.com/t/unreal-engine-defaults-to-headless-mode/421245 "2018-03-29T18:02:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cygon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cygon](https://forums.unrealengine.com/u/cygon)\
**Post date:** [March 29, 2018, 6:02pm UTC](https://forums.unrealengine.com/t/unreal-engine-defaults-to-headless-mode/421245/1 "2018-03-29T18:02:54Z")

</div>

**Build Type:** GitHub. Source build of stable branch.

**Build version:** 4.19 (GitHub 4.19 branch commit 3f28d8781885eb16b23fec92dffee0f47ecc0e6e)

**Detailed description of the issue:** Since 4.18, opening any Unreal Project that uses C++ fails with a completely unhelpful error message.

 ![235512-headless-mode-dummy.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/6/0/86044351c59eef004ac75deb51ff0b1f38a8fc71.png)

This includes projects created with 4.18 or 4.19 as well as projects upgraded from 4.17 and earlier (the project upgrade system is broken as well, see [https://answers.unrealengine.com/questions/718575/](https://answers.unrealengine.com/questions/718575/), but this is a separate issue).

Looking at the source code, the text `No is implied.` is only printed by `GetHeadlessMessageBoxMessage()` which itself is only called if SDL would fail to initialize:

[https://github.com/EpicGames/UnrealEngine/blob/8e4560b8c22b309e73ff0ce90377742c3dfe13cc/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp#L61-L67](https://github.com/EpicGames/UnrealEngine/blob/8e4560b8c22b309e73ff0ce90377742c3dfe13cc/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp#L61-L67)

[https://github.com/EpicGames/UnrealEngine/blob/8e4560b8c22b309e73ff0ce90377742c3dfe13cc/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp#L205-L213](https://github.com/EpicGames/UnrealEngine/blob/8e4560b8c22b309e73ff0ce90377742c3dfe13cc/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp#L205-L213)

Do observe, however, that SDL does initialize successfully in the attached screenshot and that other SDL applications are running fine on this system.

**Repro Steps:**

1. Download Unreal Engine 4.18 or Unreal Engine 4.19 from GitHub on any Linux system
2. Build it (Setup.sh, GenerateProjectFiles.sh, make)
3. Run Unreal Engine, in the project/template window, create a new C++ project
4. _The project will be created but not built, thus fail to open. No error message will be displayed._
5. _Any attempts at opening the project thereafter yield the unhelpful error message below._

Occurs 100% of the time.

**System Specs:**  
Gentoo Linux, 2x Xeon E5-2680, 16 GiB RAM, GTX 1080  
KDE Plasma 5.11.5, NVidia proprietary drivers 390.42  
GCC 6.4, CLang 5.0.1 w/LLD 5.0.1

---

<div class="post-metadata">

**Author:** ![cygon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cygon](https://forums.unrealengine.com/u/cygon)\
**Post date:** [March 29, 2018, 6:18pm UTC](https://forums.unrealengine.com/t/unreal-engine-defaults-to-headless-mode/421245/2 "2018-03-29T18:18:47Z")

</div>

It is the second of the two code locations I posted, `SDL_ShowMessageBox()`, that fails. The SDL function returns -1.

---

<div class="post-metadata">

**Author:** ![cygon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cygon](https://forums.unrealengine.com/u/cygon)\
**Post date:** [March 29, 2018, 6:41pm UTC](https://forums.unrealengine.com/t/unreal-engine-defaults-to-headless-mode/421245/3 "2018-03-29T18:41:55Z")

</div>

The error message reported by SDL is “No message system available.”

[https://github.com/EpicGames/UnrealEngine/blob/8e4560b8c22b309e73ff0ce90377742c3dfe13cc/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/src/video/SDL\_video.c#L3960-L3969](https://github.com/EpicGames/UnrealEngine/blob/8e4560b8c22b309e73ff0ce90377742c3dfe13cc/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/src/video/SDL_video.c#L3960-L3969)

---

<div class="post-metadata">

**Author:** ![cygon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cygon](https://forums.unrealengine.com/u/cygon)\
**Post date:** [March 29, 2018, 8:03pm UTC](https://forums.unrealengine.com/t/unreal-engine-defaults-to-headless-mode/421245/4 "2018-03-29T20:03:20Z")

</div>

A workaround for those who don’t mind ugly hacks:

1. edit `Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp`

2. add the following code snippet near line 208:

Launching Unreal Engine from the shell, this will then present you with a prompt to answer Y or N. Answering Y will compile the C++ project, open the editor and everything will work from there.

 ![235516-console.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/7/4/67452eae1b24022e534cad9379d3fd64aba87f4b.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_A](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jeff\_A](https://forums.unrealengine.com/u/Jeff_A)\
**Post date:** [March 29, 2018, 9:00pm UTC](https://forums.unrealengine.com/t/unreal-engine-defaults-to-headless-mode/421245/5 "2018-03-29T21:00:51Z")

</div>

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

[https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form](https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form)

Thanks

---

<div class="post-metadata">

**Author:** ![RCL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RCL](https://forums.unrealengine.com/u/RCL)\
**Post date:** [March 30, 2018, 3:28pm UTC](https://forums.unrealengine.com/t/unreal-engine-defaults-to-headless-mode/421245/6 "2018-03-30T15:28:08Z")

</div>

While you seem to have worked the problem around, could you please try breaking into X11\_ShowMessageBox() and seeing why it fails? There must be something specific to your X server that SDL2 doesn’t handle. What are you running - [X.Org](http://X.Org), XWayland, anything else?

---

<div class="post-metadata">

**Author:** ![cygon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cygon](https://forums.unrealengine.com/u/cygon)\
**Post date:** [March 31, 2018, 9:37am UTC](https://forums.unrealengine.com/t/unreal-engine-defaults-to-headless-mode/421245/7 "2018-03-31T09:37:44Z")

</div>

I’m running vanilla X11 R7.7 ([X.Org](http://X.Org) server 1.19.5) with KDE Plasma desktop 5.11.5. I’ll try to debug into the SDL code to see which of the calls to the windowing system fails.

---

<div class="post-metadata">

**Author:** ![cygon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cygon](https://forums.unrealengine.com/u/cygon)\
**Post date:** [May 5, 2019, 9:31am UTC](https://forums.unrealengine.com/t/unreal-engine-defaults-to-headless-mode/421245/8 "2019-05-05T09:31:09Z")

</div>

in SDL\_x11messagebox.c, there’s a function `X11_ShowMessageBox()`, which for some reason calls `fork` and then tries to read from the piped process (line #858). The call to `read()` from the pipe is what fails.
