Search Unity

How to enable headless mode on Unity Could Build?

Discussion in 'Unity Build Automation' started by desertkun, Mar 11, 2016.

  1. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    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:

    Code (CSharp):
    1. public class CloudBuild
    2. {
    3.     public static void BeforeBuild()
    4.     {
    5.         ??? BuildOptions.EnableHeadlessMode
    6.     }
    7. }
    How can I achieve that? Thank you.
     
  2. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    332
  3. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    Thank you very much!
     
  4. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    Unfortunately, with this code does not work:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3.  
    4. public class CloudBuild: MonoBehaviour
    5. {
    6.     public static void BeforeBuild()
    7.     {
    8.         EditorUserBuildSettings.enableHeadlessMode = true;
    9.     }
    10. }
    11.  
    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!
     
    Last edited: Mar 13, 2016
  5. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    332
    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.
     
  6. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    Thank you for the response, would appreciate it.
     
  7. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    Any news on this?
     
  8. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    332
    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.
     
  9. desertkun

    desertkun

    Joined:
    Jan 13, 2016
    Posts:
    8
    Sorry for disturbing, but is there any update on this?
     
  10. ed-altorfer

    ed-altorfer

    Joined:
    Apr 7, 2013
    Posts:
    7
    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.
     
  11. darthbator

    darthbator

    Joined:
    Jan 21, 2012
    Posts:
    169
    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.
     
  12. Miiirage

    Miiirage

    Joined:
    May 13, 2016
    Posts:
    8
    @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.
     
  13. ParallelPlaidJoel

    ParallelPlaidJoel

    Joined:
    Nov 23, 2016
    Posts:
    1
    Has anyone figured this out?
     
  14. MrMike-ArtCraft

    MrMike-ArtCraft

    Joined:
    Jul 22, 2013
    Posts:
    1
    Bump. Just ran into this on my project too. I've written a bug to track this problem: (Case 872169)
     
    Last edited: Jan 19, 2017
  15. Soulbadger

    Soulbadger

    Joined:
    Jan 3, 2014
    Posts:
    2
    Another nudge, any news, I currently have one server component that I have to build manually because of this, everything else is beautifully CI
     
  16. RJS

    RJS

    Joined:
    Jun 27, 2013
    Posts:
    2
  17. Deleted User

    Deleted User

    Guest

    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.
     
  18. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    @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?
     
  19. thomaswollbekk

    thomaswollbekk

    Joined:
    Aug 11, 2016
    Posts:
    2
  20. iMer

    iMer

    Joined:
    May 21, 2013
    Posts:
    29
    Anything?

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

    ollieblanks

    Unity Technologies

    Joined:
    Aug 21, 2017
    Posts:
    460
    Hi everyone,
    Sorry for the very delayed response on this very high demand feature!

    I can confirm that this has been worked on and this feature is to go ahead. I will post again once I have an update for when this will be released.
     
    goldbug likes this.
  22. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    Better late than never, tx.

    Unfortunately this is not enough for me, HLAPI is abandoned. I need to build with HLAPI Pro which is not possible with unity cloud build.

    I resorted to putting together my own CI/CD system, it is a lot of work, but it is the only way at the moment.
     
  23. iMer

    iMer

    Joined:
    May 21, 2013
    Posts:
    29


    Thanks a lot!
     
    janne404, ollieblanks and goldbug like this.
  24. Deleted User

    Deleted User

    Guest

    @ollieblanks it's more than a year later. Are there any news?
     
  25. ollieblanks

    ollieblanks

    Unity Technologies

    Joined:
    Aug 21, 2017
    Posts:
    460
    @Alexees, please see @iMer 's response above. Headless mode has been available for a while now and is configured within Advanced Settings of your Linux build target. If you have any issues or concerns with set up, please let me know.
     
  26. Loden_Heathen

    Loden_Heathen

    Joined:
    Sep 1, 2012
    Posts:
    480
    Is there a reason this isn't available on a windows build?
    I see the option with Linux 64's advanced options but not in Windows 64 advanced options

    Granted we will likely switch to a nix server but in the mean time while we are testing we are using a windows box to host the server and so are having to manually build the server.

    Also ... why does a build kick off when you first save it?
    The create new build target doesn't even expose all the options I feel it shouldn't kick off when it saves but rather simply save the settings so I can then edit the advanced options and or decide when I want it to run.