Page 1 of 1

How-to Make a server on VPS(DigitalOcean,)

Posted: Wed Jul 29, 2015 10:08 pm
by Leveller
1: Get acount
2: Pay
3, install factorio.
4, ?????
5: Profit !



Nah J/K.

Seriously this need some rookie/intermediate linuxskills to proceed. Since this will focus on HOW to get it running, not how to register a VPSaccount, pay, download factorio to it etc.


Anyhow.

Step 1 is beginning from when you have factorio.12 tar,gz downloaded to your shellaccount.


Real step 1:

tar -zxvf factorio<version>.tar.gz to unpack it.


Step 2: get into the factoriofolder and type:

echo 'void*XOpenDisplay(){return 0;}int XInitThreads(){return 1;}' > x.c && cc -shared -o libX11.so.6 x.c && touch empty.c && for i in libXext.so.6 libXfixes.so.3 libXcursor.so.1 libXrender.so.1 libXrandr.so.2 libXinerama.so.1 libGL.so.1 libXi.so.6 libXcursor.so.1; do cc -shared -o $i empty.c; done


Step2 note: This is for tricking factorio it got stuff like mousepointer, ALSA drivers for sound etc.



Step 3: LD_LIBRARY_PATH=. ./factorio --start-server --create <savename>

Step3 notes: This will trick linux to think you have all the stuff like mousepointers etc into this directory, making empty files so its.. "ok"



Step 4: Upload preffered save or start a new game.

New save: Let the --start-server --create <name> just run.

Load savegame: LD_LIBRARY_PATH=. ./factorio --start-server <savegame-zip>



The end. Note that commands are case sens. Especially savegames. :P Also there is lots of more --options listed current below:

-s [ --map2scenario ] arg map to scenario conversion
-v [ --convert ] SAVE[, SAVE...] convert maps from previous versions to
current version
--apply-update arg immediately apply update package
--create SAVE create a new map
--start-server SAVE start a multiplayer server
--mp-load-game SAVE start factorio and load game for
multiplayer
--mp-connect ADDRESS start factorio and connect to address
--benchmark SAVE load save and run benchmark
--benchmark-ticks N (=1000) number of ticks for benchmarking. Default
is 1000

Server options:
--latency N multiplayer server latency, in ticks
--latency-ms N multiplayer server latency, in milliseconds
--autosave-interval N (=2) server autosave interval, in minutes
--autosave-slots N (=3) server autosave slots

--autoupdate-stage2 arg internal use only
--autoupdate-finished internal use only



I only post this cause its the way _i_ got it working. :)

Re: How-to Make a server on VPS(DigitalOcean,)

Posted: Thu Jul 30, 2015 5:22 pm
by Bisa
Feel free to improve the wiki article regarding linux installs here: https://forums.factorio.com/wiki/inde ... ayer#Linux

Re: How-to Make a server on VPS(DigitalOcean,)

Posted: Fri Jul 31, 2015 8:06 am
by MF-
Wait.. does that mean factorio --headless won't start without having X and alsa libraries present?
Kinda makes sense it worked that way. But it might be reported in the bugs section.

Title suggestion: "Running headless factorio on a truly headless linux server"
Since this is a generally useful information AND a workaround for a kindof-bug.


PS: It might be too hard to do on-demand loading from factorio, so maybe factorio will go this way
and include a dir of those fake libraries to be loaded from a new start-headless.sh script?

Re: How-to Make a server on VPS(DigitalOcean,)

Posted: Fri Jul 31, 2015 9:57 am
by prg
https://forums.factorio.com/forum/vie ... =7&t=13536

The fake lib workaround is really ugly though, if the libs aren't needed they shouldn't be linked against in the first place. A separate binary sounds like the most reasonable solution to me. Trying to dlopen libX11 and friends when a GUI is needed will probably break in all kinds of exciting ways on different systems.

Re: How-to Make a server on VPS(DigitalOcean,)

Posted: Fri Jul 31, 2015 2:00 pm
by Bisa
You do not need anything like that, just follow the guide on the wiki https://forums.factorio.com/wiki/inde ... ayer#Linux

Since 0.12.2 you cans tart factorio with '--start-server <save_name>' and it will start in headless mode without any of the previous hackish solutions.

Re: How-to Make a server on VPS(DigitalOcean,)

Posted: Fri Jul 31, 2015 2:58 pm
by prg
Bisa wrote:You do not need anything like that, just follow the guide on the wiki https://forums.factorio.com/wiki/inde ... ayer#Linux

Since 0.12.2 you cans tart factorio with '--start-server <save_name>' and it will start in headless mode without any of the previous hackish solutions.
How so? In 0.12.2 factorio is still linked against libX11 & co. That doesn't seem to have changed.

Re: How-to Make a server on VPS(DigitalOcean,)

Posted: Fri Jul 31, 2015 9:59 pm
by SHiRKiT
Really? I was thinking that the headless version would work without graphics/UI, and I was thinking of purchasing a VPS just to have a 24/7 server running, prone to biter destruction. That made me so sad =\

Re: How-to Make a server on VPS(DigitalOcean,)

Posted: Fri Jul 31, 2015 10:12 pm
by Oxyd
prg wrote:
Bisa wrote:You do not need anything like that, just follow the guide on the wiki https://forums.factorio.com/wiki/inde ... ayer#Linux

Since 0.12.2 you cans tart factorio with '--start-server <save_name>' and it will start in headless mode without any of the previous hackish solutions.
How so? In 0.12.2 factorio is still linked against libX11 & co. That doesn't seem to have changed.
It sure hasn't changed. Separate binary is planned, though, so stay tuned.

Re: How-to Make a server on VPS(DigitalOcean,)

Posted: Fri Jul 31, 2015 10:27 pm
by prg
SHiRKiT wrote:Really? I was thinking that the headless version would work without graphics/UI, and I was thinking of purchasing a VPS just to have a 24/7 server running, prone to biter destruction. That made me so sad =\
Well there's this solution with the fake libs...

Re: How-to Make a server on VPS(DigitalOcean,)

Posted: Sat Aug 01, 2015 5:30 am
by Bisa
Oxyd wrote:
prg wrote:
Bisa wrote:You do not need anything like that, just follow the guide on the wiki https://forums.factorio.com/wiki/inde ... ayer#Linux

Since 0.12.2 you cans tart factorio with '--start-server <save_name>' and it will start in headless mode without any of the previous hackish solutions.
How so? In 0.12.2 factorio is still linked against libX11 & co. That doesn't seem to have changed.
It sure hasn't changed. Separate binary is planned, though, so stay tuned.
Point taken, I was noobish enough to just install the missing libs :|

Re: How-to Make a server on VPS(DigitalOcean,)

Posted: Sun Aug 02, 2015 6:47 am
by MF-
That also works :)