Recently Steam released Steam Play, which uses their fork of Wine hosted by Steam called Proton (GitHub) to allow us to play our complete games library under Linux. It creates wineprefixes for all of your games that don't already have a Linux port and works a far cry better than wine.
I'm trying to run Supreme Commander - Forged Alliance (Steam App ID: 9420) and play it on its unofficial multiplayer client, FAF. The game used to work with Wine, but now has a number of issues (for example, fullscreen doesn't work and high tendency to blackscreen in windowed). But it does work with Proton.
What I'm trying to do here is run this specific Steam game via terminal, not via Steam's GUI.
My intent isn't to circumvent Steam DRM, which running the games via terminal likely wouldn't accomplish anyways, but to run it with dynamic arguments. This will allow setting up multiplayer matches. This will be applied to other games in the future.
But I'm running into trouble when running in the terminal:
cd ~/.local/share/Steam/steamapps/common/Proton*
STEAM_COMPAT_DATA_PATH=/home/t/.local/share/Steam/steamapps/compatdata/9420 ./proton run /home/t/.local/share/Steam/steamapps/common/Supreme\ Commander\ Forged\ Alliance/bin/SupremeCommander.exe
I get an Error window: "Application load error P : 0000065615" and closing this simply brings me back to terminal with no extra output. I've experimented with other games:
Age of Empires 2 HD fails, but with a much more verbose error message window stating steam must be running, but I had Steam running at the time (and it would run if I clicked the play button in Steam).
Bannerman: there is no message at all and even less terminal verbose.
Shadow Complex Remastered gets an actual loader screen of the game, runs for about two seconds then crashes with an error:
CAppInfoCacheReadFromDiskThread took 3 milliseconds to initialize CApplicationManagerPopulateThread took 7 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
So no game seems to run successfully via this method.
Maybe some potential here UPDATE 3/10/2018:
WINEPREFIX="/home/t/fa-wineprefix/":"/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/lib/wine winecfg"
PATH="/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/bin/:$PATH"
export WINEDLLPATH="/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/lib64/wine:/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/lib/wine"
export LD_LIBRARY_PATH="/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/lib64:/path/to/steam/steamapps/common/Proton 3.7/dist/lib:/usr/lib/steam:/usr/lib32/steam"
WINEPREFIX="/home/t/fa-wineprefix/" "/home/t/.local/share/Steam/steamapps/common/Proton 3.7/dist/bin/./wine" "/home/t/.local/share/Steam/steamapps/common/Supreme Commander Forged Alliance/bin/SupremeCommander.exe"
but this method fails at the last command with this error window:
Application load error P:0000065434
as well as some terminal output:
001f:err:module:load_builtin_dll failed to load .so lib for builtin L"winebus.sys": libudev.so.0: cannot open shared object file: No such file or directory
001f:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\WineBus": c0000142
001f:err:winedevice:create_driver failed to create driver L"WineBus": c0000142
0013:err:service:process_send_command service protocol error - failed to write pipe!
000d:fixme:service:scmdatabase_autostart_services Auto-start service L"WineBus" failed to start: 1114
0009:err:module:load_library somehow failed to load steamclient
so now we know more about the issue. it seems despite steam being running and every measure to let it know where steam is it does not find steam.
I also tried the same thing from inside the proton folder with the same result.
Some new potential here UPDATE 3/10/2018 :
the trick he mentions is creating a small python script protonRunner.py
:
#!/usr/bin/env python
import os
import sys
home = os.environ["HOME"]
os.environ["STEAM_COMPAT_DATA_PATH"] = home + "/.local/share/Steam/steamapps/compatdata/9420"
run = "run"
exe = "\"" + home + "/.local/share/Steam/steamapps/common/Supreme Commander Forged Alliance/bin/SupremeCommander.exe\""
cmd = "\"" + home + "/.local/share/Steam/steamapps/common/Proton 3.7/proton\" " + run + " " + exe
for arg in sys.argv[1:]:
cmd += " " + arg
os.system(cmd)
supcomFA.desktop
:
[Desktop Entry]
Name=SupremeCommander
Exec=python $HOME/.local/share/Steam/steamapps/common/Proton\ 3.7/protonRunner.py
Icon=/home/t/.local/share/icons/supcom.png
Type=Application
Encoding=UTF-8
Version=1.0
Terminal=true
doing this accomplishes the same error message:
Application load error P:0000065434
TL;DR: How to run a Windows Steam game (that manages to run via Proton on Linux) from the terminal.
Here's an experiment that may help you get the answer. For convenience, I'll refer to your default Steam library location as
$STEAM
(the default is~/.local/share/Steam/
). Proton is installed by default to$STEAM/steamapps/common/Proton 3.7
, I'll call this$PROTON
.So, when I tried running The Witcher, Steam ran this command:
Where
$STEAM
has backslashes instead of slashes, as it's a Windows path. In addition, it set something like 70 environment variables (related to Wine, Steam, various hardware/drivers, libraries, etc.). A single variable,WINESERVERSOCKET
referred to the wine server started for this instance. If I omitted this variable and used all the rest, I could start the game from the command line.Steps:
Replace
$PROTON/dist/bin/wine-preloader
with a wrapper script that saves the environment somewhere:The script is essentially this:
It saves the environment, except for
WINESERVERSOCKET
, in~/env
, the command to run and arguments in~/cmd
and runs the actual file with the arguments provided. It uses ASCII null characters to separate everything, since the actual environment variables may contain newlines.Note that I save the command with
-orig
added for convenience.Run the game from the Steam GUI. The wrapper script will create these files.
You can load the environment and run the command from these files. In bash
-d ''
here tells bash the files use the ASCII null character as delimiter.This much was sufficient for The Witcher to run for me. All of those environment variables probably won't be necessary. I leave it to you to test which aren't.
Of course, all of these might be completely unnecessary. Looking at Steam's command-line options, we have:
And when I ran:
the Wine command was:
So Steam did pass on
foo
andbar
as arguments to the game. This might be all you need.I have found the solution thanks to some help by aeikum on the steam proton github :
https://www.youtube.com/watch?v=zQkiy8lK20o (updated 3/12/2019) https://github.com/tatsujb/installFAFscript