Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Player with "server build" silently fails on Windows Server Core

Discussion in 'Windows' started by Yacuzo, May 26, 2020.

  1. Yacuzo

    Yacuzo

    Joined:
    Sep 22, 2016
    Posts:
    23
    Hello,

    I'm trying to run a built network-server on Windows Server Core 2019.
    Both Mono and IL2CPP builds silently fails when starting them, even though they work fine on my local computer. Powershells $LASTEXITCODE gives -1073741515, which seems really weird.

    I'm running it through powershell remoting, just staring the exe normally.
    I have also tried with -nolog -batchmode and -nographics.
    Unity 2019.3.7.

    I would have at least expected some sort of error.

    Anything else I can try?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,677
    That error code means STATUS_DLL_NOT_FOUND. If you run the build through UI, it will probably tell you which DLL is missing.

    That said, we never tested Unity on that OS.
     
  3. Yacuzo

    Yacuzo

    Joined:
    Sep 22, 2016
    Posts:
    23
    There is no UI on Server Core. That's the point of it.
    The point of a 'server build' is also that it should be no UI, right?

    Is there a list of dlls required by a built player? That way I could look for them manually.
     
    Last edited: May 27, 2020
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,677
    You can drop UnityPlayer DLL into "Dependencies" (https://github.com/lucasg/Dependencies/releases) to see what DLLs it's missing.

    You could also enable loader snaps by running "gflags -i <exe_name> +sls" (gflags comes with Windows SDK - you can just copy that executable to the server) and then try running the process through a debugger. It will tell you which DLL it cannot load.
     
    Yacuzo likes this.
  5. Yacuzo

    Yacuzo

    Joined:
    Sep 22, 2016
    Posts:
    23
    Thanks for the help so far.

    Sadly the dependency walker was not quite reliable. It shows a bunch of missing stuff on my local machine, despite the app working fine here. The list from the server is different, so it is hard to make a diff.

    The output of debugging + gflags is a bit cryptic to me, but i think it is at least opengl32.dll and dwmapi.dll that have problems. Both of those are related to UI, and it makes no sense for a 'server build' to require those.
    I tried just copying over the opengl32.dll, and the dwmapi.dll was already present (despite it being a no-UI server). No luck. The attached file is with both opengl32.dll and dwmapi.dll present.

    Should I report a bug?
     

    Attached Files:

  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,677
    Looks like it cannot locate "winmmbase.dll". It seems like opengl32.dll is there, but it fails to load that because it depends on "glu32.dll" (and that isn't there). This just sounds like a broken Windows installation... I don't think there's much we can do here to support this scenario if OS is missing random system DLLs.
     
  7. Yacuzo

    Yacuzo

    Joined:
    Sep 22, 2016
    Posts:
    23
    As I wrote in my previous post, I just copied in the opengl32.dll from my local computer in hopes that would solve it. I guess I'll try copying in the rest you mentioned.

    The OS is not missing random dlls, it deliberately has no UI, so no graphics/UI related dlls are present. With the exception of those I copy in.

    It is still weird to me that a 'server build' unity player requires all these UI libraries.

    Edit: Holy S***, I got it to work. Here is a list of dlls I copied from my standard Win10 to the Server Core:
    • opengl32.dll
    • glu32.dll
    • winmmbase.dll
    • vcruntime140.dll
    • vcruntime140_1.dll
    I also installed some old directx via commandline, but I'm not sure if it mattered in the end.
    Thanks for the help.
     
    Last edited: May 29, 2020
    eatbuckshot likes this.
  8. eatbuckshot

    eatbuckshot

    Joined:
    Jan 10, 2016
    Posts:
    18
    At least for Windows server core version 2004, 1909, 1903 and maybe server 2019, 2016 (core)
    you can install the App Compatibility feature on demand to allow unity to run.
    https://docs.microsoft.com/en-us/windows-server/get-started-19/install-fod-19
    Code (CSharp):
    1. Add-WindowsCapability -Online -Name ServerCore.AppCompatibility~~~~0.0.1.0
    It currently works for me using server core 2004

    Edit: Actually something very strange:
    When i set the timezone on the windows server core installation to something other than "UTC" (which seems to be the default) using tzutil /s attempting to start the unity player or server fails immediately only briefly changing the cursor to a busy / hourglass icon.
     
    Last edited: Sep 2, 2020
    Yacuzo likes this.
unityunity