Cannot run a headless server and play on the same computer

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
KoblerMan
Fast Inserter
Fast Inserter
Posts: 185
Joined: Sat Mar 05, 2016 12:59 am
Contact:

Cannot run a headless server and play on the same computer

Post by KoblerMan »

Hello everyone, I have Factorio on Steam and much to my disappointment I've found that it is impossible to play the game and run the server.bat file at the same time. I would like to be able to play on my own headless server with the same computer running it.

I think this issue was talked about before but I have not seen it show up on the bug reports section of the forums.
ImageImage
System Specs
OS: Windows 10 Professional 64 Bit
CPU: AMD Ryzen 5 3600X (@~3.8 gHz)
GPU: Nvidia RTX 2080
RAM: 32GB DDR4 (2400)
DRIVES: 2x 1TB NVMe SSD, 1x 6TB HDD

Koub
Global Moderator
Global Moderator
Posts: 7217
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Cannot run a headless server and play on the same computer

Post by Koub »

If you want to do that, you have to change the portfor the client side of Factorio.
Maybe this can help : viewtopic.php?f=11&t=13634&start=10#p93014
[Edit] : this one is even better : viewtopic.php?f=53&t=20811#p130869
Koub - Please consider English is not my native language.

User avatar
KoblerMan
Fast Inserter
Fast Inserter
Posts: 185
Joined: Sat Mar 05, 2016 12:59 am
Contact:

Re: Cannot run a headless server and play on the same computer

Post by KoblerMan »

Koub wrote:If you want to do that, you have to change the portfor the client side of Factorio.
Maybe this can help : viewtopic.php?f=11&t=13634&start=10#p93014
[Edit] : this one is even better : viewtopic.php?f=53&t=20811#p130869
The second link is a great resource, but how do I start a server with parameters? Thanks for your help by the way.
ImageImage
System Specs
OS: Windows 10 Professional 64 Bit
CPU: AMD Ryzen 5 3600X (@~3.8 gHz)
GPU: Nvidia RTX 2080
RAM: 32GB DDR4 (2400)
DRIVES: 2x 1TB NVMe SSD, 1x 6TB HDD

Koub
Global Moderator
Global Moderator
Posts: 7217
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Cannot run a headless server and play on the same computer

Post by Koub »

Hi,
You may find the help you need :
here : https://wiki.factorio.com/index.php?title=GameClient
and here : https://wiki.factorio.com/index.php?title=Multiplayer

I'm sorry I can't be much more helpful, I have never set up a server, I'm the kind of solo guy (I always shoot first ^^).
Koub - Please consider English is not my native language.

frankmig
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Nov 05, 2016 12:57 pm
Contact:

Re: Cannot run a headless server and play on the same computer

Post by frankmig »

Start Factorio normally and create a new game. Save the game, such as servermap

Copy C:\Users\<username>\AppData\Roaming\Factorio\config
to
C:\Users\<%username%>\AppData\Roaming\Factorio with a different name of course such as config-server
So there will be in side Factorio folder a folder with config and config-server

Inside config-server folder edit config.ini

write-data=__PATH__system-write-data__
to
write-data=__PATH__system-write-data__/server

Navigate to where base game is installed

For steam:

C:\Program Files (x86)\Steam\steamapps\common\Factorio
Create a new folder where the server files will reside such as on the Desktop called Factorio Server
Inside the folder copy contents of C:\Program Files (x86)\Steam\steamapps\common\Factorio

In Factorio Server folder edit config-path.cfg
config-path=__PATH__system-write-data__/config
to
config-path=__PATH__system-write-data__/server

Navigate to \Factorio Server\bin\x64

Create new text document, add the following:
cd "\\Factorio Server\bin\x64"
start /wait factorio.exe --start-server "servermap.zip"

save file as filename.bat
*remember to save file type as all files

copy servermap.zip file to this location,
this should be located at C:\Users\<username>\AppData\Roaming\Factorio\saves

run .bat file
this will open command prompt with server running
you should be able to run Factorio normally

trampek
Inserter
Inserter
Posts: 39
Joined: Sat Mar 28, 2020 2:30 pm
Contact:

Re: Cannot run a headless server and play on the same computer

Post by trampek »

latest guide kinda works but for me its few bits were diffrent like - there was no config file in appdata/roaming but it was in game folder, then it kinda worked but created own save somehow and loaded no mods so i just copy saves and mods folders to game server folder and all good :)

Post Reply

Return to “Resolved Problems and Bugs”