Skip to content

Instantly share code, notes, and snippets.

@CoffeePirate
Last active October 21, 2024 03:40
Show Gist options
  • Save CoffeePirate/102e789310719cad6457 to your computer and use it in GitHub Desktop.
Save CoffeePirate/102e789310719cad6457 to your computer and use it in GitHub Desktop.
A quick guide how to setup Space Engineers Dedicated server on a Linux box with Wine

Ubuntu 14.04/14.10 SpaceEngineers Dedicated Server

Here's a quick guide how to run SpaceEngineers Dedicated Server on Ubuntu with Wine

Requirements

  • A copy of Space Engineers
  • A Windows box
  • A Linux box running Ubuntu 14.04 or 14.10 (It'll probably work on other distros, YMMV)

Step #1: Install & configure Wine1.6 and dependencies

sudo apt-get update
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine1.6
winetricks -q dotnet40
rm -r ~/.wine
WINEARCH=win32 wine wineboot

Step #2: Copy necessary files to Linux box

Server binaries

There are multiple ways for transfering files, easiets would probably be using SCP, WinSCP works well for that. You'll want to transfer the DedicatedServer.zip file found in

[Steam install directory]\steamapps\common\SpaceEngineers\Tools

Unpack the zip somewhere inside

~/.wine/drive_c/users/$(whoami)/

World and config files

The easiest way to do this is to just generate them locally and copy them over to the server, this can be done by using the dedicated server tool on your windows box, the tool is located in

[Steam intall directory]\steamapps\common\SpaceEngineers\Tools\DedicatedServer\SpaceEngineersDedicated.exe
  1. Select the Default profile
  2. Set up the world
  3. Save the config
  4. Start to generate the world.

The files will be stored in

C:\Users\{USERNAME}\AppData\Roaming\SpaceEngineersDedicated\Default

Edit the SpaceEngineers-Dedicated.cfg and copy it with the Saves folder to the following directory on your Linux box

~/.wine/drive_c/users/$(whoami)/Application\ Data/SpaceEngineersDedicated

Step #3: Tweaks

You'll have to change the <LoadWorld> tag so it point to the correct directory.

If the Save folder is located in

~/.wine/drive_c/users/$(whoami)/Application\ Data/SpaceEngineersDedicated/Saves/Created 2015-03-30 2331

the <LoadWorld> tag must look like this, where {username} is the same as $(whoami)

<LoadWorld>C:\Users\{username}\Application Data\SpaceEngineersDedicated\Default\Saves\Created 2015-03-30 2331</LoadWorld> 

You still need to use windows paths.

Step #4: Run it

  1. Go to the directory where you have the dedicated server files
  2. wine SpaceEngineersDedicated.exe -console

Notes:

  • There will be a lot of messages regarding xserver, ignore them
  • Errors like fixme:shell:URL_ParseUrl failed to parse L"System.Core" are okay, ignore them.
  • Be sure to run 32bit, wine doesn't like the 64bit one.
  • There is a small bug where after stopping the server you will no longer see what you're typing into the console.
  • This guide is based on the guide I found over at Keen Software House Forums created by AdamAnt
@Scuwr
Copy link

Scuwr commented Mar 1, 2017

No, this does not work anymore because Space Engineers recently switch over to 64bit architecture, and there currently exists no linux workaround for that.

@xarinatan
Copy link

Why doesn't the 64 bit one work? I've had trouble getting it to work in the past before I ran into this and was wondering why, afaik 64 bit applications run fine inside wine/mono (wine uses mono for the .NET parts).

@Orangian
Copy link

Orangian commented Jun 4, 2019

I know I am necroing an old thread, but wine64 works with 64 bit mono/.net stuff, so that should work. I am going to attempt this myself, so I will update you soon.

@acekrystal
Copy link

I'm curious too. Just setup a server for a friend and was Blown away to find out Space Engineers doesn't come with a Linux dedicated server!!! sooo... yeah. Thats a big bummer.

@spommerening
Copy link

Came here because I wanted to give this a try too... now I'm curious... any experiences to share?

@tvwenger
Copy link

tvwenger commented Nov 2, 2019

I was able to get this working on the latest version. It is essentially a modified version of this tutorial. Here is what I did. Your mileage may vary...

Either install Space Engineers Dedicated Server via Steam, or via
steamcmd
(see https://developer.valvesoftware.com/wiki/SteamCMD)
(see https://www.spaceengineersgame.com/dedicated-servers.html)
Set install location: /path/to/SEServer

sudo dpkg --add-architecture i386
sudo apt install steamcmd
steamcmd +login anonymous +force_install_dir /path/to/SEServer +app_update 298740 +quit

Install latest wine (use the proper distro in repository)

sudo dpkg --add-architecture i386
wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'
sudo apt update
sudo apt install wine

Install latest winetricks

wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod a+x winetricks

Configure winetricks

./winetricks dotnet472
./winetricks vcrun2013
./winetricks vcrun2017

Launch Space Engineers Dedicated Server

cd /path/to/SEServer
wine DedicatedServer64/SpaceEngineersDedicated.exe

Press "Continue to server configuratior"
It should crash. But, it has made the proper directory here:

~/.wine/drive_c/users//Application Data/SpaceEngineersDedicated/

On a windows machine, install Space Engineers Dedicated Server
via Steam, launch, and create your server. Follow this guide
for info: https://www.spaceengineersgame.com/dedicated-servers.html
Save and Run your server, then stop it and exit out of the
Dedicated Server GUI.

Copy the following file and folder from the Windows machine

C:\Users{USERNAME}\AppData\Roaming\SpaceEngineersDedicated\SpaceEngineers-Dedicated.cfg
C:\Users{USERNAME}\AppData\Roaming\SpaceEngineersDedicated\Saves<World Name>\

Place that file and folder here on the Linux machine:

~/.wine/drive_c/users//Application Data/SpaceEngineersDedicated/SpaceEngineers-Dedicated.cfg
~/.wine/drive_c/users//Application Data/SpaceEngineersDedicated/Saves//

Edit SpaceEngineers-Dedicated.cfg and change the line.
Use the correct (wine) username and world name.

C:\Users\USERNAME\Application Data\SpaceEngineersDedicated\Saves\WORLDNAME

Launch Space Engineers Dedicated Server in console mode

cd /path/to/SEServer
wine DedicatedServer64/SpaceEngineersDedicated.exe -console

If you're using mods, it will take a while to download the mods
Wait until you get the "Game Ready..." message
Then you're ready to connect to the server! Be sure to update
your firewall settings, if necessary.

N.B. I've worked through this on two machines (Ubuntu 16.04 and
19.04). On one, I got hardly any error messages, but on the
other I get error messages left and right. Your milage may vary.
Everything seems to work just fine, though...

N.B.2. You can't run the server within "screen". I get the error
"Error: No IP assigned"

@wgoff194
Copy link

@tvwenger

I have followed our instructions and am having an issue with wine where when running wine at 64 bit is gets errors however when running on 32bit it says the software does not support 32 bit:

Please note that I ended up copying all of the install from windows as it did not create the appropriate directory on first run via command line.

wine with 32 bit prefix:
wine DedicatedServer64/SpaceEngineersDedicated.exe -console 0009:err:process:create_process 64-bit application L"Z:\\home\\wine\\SpaceEngineersDedicatedServer\\DedicatedServer64\\SpaceEngineersDedicated.exe" not supported in 32-bit prefix

wine 64 bit prefix:
wine DedicatedServer64/SpaceEngineersDedicated.exe -console wine: Unhandled page fault on read access to 0x140000000 at address 0x140000000 (thread 002c), starting debugger... 002e:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded. 002e:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly. 002e:fixme:dbghelp:elf_search_auxv can't find symbol in module 002e:fixme:dbghelp:elf_search_auxv can't find symbol in module 002e:fixme:dbghelp:elf_search_auxv can't find symbol in module 002e:fixme:dbghelp:elf_search_auxv can't find symbol in module Unhandled exception: page fault on read access to 0x140000000 in 64-bit code (0x0000000140000000). 002e:fixme:dbghelp:elf_search_auxv can't find symbol in module Register dump: rip:0000000140000000 rsp:000000000053fdd8 rbp:000000000053ffd0 eflags:00010246 ( R- -- I Z- -P- ) rax:0000000140000000 rbx:0000000000000000 rcx:00007fffffeaf000 rdx:0000000000000000 rsi:0000000000000000 rdi:000000000053fe40 r8:000000000053fd00 r9:0000000000000008 r10:0000000000000008 r11:0000000000000246 r12:0000000000000000 r13:0000000000000000 r14:0000000000000000 r15:0000000000000000 Stack dump: 0x000000000053fdd8: 000000007b47a41a 0000000000000000 0x000000000053fde8: 0000000000000000 0000000000000000 0x000000000053fdf8: 0000000000000000 0000000140000000 0x000000000053fe08: 00007fffffeaf000 0000000000000000 0x000000000053fe18: 0000000000000000 ffffffffffffffff 0x000000000053fe28: 000000007b4a6540 000000007b44c600 0x000000000053fe38: 0000000000000000 0000000000000000 0x000000000053fe48: 609a5e755115332b 0000000000000000 0x000000000053fe58: 0000000000000000 0000000000000000 0x000000000053fe68: 0000000000000000 609a5e755575332b 0x000000000053fe78: 609aa85de89d332b 0000000000000000 0x000000000053fe88: 0000000000000000 0000000000000000 Backtrace: =>0 0x0000000140000000 in spaceengineersdedicated (+0x0) (0x000000000053ffd0) 1 0x000000007b47a41a in kernel32 (+0x5a419) (0x000000000053ffd0) 0x0000000140000000: popq %r10 Modules: Module Address Debug info Name (18 modules) ELF 7b400000- 7b80d000 Dwarf kernel32<elf> \-PE 7b420000- 7b80d000 \ kernel32 ELF 7bc00000- 7bd16000 Deferred ntdll<elf> \-PE 7bc20000- 7bd16000 \ ntdll ELF 7c000000- 7c004000 Deferred <wine-loader> PE 140000000- 140012000 Export spaceengineersdedicated ELF 7f93e458c000- 7f93e47b6000 Deferred libtinfo.so.5 ELF 7f93e47b6000- 7f93e49d9000 Deferred libncurses.so.5 ELF 7f93e4ad9000- 7f93e4ceb000 Deferred libnss_files.so.2 ELF 7f93e4ceb000- 7f93e4f05000 Deferred libnsl.so.1 ELF 7f93e4f05000- 7f93e5111000 Deferred libnss_nis.so.2 ELF 7f93e5111000- 7f93e531b000 Deferred libnss_compat.so.2 ELF 7f93e56f9000- 7f93e5911000 Deferred libgcc_s.so.1 ELF 7f93e5911000- 7f93e5caf000 Deferred libm.so.6 ELF 7f93e5caf000- 7f93e5eb3000 Deferred libdl.so.2 ELF 7f93e5eb3000- 7f93e62a4000 Deferred libc.so.6 ELF 7f93e62a4000- 7f93e64c3000 Deferred libpthread.so.0 ELF 7f93e6868000- 7f93e6a92000 Deferred ld-linux-x86-64.so.2 Threads: process tid prio (all id:s are in hex) 0000000e services.exe 00000024 0 0000001d 0 00000015 0 00000014 0 00000013 0 00000010 0 0000000f 0 00000011 winedevice.exe 0000001c 0 00000019 0 00000018 0 00000017 0 00000016 0 00000012 0 0000001a plugplay.exe 0000001f 0 0000001e 0 0000001b 0 00000020 explorer.exe 0000002a 0 00000029 0 00000021 0 00000022 winedevice.exe 0000002f 0 00000028 0 00000027 0 00000026 0 00000025 0 00000023 0 0000002b (D) Z:\home\wine\SpaceEngineersDedicatedServer\DedicatedServer64\SpaceEngineersDedicated.exe 0000002c 0 <== System information: Wine build: wine-3.0 (Ubuntu 3.0-1ubuntu1) Platform: x86_64 Version: Windows XP Host system: Linux Host version: 4.15.0-74-generic

Any insite to what I may be missing? It appears overall that using wine, or linux in general, is so rare that there is not much information out there for this software.

Thank you for any help you can provide.

@CannonFather
Copy link

I tried tvwenger's instructions, and had it running until wine updated to ver 5.0. So I don't know if it's Wine or something that needs to catch up to wine ie winetricks....

@tvwenger
Copy link

tvwenger commented Feb 4, 2020

@CannonFather @wgoff194

This no longer works for me after the wine 5.0 update.

@CannonFather
Copy link

Do you get this error too?

0009:fixme:path:parse_url failed to parse L"VRage.Input" 0009:fixme:path:parse_url failed to parse L"VRage.NativeWrapper" 002e:fixme:ole:Context_CC_ContextCallback (000000001A69A810/000000001A69A818)->(0000000000EC2B80, 000000001A54F770, {d7174f82-36b8-4aa8-800a-e963ab2dfab9}, 2, 0000000000000000) 002e:fixme:ole:Context_CC_ContextCallback (000000001A69A810/000000001A69A818)->(0000000000EC2B80, 000000001A54F660, {d7174f82-36b8-4aa8-800a-e963ab2dfab9}, 2, 0000000000000000) 002e:fixme:ole:Context_CC_ContextCallback (000000001A693060/000000001A693068)->(0000000000EC2B80, 000000001A54F770, {d7174f82-36b8-4aa8-800a-e963ab2dfab9}, 2, 0000000000000000) 002e:fixme:ole:Context_CC_ContextCallback (000000001A693060/000000001A693068)->(0000000000EC2B80, 000000001A54F660, {d7174f82-36b8-4aa8-800a-e963ab2dfab9}, 2, 0000000000000000) 0009:fixme:path:parse_url failed to parse L"VRage.Game.XmlSerializers" 0009:fixme:path:parse_url failed to parse L"SpaceEngineers.ObjectBuilders.XmlSerializers" 0009:fixme:path:parse_url failed to parse L"Sandbox.Game.XmlSerializers" 0009:fixme:combase:RoGetActivationFactory (L"Windows.Foundation.Diagnostics.AsyncCausalityTracer", {50850b26-267e-451b-a890-ab6a370245ee}, 000000000052D828): semi-stub 0009:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Foundation.Diagnostics.AsyncCausalityTracer" 0009:fixme:ntdll:EtwEventRegister ({2e5dba47-a3d2-4d16-8ee0-6671ffdcd7b5}, 0x1d02040c, (nil), 0x22ceaa0) stub. 0009:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 0x22cea58, 40) stub 0034:fixme:sync:SetWaitableTimerEx (0000000000001374, 000000002219FC40, 500, 0000000000000000, 0000000000000000, 0000000000000000, 50) semi-stub 0009:fixme:path:parse_url failed to parse L"System.Runtime.Serialization" 2020-02-04 16:11:20.240: Bind IP : 0.0.0.0:27016 0009:fixme:combase:RoGetParameterizedTypeInstanceIID stub: 4 000000001A6ED4D8 0000000000529678 000000000052A3B0 0000000000000000 0009:fixme:combase:RoGetParameterizedTypeInstanceIID stub: 3 000000001A701C50 000000000052A258 000000000052AF90 0000000000000000 0009:fixme:combase:RoGetParameterizedTypeInstanceIID stub: 3 000000001A701C50 000000000052A258 000000000052AF90 0000000000000000 0009:fixme:path:parse_url failed to parse L"System.Runtime.CompilerServices.Unsafe" 0009:fixme:combase:RoGetParameterizedTypeInstanceIID stub: 4 000000001A742520 000000000052BB68 000000000052C8A0 0000000000000000 0009:fixme:combase:RoGetParameterizedTypeInstanceIID stub: 3 000000001A745DB0 000000000052C748 000000000052D480 0000000000000000 0009:fixme:combase:RoGetParameterizedTypeInstanceIID stub: 3 000000001A745DB0 000000000052C748 000000000052D480 0000000000000000 0009:fixme:combase:RoGetParameterizedTypeInstanceIID stub: 4 000000001A74D1D8 000000000052A6E8 000000000052B420 0000000000000000 0009:fixme:combase:RoGetParameterizedTypeInstanceIID stub: 3 000000001A74D1B0 000000000052B2C8 000000000052C000 0000000000000000 0009:fixme:combase:RoGetParameterizedTypeInstanceIID stub: 3 000000001A74D1B0 000000000052B2C8 000000000052C000 0000000000000000 2020-02-04 16:11:24.736: Error starting Steam dedicated server
I see the error
0009:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Foundation.Diagnostics.AsyncCausalityTracer"

But it crashes after trying to bind the IP?

I'm a total newb at this and probably wouldn't understand the solution anyway. I hope a solution is found though. I was having fun running my own dedicated server on a space computer I have.

@tvwenger
Copy link

tvwenger commented Feb 5, 2020

@CannonFather

I wasn't getting that many errors, but I was getting the "Error starting Steam dedicated server" error you get at the end. I spent several hours trying to get it working with wine5.0, then several more hours trying to get it working with a re-installed wine1.6 to no avail.

In the end, I simply installed a windows virtual machine and am running the server from there. Seems to work fine - if not better!

@Frontrider
Copy link

The latest proton (5.0 at the time) can run the client, with a tweak to pulseaudio. The wine it's based on may work.

@userx14
Copy link

userx14 commented Nov 8, 2020

by following @tvwenger 's post I got the most recent SEdedicatedServer 64bit 1.195 running on Debian 10:

Requirements (older versions did not work for me):

with winetricks:

  • create fresh 64bit prefix
  • install dotnet48 (you probably need a working xserver not xvfb to click through the installer dialog)
  • install vcrun2013 (same as above)
  • install vcrun2015 (same as above)

and ignore all occuring error messages 😄 , especially for dotnet48 there will be many...

copy the common/SpaceEngineersDedicatedServer directory from your Windows machine into the wineprefix

launch once with while beeing in the .../drive_c/.../Steam/steamapps/common/SpaceEngineersDedicatedServer directory !important!
and make sure that enviroment variable WINEPREFIX is set correctly.
/usr/bin/xvfb-run /usr/bin/wine ./DedicatedServer64/SpaceEngineersDedicated.exe
so that
~/.wine/drive_c/users/$(whoami)/Application\ Data/SpaceEngineersDedicated
is created

copy the stuff from your windows machine over to the folder, and launch
/usr/bin/xvfb-run /usr/bin/wine ./DedicatedServer64/SpaceEngineersDedicated.exe -console
after you verified that the enviroment variable WINEPREFIX is set correctly.
With another terminal you can check that cpu usage is ~25% on all cores and that the program starts consuming memory.
A log file with the current date will be created in the Application\ Data/SpaceEngineersDedicated directory.

There will be many error messages from wine, but as long as you get a "game ready" somewhere inside the mess after about 30sec you should be fine.

The only thing I could not get working is terminating the server so that it saves the world automatically when launched with systemctl.
In the systemctl service file I call a bash file, because the windows path with Progamm Files (x86) can't be escaped properly in systemctl.
The bash file (change the cd depending on your wineprefix location):

#!/bin/bash
export WINEPREFIX=/opt/spaceeng/winePrefix
cd '/opt/spaceeng/winePrefix/drive_c/Program Files (x86)/Steam/steamapps/common/SpaceEngineersDedicatedServer'
/usr/bin/xvfb-run /usr/bin/wineconsole ./DedicatedServer64/SpaceEngineersDedicated.exe -console

@userx14
Copy link

userx14 commented Nov 9, 2020

Some updates:
Using wine-staging, forcing the installation of dotnet48, usine winecfg and setting os to windows 7 and starting the server with
wineconsole ./DedicatedServer64/SpaceEngineersDedicated.exe -noconsole
the remote management api port 8080 was opened, according to the log.

The following problems persist:

  • the server does not respond to any requests on the management port, even though netstat reports a listening port
  • quitting the server with CTRL+C or any other way will produce an autosave entry in the log, but the FileWriterThread seems to crash prematurely, therefore the autosave on shutdown is lost.

I experimented with the remote management api and managed to remotely initiate a save over the network when running nativeley on windows with an http PATCH request to the remote management api, by slightly modifying this git project: https://github.com/chris007de/pyvrageremoteapi .

In this line https://github.com/chris007de/pyvrageremoteapi/blob/b6c48468d12c5739f9b5a1b4a4f9b47aaed10a27/pyvrageremoteapi.py#L89 GET must be changed to PATCH and then calling
python pyvrageremoteapi.py --url http://localhost:8080 --key XKb8xk7vrKaq+BpallYnGA== --resource session
will trigger an autosave.

So the idea was to launch this python script before the systemctl service goes down, but unfortunately the dedicated server's remote management port does not work.

So If someone get's the remote management port to work please share it here.

@userx14
Copy link

userx14 commented Nov 14, 2020

I found a kind of hacky solution. By checking the directory where the savefiles go for new files one can time the termination of the server with a upcoming autosave. The disadvantage is that this can take a while, depending on the autosave intervall. (You can force a save as admin with /save in the chat 😄 )
Here the systemctl user files, in case someone might find them helpfull:
spaceeng.service at ~/.config/systemd/user/spaceeng.service

[Unit]
Description="Space Engineers wine server"
Requires=xvfb.service
After=xvfb.service

[Service]
Environment=DISPLAY=:1.0
Environment=WINEPREFIX=/opt/spaceeng/winePrefix
Type=simple
WorkingDirectory=/opt/spaceeng/winePrefix/drive_c/Program Files (x86)/Steam/steamapps/common/SpaceEngineersDedicatedServer
KillMode=control-group
KillSignal=SIGKILL
ExecStart=/usr/bin/wineconsole ./DedicatedServer64/SpaceEngineersDedicated.exe -noconsole
ExecStop=/opt/spaceeng/checkSaveUpdate.sh
TimeoutSec=0
TimeoutStopSec=700
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The checkSaveUpdate.sh located at /opt/spaceeng/checkSaveUpdate.sh

#!/bin/bash
path='/opt/spaceeng/winePrefix/drive_c/users/yourUsername/Application Data/SpaceEngineersDedicated/Saves'
i=""
while [ -z "$i" ]
do
	i=$(find "$path" -mmin 0.2)
	sleep 1
done
sleep 15

And the xvfb file at ~/.config/systemd/user/xvfb.service , if you plan to run headless:

[Unit]
Description=X Virtual Frame Buffer Service
After=network.target

[Service]
ExecStart=/usr/bin/Xvfb :1 -screen 0 1024x768x16

[Install]
WantedBy=multi-user.target

To avoid that the user service gets killed when leaving the console which is logged in as that user execute
loginctl enable-linger

To shutdown the server just
systemctl --user stop spaceeng
to force a save an Admin on the server can force a save by sending
/save
in the chat, if you don't want to wait for the next autosave.

@userx14
Copy link

userx14 commented Dec 19, 2020

Also a note, if it starts and crashes with the following message in the log:

MyDefinitionManager.GetSessionPreloadDefinitions() - START
2020-12-19 20:53:07.557 - Thread:   1 ->     World Sandbox.sbc not found.
2020-12-19 20:53:07.557 - Thread:   1 ->     Creating new one with same name
2020-12-19 20:53:07.567 - Thread:   1 ->     Cannot start new world - Premade world not found 
2020-12-19 20:53:07.568 - Thread:   1 ->  MySandboxGame.Initialize() - END
2020-12-19 20:53:07.601 - Thread:   1 ->  Exception occurred: System.ApplicationException: Session can not start. Save is corrupted or not valid. See log file for more information.
   at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen)
   at VRage.Dedicated.DedicatedServer.RunInternal(String instanceName)
   at VRage.Dedicated.DedicatedServer.RunMain(String instanceName, String customPath, Boolean isService, Boolean showConsole, Boolean checkAlive)
   at VRage.Dedicated.DedicatedServer.ProcessArgs(String[] args)
   at VRage.Dedicated.DedicatedServer.Run(String[] args, Action`1 initializeServices)
   at SpaceEngineersDedicated.MyProgram.Main(String[] args)

Then you need to edit the file in Application Data/SpaceEngineersDedicated/Saves/LastSession.sbl
and change the line from
<Path>C:\Users\myUsername\AppData\Roaming\SpaceEngineersDedicated\Saves\Star System</Path>
to
<Path>C:\Users\myUsername\Application Data\SpaceEngineersDedicated\Saves\Star System</Path>

@userx14
Copy link

userx14 commented Dec 20, 2020

Further convinience, an automatic update service that finally works:

[Unit]
Description="Space Engineers Updater"

[Service]
Type=simple
WorkingDirectory=/home/userName
ExecStart=/usr/games/steamcmd +@sSteamCmdForcePlatformType windows +force_install_dir /opt/spaceeng/winePrefix/drive_c/Steamdir/steamapps/common/SpaceEngineersDedicatedServer/ +login anonymous +app_update 298740 +quit
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

But you need to create the softlink /opt/spaceeng/winePrefix/drive_c/Steamdir which points to /opt/spaceeng/winePrefix/drive_c/Program Filex (x86)/Steam, because steamcmd seems to choke on spaces in the path.

@Ic3x
Copy link

Ic3x commented May 18, 2021

So reading all this seems to me as it still works with Linux. Anyone able to make new instructions? I'm very new to Linux and cant figure some things out. The help in the later post like install this and that is a bit hard for me, as I'm totally not familiar with Linux

@userx14
Copy link

userx14 commented May 19, 2021

Hi @Ic3x,

The help in the later post like install this and that is a bit hard for me

on which particular step are you stuck on? And which distibution of linux are you using?
I've held some things this short because they are explained better on other websites already, like installing wine-staging on debian:
https://wiki.winehq.org/Debian
And some things are of course specific to your linux distribution.

So reading all this seems to me as it still works with Linux.

Have not tested this since Jan.21 but would guess it still works.

Greetings
Benjamin

@Ic3x
Copy link

Ic3x commented May 19, 2021

To be honest, i think the Problem is allready at Wine. I installed the newest version, i think i installed the i386 and winetricks. At the moment i have a Problem with a GUI. i Use Ubuntu Server 21 without GUI.
Wine says it has Problem with X server. Wasnt this for GUI purpose? wont work with other apllications either. I use a VM and seem to miss somethink here.

@userx14
Copy link

userx14 commented May 20, 2021

Wasnt this for GUI purpose? wont work with other apllications either.

Yes X server is part of the GUI. If you install the Server version of Ubuntu you will not have X server or a window manager installed.
This shouldn't have something to do with you using a VM.

But in order to install the dotnet stuff with winetricks you probably need an X server + windows manager to click through the dialogs.

I guess you have three options:

  • temporary install xserver and a window manager on Ubuntu Server
  • use a remote xserver solution like x2go (which will also install xserver)
  • use a different vm-image with GUI like a normal Ubuntu or Debian to create the wine drive, then copy the resulting wine-drive to your headless vm.

@userx14
Copy link

userx14 commented Sep 21, 2021

Tested working on the most recent version (1.199.025)

But the most recent wine version 6.X breaks networking and when trying to connect I get

Peer2Peer_SessionRequest [xxxx]
Peer2Peer_ConnectionFailed [xxxx], Timeout

Using an older wine version (5.1~buster) fixed this for me.
With the latest version one has to change AppData\Roaming -> \Application Data
in SpaceEngineers-Dedicated.cfg and LastSession.sbl

@tvwenger
Copy link

I also recently tried this with the latest wine 6.X and was unable to get it to work. Instead, I use a docker container which works flawlessly with wine 6.X.

https://github.com/mmmaxwwwell/space-engineers-dedicated-docker-linux

@Crazygamer212
Copy link

will it be possible to create a custom linux server or does space engineers have the server architecture closed source with no docs

@userx14
Copy link

userx14 commented Oct 1, 2023

@Crazygamer212 there is an old version of the source code, including the dedicated server, on github. But it is no longer updated, see: https://blog.marekrosa.org/2017/08/statement-on-space-engineers-github.html

@RedstoneWizard08
Copy link

RedstoneWizard08 commented Jan 2, 2024

By the way, theoretically this should work on arm64, I am still testing it:

FROM ubuntu:23.04

ENV DEBIAN_FRONTEND=noninteractive \
    TZ=America/Los_Angeles

RUN apt-get update && \
    apt-get -y install \
        git \
        curl \
        wget \
        bash \
        sudo \
        tar \
        gzip \
        xz-utils

# Pi Apps
RUN git clone --recursive https://github.com/Botspot/pi-apps /usr/share/pi-apps
RUN sed -i 's/error "Pi-Apps is not designed to be installed as root! Please try again as a regular user."/echo -e "\\e[93mPi-Apps is not designed to be installed as root! Things may break!\\e[39m"/g' /usr/share/pi-apps/install
RUN /usr/share/pi-apps/install
RUN sed -i 's/error "Pi-Apps is not designed to be run as root! Please try again as a regular user."/echo -e "\\e[93mPi-Apps is not designed to be run as root! Things may break!\\e[39m"/g' /usr/share/pi-apps/gui
RUN sed -i 's/error "Pi-Apps is not designed to be run as root! Please try again as a regular user."/echo -e "\\e[93mPi-Apps is not designed to be run as root! Things may break!\\e[39m"/g' /usr/share/pi-apps/manage
RUN /usr/share/pi-apps/manage install Box64
RUN /usr/share/pi-apps/manage install Box86
RUN /usr/share/pi-apps/manage install "Wine (x64)"

# SteamCMD
RUN mkdir -p /usr/share/steamcmd
WORKDIR /usr/share/steamcmd
RUN curl -fsSL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar -zxvf -
COPY steamcmd-2.sh /usr/share/steamcmd/
RUN chmod a+rx steamcmd.sh steamcmd-2.sh linux32/*
RUN chmod -R a+rwx /usr/share/steamcmd
RUN ln -sf /usr/share/steamcmd/steamcmd-2.sh /usr/local/bin/steamcmd

# Server
RUN steamcmd +force_install_dir ./server +login anonymous +app_update 298740 +quit
RUN mv /usr/share/steamcmd/server /server
WORKDIR /server

# Dependencies
RUN winetricks -q dotnet40 || true

# Startup
CMD [ "/usr/local/bin/wine", "/server/DedicatedServer64/SpaceEngineersDedicated.exe", "-console" ]

The only change with steamcmd-2.sh from the original steamcmd.sh is this:

3c3
< STEAMROOT="$(cd "${0%/*}" && echo $PWD)"
---
> STEAMROOT="$(dirname "$(realpath "$0")")"
34,35c34
<   : "${DEBUGGER_ARGS=}"
<   $DEBUGGER -x "$ARGSFILE" $DEBUGGER_ARGS --args "$STEAMEXE" "$@"
---
>   $DEBUGGER -x "$ARGSFILE" "$STEAMEXE" "$@"

@lenderber
Copy link

@RedstoneWizard08, Hi. Did anything go beyond testing? Was there a test run of the server in docker?

@RedstoneWizard08
Copy link

RedstoneWizard08 commented Jun 29, 2024

I don't remember. It's been a few months. I'll test again, but I think it worked.

@daantimmer
Copy link

For the life of me, I can't get this to work:

FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive \
    TZ=America/Los_Angeles

RUN apt-get update && apt-get -y install \
    bash \
    curl \
    git \
    gzip \
    lib32gcc-s1 \
    sudo \
    tar \
    wget \
    wine \
    winetricks \
    xz-utils \
    && rm -rf /var/lib/apt/lists/*

# SteamCMD
WORKDIR /usr/share/steamcmd
RUN curl -fsSL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar -zxvf - \
    && chmod a+rx steamcmd.sh linux32/* \
    && chmod -R a+rwx /usr/share/steamcmd \
    # # Server
    && ./steamcmd.sh +force_install_dir ./server +login anonymous +app_update 298740 +quit \
    && mv /usr/share/steamcmd/server /server

WORKDIR /server
# Dependencies
RUN winetricks -q dotnet40 || true

# Startup
CMD [ "wine", "/server/DedicatedServer64/SpaceEngineersDedicated.exe", "-console" ]

I had to install wine and winetricks which was missing. used the normal steamcmd isntead of the custom one. As I saw no issues with it. Also merged RUN commands, as per linter.

When I run the last CMD I get:

root@cb8a0d3def06:/server# wine "/server/DedicatedServer64/SpaceEngineersDedicated.exe" -console
it looks like wine32 is missing, you should install it.
multiarch needs to be enabled first.  as root, please
execute "dpkg --add-architecture i386 && apt-get update &&
apt-get install wine32:i386"
0044:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0044:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0044:err:systray:initialize_systray Could not create tray window
0044:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0044:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0044:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0024:err:ole:com_get_class_object class {079aa557-4a18-424a-8eee-e39f0a8d41b9} not registered
0024:err:ole:com_get_class_object no class object {079aa557-4a18-424a-8eee-e39f0a8d41b9} could be created for context 0x1
0024:err:ole:com_get_class_object class {079aa557-4a18-424a-8eee-e39f0a8d41b9} not registered
0024:err:ole:com_get_class_object no class object {079aa557-4a18-424a-8eee-e39f0a8d41b9} could be created for context 0x1
0024:err:mscoree:CLRRuntimeInfo_GetRuntimeHost Wine Mono is not installed
0044:err:ole:start_rpcss Failed to open RpcSs service

Yet, I was under the impression that the SEDS required a 64bit environment?

@userx14
Copy link

userx14 commented Sep 18, 2024

Maybe checkout this wine installation script from mmmaxwwwell for setting up the wineprefix:
https://github.com/mmmaxwwwell/space-engineers-dedicated-docker-linux/blob/v2/install-winetricks
I also needed dotnet48 and vcrun20XX, but can't comment on docker setups though, as I now run this on nixos as a flake.
Most likely 0024:err:mscoree:CLRRuntimeInfo_GetRuntimeHost Wine Mono is not installed is caused by these missing.

The wine32 thing just sounds like some warning one could ignore. I always use a 64bit wineprefix for space engineers and it works with the most recent version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment