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

Arrange meetings with other people to play MP, announce your servers.
Leveller
Inserter
Inserter
Posts: 44
Joined: Fri Mar 06, 2015 3:37 pm
Contact:

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

Post 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. :)
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

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

Post by Bisa »

Feel free to improve the wiki article regarding linux installs here: https://forums.factorio.com/wiki/inde ... ayer#Linux
Hosting a factorio server? Take a look at this || init script ||.
MF-
Smart Inserter
Smart Inserter
Posts: 1235
Joined: Sun Feb 24, 2013 12:07 am
Contact:

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

Post 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?
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

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

Post 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.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

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

Post 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.
Hosting a factorio server? Take a look at this || init script ||.
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

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

Post 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.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

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

Post 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 =\
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

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

Post 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.
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

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

Post 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...
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

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

Post 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 :|
Hosting a factorio server? Take a look at this || init script ||.
MF-
Smart Inserter
Smart Inserter
Posts: 1235
Joined: Sun Feb 24, 2013 12:07 am
Contact:

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

Post by MF- »

That also works :)
Post Reply

Return to “Multiplayer”