How to enable headless mode on Unity Could Build?

Hello!

I am trying build a game server for Linux using Could Build, but to achieve that I need “headless mode” option to be enabled. It’s mandatory to run the build on my Debian machine.

But there’s no such option in “Advanced options” section at project’s page in Unity Could Build. There’s a “Pre-Export Method Name” option, though, but I don’t know how to enabled headless mode using it:

public class CloudBuild
{
    public static void BeforeBuild()
    {
        ??? BuildOptions.EnableHeadlessMode
    }
}

How can I achieve that? Thank you.

The option you will want to set in the Pre-Build Script is this one:

Thank you very much!

Unfortunately, with this code does not work:

using UnityEngine;
using UnityEditor;

public class CloudBuild: MonoBehaviour
{
    public static void BeforeBuild()
    {
        EditorUserBuildSettings.enableHeadlessMode = true;
    }
}

What am I doing wrong? I’ve put this script into “Assets/Editor” folder, and set “CloudBuild.BeforeBuild” as a “Pre-Build Script”, but the resulting build is 100% identical with the one without such option. Also, I can attach the full build log.

UPD. So, apparently, with this option enabled I cannot get the build with headless mode. I’ve added a Debug.Log line to check if it gets executed, and it does.

I believe I should pass the BuildOptions.EnableHeadlessMode option somewhere somehow. How can I access the building pipeline then?

Any suggestions? Thank you!

The BuildOptions.EnableHeadlessMode enum is passed into the final call to the BuildPipeline.BuildPlayer function if you are doing a build directly. We ultimately run that in Unity cloud build, let me check on our usage of the BuildOptions and EditorUserBuildSettings.enableHeadlessMode and get back to you.

Thank you for the response, would appreciate it.

Any news on this?

Sorry about the delay in getting back to you. We only support a subset of the BuildOptions enum in cloud build and headless mode is not one of those options currently. I’ve been discussing options with the team about expanding those options and how best to handle it but nothing concrete just yet.

Sorry for disturbing, but is there any update on this?

I’m also looking for a solution to the same problem. The server part of my game needs to run headless and I currently have no way of making these builds other than doing it manually.

I am also looking for this support. Unless there’s plans to get that unet server .dll out there fairly quickly I need to imagine headless linux builds are only going to become more common.

@Ryanc_unity What is the status of this now? We’re also exploring to incorporate Unity Cloud build in our company, but this is a must-have feature in order to pass.

Has anyone figured this out?

Bump. Just ran into this on my project too. I’ve written a bug to track this problem: (Case 872169)

Another nudge, any news, I currently have one server component that I have to build manually because of this, everything else is beautifully CI

You can vote for this feature at https://feedback.unity3d.com/suggestions/enable-headless-mode-on-unity-could-build

Hi,

This is still a problem on August 2017.

Feels pretty weird to me that it is not possible to use Unity Cloud Builds for a multiplayer game – where you need a headless server.

@Ryanc_unity . Any update on this? years go buy and there is seemingly no progress. How hard can it be to add a flag to the build pipeline?

Any news? :stuck_out_tongue:

Anything?

Would be nice so I dont have to roll my own build system just for a server build…