Page 1 of 1

Running on Windows Server 2012 R2 Core

Posted: Tue Sep 13, 2016 2:37 am
by Polybius
So it seems that Factorio won't run on Core. And I mean not at all. It doesn't even get as far as writing to a log. I'm guessing it's looking for something that would be there by default in a regular Windows installation but isn't in Core. Would be nice to have it working in Core as it has a much smaller footprint and I can boot up a Core installation in Hyper-V just for a Factorio server.

Let me know if you need any info or testing.

Thanks!

Re: Running on Windows Server 2012 R2 Core

Posted: Tue Sep 13, 2016 7:29 am
by kovarex
What is core? Factorio doesn't need anything special, get the zip version.

Re: Running on Windows Server 2012 R2 Core

Posted: Tue Sep 13, 2016 9:29 am
by Deadly-Bagel
Are you trying to run full Factorio or just the headless server? Server Core is designed to run without a desktop so I wouldn't be surprised if Factorio didn't work on it.

Re: Running on Windows Server 2012 R2 Core

Posted: Tue Sep 13, 2016 3:12 pm
by Rseding91
kovarex wrote:What is core? Factorio doesn't need anything special, get the zip version.
"core" is a version of Windows server that doesn't include the standard GUI that every other Windows computer has. It's a terminal-only interface.

Most likely the issue is that. The Windows exe requires audio and video to function. I haven't actually tested but that's the only thing I can think of different between standard Windows server and the core version that would cause issues.

Re: Running on Windows Server 2012 R2 Core

Posted: Tue Sep 13, 2016 5:03 pm
by posila
I wonder if factorio-test.exe works. Maybe the problem is only that factorio.exe is built as Windows application, so server doesn't even let it run when it reads PE header. But I would expect Windows to give you some error, same if it is missing some DLL.

We don't release standalone headless server binary for Windows and so far don't plan to do so. Even though some people managed to make Factorio server run on some server versions on Windows, we don't officially support it.

Re: Running on Windows Server 2012 R2 Core

Posted: Tue Sep 13, 2016 5:20 pm
by Rseding91
posila wrote:I wonder if factorio-test.exe works. Maybe the problem is only that factorio.exe is built as Windows application, so server doesn't even let it run when it reads PE header. But I would expect Windows to give you some error, same if it is missing some DLL.

We don't release standalone headless server binary for Windows and so far don't plan to do so. Even though some people managed to make Factorio server run on some server versions on Windows, we don't officially support it.
There's no different types of exe for Windows. Either it runs on Windows desktop and server or it doesn't run at all. The only difference is core doesn't have full GUI/sound support since it's a minimal terminal interface.

We could probably do the same thing Linux headless has for Windows server core.

Re: Running on Windows Server 2012 R2 Core

Posted: Tue Sep 13, 2016 5:41 pm
by posila
Rseding91 wrote:There's no different types of exe for Windows. Either it runs on Windows desktop and server or it doesn't run at all.
EXE files have PE header, that among other things says if it is console or Windows application. For example, in Debug we build Factorio as Console application, that is why console shows up when you run it, in release we build it as Windows application, therefore no console shows up, and in Release we even have to attach to parent console from code, in order to get some output in console when running headless server from command line on Windows. Factorio-test is always built as Console application, but has same dependencies on GUI and graphics libraries as normal Factorio, since it can run graphics mode.

So maybe Windows doesn't even try to execute the application when it finds out it was not built as Console application.

Or maybe it tries to run it and fails due to some missing DLL. In that case it might run if we give it DLLs stubs (which is basically what Linux guys were doing, before headless binary existed)

Re: Running on Windows Server 2012 R2 Core

Posted: Wed Sep 14, 2016 9:10 am
by Deadly-Bagel
I don't think Windows particularly cares if it can run it or not and is quite happy to just let it crash. I think it's more likely trying to create a sound or drawing object but the libraries aren't there to do that so it just bums out. Yes this should generate an error but then there's no GUI to display the error in.

Server Core is designed for management through PowerShell which has its own error handling through the command line error stream, and for errors thrown in other threads or background tasks there is the Event Viewer. If you guys started logging there (if you don't already) you'll most likely end up with the expected "cannot find DLL" errors.

Re: Running on Windows Server 2012 R2 Core

Posted: Wed Sep 14, 2016 9:14 am
by kovarex
The headless server can run just fine on a linux server without graphics card and sound card, so I guess that this is not Factorio bug, but the server bug, or the server is just incompatibile.

Re: Running on Windows Server 2012 R2 Core

Posted: Wed Sep 14, 2016 9:45 am
by Deadly-Bagel
I'm not familiar with Linux servers but no sound card is not the same as no libraries. You can create a sound object that detects there is no sound card to play through and handles that appropriately, but if you can't create the object in the first place because it doesn't exit then you get problems.

Honestly Server Core is better used on virtual machines where you have hundreds of machines all sharing resources, so it's pointless to have the same interfaces running along all of them. If you free up 1% of every resource on 100 servers, you could add another server with the savings and this is where Server Core comes in as you're probably using central management anyway. However with a standalone server, freeing up 1% of every resource means nothing so generally you install it with a GUI for ease of use.

Unless you guys envisage Factorio headless server running on at least dozens of virtual servers using shared resources, it's fair to make a GUI a requirement.

Re: Running on Windows Server 2012 R2 Core

Posted: Wed Sep 14, 2016 10:00 am
by posila
kovarex wrote:The headless server can run just fine on a linux server without graphics card and sound card, so I guess that this is not Factorio bug, but the server bug, or the server is just incompatibile.
Yes, it works on Linux fine, because we release special binary that makes it work on Linux fine :)
I agree it is not a bug, more like feature request. And personally, I don't want to add another hour to our release just for Windows Server Core support, which we won't even test regularly, same as we don't test the game on Windows XP. Just use linux servers if you want lightweight dedicated Factorio server, people :)

Re: Running on Windows Server 2012 R2 Core

Posted: Mon Jan 08, 2018 5:53 am
by Rilnac
I managed to get this working on Server Core 1709 (the fall creators update)

I had the same issue running the EXE from console, test version also did nothing. So I fired up notepad and used the open file dialogue to browse to the factorio folder and ran the factorio.exe using right-click open.

This allowed the program to generate error popups. Which told me it was missing the following 4 files.

Code: Select all

      LastWriteTime         Length Name
      -------------         ------ ----
 3/3/2017  10:26 PM         579072 ddraw.dll
7/16/2016   6:18 AM         603136 dsound.dll
7/16/2016   6:18 AM         165376 glu32.dll
7/16/2016   6:18 AM        1058816 opengl32.dll
I grabbed them off a server 2016 machine from the windows\system32 folder and dumped them to my factorio bin folder. Luckily it checks the local folder first for the files and it started right up.

I added a firewall rule with powershell and the server is actively taking connections now.

Code: Select all

new-NetFirewallRule -DisplayName Factorio -Profile @('Domain', 'Private') -Direction Inbound -Action Allow -Protocol UDP -LocalPort @('49222')
Note: since these files are manually copied, they technically increase the attack surface of the host. They also will not be auto updated by windows patching since they don't belong on the OS. If these files are ever revised you will need to manually update them.