Linux Dedicated Server - Invalid Target Platform Error

I’ve successfully built a dedicated server for windows, but I’d prefer to have a linux dedicated server. I’ve installed the linux cross compile toolchain from Epic and I’m building from UE source. From the editor I set package build target to Server and my build configuration to either Development or Shipping. Then I attempt to build selecting Linux. My computer then compiles the code (this takes a while, no surprise) which completes successfully. Cook command then starts, and I get a number of logs that look like this:


UATHelper: Packaging (Linux):   LogTargetPlatformManager: Display: Loaded TargetPlatform 'WindowsServer'

But I don’t get any messages indicating the loading of any linux TargetPlatforms.

Shortly after that I get this:


UATHelper: Packaging (Linux):  LogTargetPlatformManager: Error: Invalid target platform specified (LinuxServer). Available = { AllDesktop, Android, Android_ASTC, Android_DXT, Android_ETC2, AndroidClient, Android_ASTCClient, Android_DXTClient, Android_ETC2Client, Android_Multi, Android_MultiClient, IOSClient, IOS, Lumin, LuminClient, MacNoEditor, Mac, MacClient, MacServer, TVOSClient, TVOS, WindowsNoEditor, Windows, WindowsClient, WindowsServer }

Does anyone have any idea how I get LinuxServer to be a valid target platform?
Thanks.

I’m not really sure why this got fixed, and I’m almost hesitant to post because it seems so odd. But maybe it will help someone who comes along later. I had been running my game in Development Editor trying to create the linux server but it wasn’t an accepted target. (See original post) Looking into it I found that when the editor is booting up it would call FTargetPlatformModuleManager::DiscoverAvailablePlatforms() and that would generate the list of all platforms that were available. To do this, it would look in the Engine/Binaries/Win64 folder and the subfolders that are there. (Which at the time were Android, IOS and Lumin) Today, trying to debug this better, I decided to run using Debug Editor configuration, and when I did that, it created a fourth folder Engine/Binaries/Win64/Linux. And now that I have this folder, I am able to build the LinuxServer in the editor.

I don’t think it was switching to the Debug Editor configuration per se that made the difference. When I first managed to compile and link the LinuxServer it generated a folder, Engine/Binaries/Linux, and then only when I rebuilt the Editor did that rebuild in turn generate the Engine/Binaries/Win64/Linux folder.

As mentioned at the beginning of this comment, I’m not really sure about any of this, so take my answer with a grain of salt. But hopefully it will help if someone else has similar problems.

1 Like

Maybe you’ve already seen this tutorial video but this worked for me 100%.

How to Package a Dedicated Server - YouTube video

Now, it does generate a Windows Dedicated Server but I was able to create a new project and generate a Linux-based Dedicated Server.

Hope this helps.

I can confirm the fix: After you have installed the toolchain for cross-compilation, you must open the solution for the engine in Rider (or VisualStudio) and build (rebuild is not necessary) the editor for Win64 (yes, that is Win64 and not Linux). This will create the needed folder “Engine/Binaries/Win64/Linux”. Then restart your editor, and packaging LinuxServer will work.

5 Likes

That was very helpful, Thanks a lot EuroBendel

1 Like

I’m very late to the party here, but as it seems like you are curious to what is actually going on here. I bumped into this issue myself, and your answer here made me realise the issue.

When I package unreal I call the automation tool (UAT) directly, rather than click the buttons in the editor which then generate a bunch of arguments and call UAT. I tried to build for linux for the first time and was getting the error as above then realised that I had these arguments in my call to UAT -nocompile -nocompileeditor -skipbuildeditor. I’m not exaclty sure which one it is, but one of them stops the editor from compiling when you do a package, and the first time you compile for a platform the editor needs to compile some extra stuff for that platform. These are the files you mention in Engine/Binaries/Win64. So the engine will report a platform as unsupported until these binaries have been generated.

So however you were calling UAT to do your package it would have had that skip compile editor argument on, and whatever you did that then resolved it it would have done a build without it on, thus generating the required linux binaries.

(This also explains what EuroBendel says about an editor recompile fixing it, same thing done differently)

1 Like