# Cannot execute ue4 run in container

**URL:** <https://forums.unrealengine.com/t/cannot-execute-ue4-run-in-container/1211260>\
**Category:** Platform & Builds\
**Tags:** container, unreal-engine, bug-report, editor, question\
**Created:** [June 26, 2023, 3:41pm UTC](https://forums.unrealengine.com/t/cannot-execute-ue4-run-in-container/1211260 "2023-06-26T15:41:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CuRS6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CuRS6](https://forums.unrealengine.com/u/CuRS6)\
**Post date:** [June 26, 2023, 3:41pm UTC](https://forums.unrealengine.com/t/cannot-execute-ue4-run-in-container/1211260/1 "2023-06-26T15:41:08Z")

</div>

Hello everyone,

I am trying to build my container using the ue4-docker image and I want to run the Editor of the Unreal project using `ue4 run`  
My `Dockerfile` looks like below:

```auto
FROM adamrehn/ue4-full:custom AS builder

COPY --chown=ue4:ue4 . /tmp/project

WORKDIR /tmp/project
RUN ue4 build
RUN ue4 run

```

And the image build always fail at `ue4 run` command with the following error messages:  
Info: I have already tried locally executing .uproject file and it can open the unreal editior. I would like to know why I cannot do it in the docker container.

```auto
#0 7.717 [2023.06.25-22.02.03:871][0]LogInit: Initializing SDL.
#0 7.720 error: XDG_RUNTIME_DIR not set in the environment.
#0 7.720 [2023.06.25-22.02.03:871][0]LogInit: Initializing SDL.
#0 7.720 [2023.06.25-22.02.03:874][0]LogInit: Warning: Could not initialize SDL: No available video device
#0 7.720 [2023.06.25-22.02.03:874][0]LogInit: Warning: Could not initialize SDL: No available video device
#0 7.720 [2023.06.25-22.02.03:874][0]LogInit: - Physical RAM available (not considering process quota): 16 GB (15958 MB, 16341272 KB, 16733462528 bytes)
#0 7.720 [2023.06.25-22.02.03:874][0]LogInit: - Physical RAM available (not considering process quota): 16 GB (15958 MB, 16341272 KB, 16733462528 bytes)
#0 7.720 [2023.06.25-22.02.03:874][0]LogInit: - VirtualMemoryAllocator pools will grow at scale 1.4
#0 7.720 [2023.06.25-22.02.03:874][0]LogInit: - VirtualMemoryAllocator pools will grow at scale 1.4
#0 7.720 [2023.06.25-22.02.03:874][0]LogInit: - MemoryRangeDecommit() will be a no-op (re-run with -vmapoolevict to change)
#0 7.734 [2023.06.25-22.02.03:874][0]LogInit: - MemoryRangeDecommit() will be a no-op (re-run with -vmapoolevict to change)
#0 7.734 [2023.06.25-22.02.03:887][0]LogInit: Physics initialised using underlying interface: PhysX
#0 7.750 [2023.06.25-22.02.03:887][0]LogInit: Physics initialised using underlying interface: PhysX
#0 7.750 [2023.06.25-22.02.03:904][0]LogInit: Using OS detected language (en-US-POSIX).
#0 7.750 [2023.06.25-22.02.03:904][0]LogInit: Using OS detected language (en-US-POSIX).
#0 7.750 [2023.06.25-22.02.03:904][0]LogInit: Using OS detected locale (en-US-POSIX).
#0 7.751 [2023.06.25-22.02.03:904][0]LogInit: Using OS detected locale (en-US-POSIX).
#0 7.751 [2023.06.25-22.02.03:905][0]LogTextLocalizationManager: No specific localization for 'en-US-POSIX' exists, so the 'en' localization will be used.
#0 7.854 [2023.06.25-22.02.03:905][0]LogTextLocalizationManager: No specific localization for 'en-US-POSIX' exists, so the 'en' localization will be used.
#0 7.854 [2023.06.25-22.02.04:008][0]LogInit: Initializing SDL.
#0 7.857 error: XDG_RUNTIME_DIR not set in the environment.
#0 7.857 [2023.06.25-22.02.04:008][0]LogInit: Initializing SDL.
#0 7.857 [2023.06.25-22.02.04:011][0]LogInit: Warning: Could not initialize SDL: No available video device
#0 7.857 [2023.06.25-22.02.04:011][0]LogInit: Warning: Could not initialize SDL: No available video device
#0 7.857 [2023.06.25-22.02.04:011][0]LogInit: Warning: FLinuxSplashState::InitSplashResources() : InitSDL() failed, there will be no splash.
#0 7.857 [2023.06.25-22.02.04:011][0]LogInit: Warning: FLinuxSplashState::InitSplashResources() : InitSDL() failed, there will be no splash.
#0 7.857 [2023.06.25-22.02.04:011][0]LogInit: Initializing SDL.
#0 7.859 error: XDG_RUNTIME_DIR not set in the environment.
#0 7.860 [2023.06.25-22.02.04:011][0]LogInit: Initializing SDL.
#0 7.860 [2023.06.25-22.02.04:013][0]LogInit: Warning: Could not initialize SDL: No available video device
#0 7.860 [2023.06.25-22.02.04:013][0]LogInit: Warning: Could not initialize SDL: No available video device
#0 7.860 [2023.06.25-22.02.04:013][0]LogInit: Error: FLinuxApplication::CreateLinuxApplication() : InitSDL() failed, cannot create application instance.
#0 7.860 [2023.06.25-22.02.04:013][0]LogInit: Error: FLinuxApplication::CreateLinuxApplication() : InitSDL() failed, cannot create application instance.
#0 7.860 [2023.06.25-22.02.04:013][0]LogCore: FUnixPlatformMisc::RequestExit(bForce=true, ReturnCode=1)
#0 7.860 [2023.06.25-22.02.04:013][0]LogCore: FUnixPlatformMisc::RequestExit(bForce=true, ReturnCode=1)
#0 7.860 [2023.06.25-22.02.04:013][0]LogCore: FUnixPlatformMisc::RequestExit(1)
#0 7.955 Using user-specified engine root: /home/ue4/UnrealEngine
#0 7.957 Traceback (most recent call last):
#0 7.957 File "/usr/local/bin/ue4", line 8, in <module>
#0 7.957 sys.exit(main())
#0 7.957 File "/usr/local/lib/python3.6/dist-packages/ue4cli/cli.py", line 222, in main
#0 7.957 SUPPORTED_COMMANDS[command]['action'](manager, args)
#0 7.957 File "/usr/local/lib/python3.6/dist-packages/ue4cli/cli.py", line 63, in <lambda>
#0 7.957 list([arg for arg in args if arg != '--debug'])
#0 7.957 File "/usr/local/lib/python3.6/dist-packages/ue4cli/UnrealManagerBase.py", line 377, in runEditor
#0 7.957 Utility.run([self.getEditorBinary(True), projectFile] + extraFlags + ['-stdout', '-FullStdOutLogOutput'], raiseOnError=True)
#0 7.957 File "/usr/local/lib/python3.6/dist-packages/ue4cli/Utility.py", line 145, in run
#0 7.957 raise Exception('child process ' + str(command) + ' failed with exit code ' + str(returncode))
#0 7.957 Exception: child process ['/home/ue4/UnrealEngine/Engine/Binaries/Linux/UE4Editor', '/tmp/project/syndab_sim.uproject', '-stdout', '-FullStdOutLogOutput'] failed with exit code 1      
------
Dockerfile:7
--------------------
   5 | WORKDIR /tmp/project
   6 | RUN ue4 build
   7 | >>> RUN ue4 run
   8 |
   9 | FROM adamrehn/ue4-runtime:latest
--------------------
ERROR: failed to solve: process "/bin/sh -c ue4 run" did not complete successfully: exit code: 1

```

I also tried this: build the container image without `RUN ue4 run` in Dockerfile. And after successfully built the image and run the container, I tried to run `ue4 run` in the container and got the same error message.

Could someone help please? It is a rather urgent problem. Thanks a lot for your help in advance!

---

<div class="post-metadata">

**Author:** ![fa29cc13](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fa29cc13](https://forums.unrealengine.com/u/fa29cc13)\
**Post date:** [June 27, 2023, 1:22am UTC](https://forums.unrealengine.com/t/cannot-execute-ue4-run-in-container/1211260/2 "2023-06-27T01:22:21Z")

</div>

how reset train sim world 3 please  
LoginId:fa29cc134aa2c7eef7ca9b8a1071bb52  
EpicAccountId:

---

<div class="post-metadata">

**Author:** ![3hux](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@3hux](https://forums.unrealengine.com/u/3hux)\
**Post date:** [July 1, 2023, 7:52pm UTC](https://forums.unrealengine.com/t/cannot-execute-ue4-run-in-container/1211260/3 "2023-07-01T19:52:34Z")

</div>

I encountered something similar, building UE511 from source:  
For me, doing this worked:  
`XDG_RUNTIME_DIR=/tmp ./Setup.sh` – as I was trying to run the initial setup inside a chroot.

FWIW - I spent a lot of time trying to get Docker building going, and it became so slow to trigger the build and wait for it to pull the project – that I went to an ‘old school’ chroot, so it just has to do a quick update and Intermediate/Binaries folder delete and then it can compile the docker image faster. YMMV of course.
