Matoking / protontricks

A wrapper that does winetricks things for Proton enabled games, requires Winetricks.
GNU General Public License v3.0
1.64k stars 36 forks source link

protontricks appears to require --no-bwrap #299

Closed ericx closed 4 months ago

ericx commented 4 months ago

I ran into this while running modorganizer2-linux-installer to set up Skyrim Special Edition. The installer script eventually runs:

$ protontricks -vc 'echo $WINEPREFIX' 489830
protontricks (INFO): Found Steam directory at /home/ericx/.local/share/Steam
protontricks (INFO): Using default Steam Runtime at /home/ericx/.local/share/Steam/ubuntu12_32/steam-runtime
protontricks (INFO): Winetricks path is set to /usr/bin/winetricks
protontricks (INFO): Found 1 Steam library folders
protontricks (INFO): Currently logged-in Steam user: ericx_steam@vineyard.net
protontricks (INFO): Couldn't find custom shortcuts. Maybe none have been created yet?
protontricks (INFO): User has configured app Proton version (CompatToolMapping): proton_9
protontricks (INFO): User has configured default Proton version (CompatToolMapping): GE-Proton8-14
protontricks (INFO): Found active compatibility tool: Proton 9.0
protontricks (INFO): Active compatibility tool is a Proton installation
protontricks (INFO): Using 'bwrap = True' as default value
protontricks (INFO): Using separately installed Steam Runtime: Steam Linux Runtime 3.0 (sniper)
protontricks (INFO): Running Steam Runtime using bwrap containerization.
If any problems arise, please try running the command again using the `--no-bwrap` flag and make an issue report if the problem only occurs when bwrap is in use.
protontricks (INFO): Created Steam Runtime Wine binary directory at /home/ericx/.cache/protontricks/proton/Proton 9.0/bin
protontricks (INFO): WINESERVER environment variable is not available. Setting WINESERVER environment variable to Proton bundled version
protontricks (INFO): Starting bwrap launcher process: /home/ericx/.cache/protontricks/proton/Proton 9.0/bin/bwrap-launcher
protontricks - bwrap-launcher 150552: Following directories will be mounted inside container: /boot /etc /home /media_shares /misc /mnt /net /opt /root /sbin /srv /sudo:root@ella.ericx.net: /tmp /run/media
protontricks - bwrap-launcher 150552: Using temporary directory: /tmp/protontricks-lawrtlgu
pressure-vessel-wrap[150552]: E: ':' and '\' in --filesystem argument not handled yet
protontricks (INFO): Terminating launcher process 150552
protontricks (INFO): Launcher process terminated
Traceback (most recent call last):
  File "/usr/bin/protontricks", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/lib/python3.12/site-packages/protontricks/cli/main.py", line 32, in cli
    main(args)
  File "/usr/lib/python3.12/site-packages/protontricks/cli/util.py", line 159, in wrapper
    return cli_func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/protontricks/cli/main.py", line 381, in main
    returncode = run_command(
                 ^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/protontricks/util.py", line 516, in run_command
    raise RuntimeError(
RuntimeError: bwrap launcher crashed, returncode: 2
[Exit 1 ]

And this is fixed by including --no-bwrap:

$ protontricks --no-bwrap -c 'echo $WINEPREFIX' 489830
/home/ericx/.local/share/Steam/steamapps/compatdata/489830/pfx

I didn't manage to find the source of the issue, but I did see that there is a call to ~/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/run with the string /sudo:root@ella.ericx.net: as one of the directories to mount. And then run invokes:

/home/ericx/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/pressure-vessel/bin/pressure-vessel-unruntime --share-pid --launcher --pass-fd 4 --filesystem /boot --filesystem /etc --filesystem /home --filesystem /media_shares --filesystem /misc --filesystem /mnt --filesystem /net --filesystem /opt --filesystem /root --filesystem /sbin --filesystem /srv --filesystem /sudo:root@ella.ericx.net: --filesystem /tmp --filesystem /run/media -- --info-fd 4 --bus-name=com.github.Matoking.protontricks.App489830_du5psm9_

And this seems to be where pressure-vessel-wrap[150552]: E: ':' and '\' in --filesystem argument not handled yet is coming from. At a guess, I think the [space] char between "/sudo:root@ella.ericx.net:" and "/tmp" is related?

Versions:

Matoking commented 4 months ago

The "filesystem argument not handled yet" error was reported in the previous issue #281 and Protontricks was updated to make that error message more prominent. I suggested --no-bwrap as a potential workaround:

If renaming or deleting the offending directory is not an option, you should be able to use --no-bwrap flag as a workaround, though that means Proton won't be run under Steam Runtime and you might run into other issues.

The root cause is Steam Runtime not supporting the two characters.

Do you know what created the problematic root directory /sudo:root@ella.ericx.net:? It seems like an odd directory, and one you might not have intended to create. If that's the case, another option would be to delete it.

ericx commented 4 months ago

Thank you. As far as I can tell, the 'sudo:' string is added by protontricks itself? I will keep digging; but the original invocation simply requests "echo $WINEPREFIX" and there is no mention of filesystems to mount. I was originally searching for the addition of that string, but I stopped when I found the --no-bwrap option solved the issue. So I will dig more to find where that mount option comes from.

Matoking commented 4 months ago

The mount directories are discovered in the Bash script here using a simple for dir in /* loop.

https://github.com/Matoking/protontricks/blob/master/src/protontricks/data/scripts/bwrap_launcher.sh#L51

Protontricks itself doesn't use sudo anywhere.

The simple way to check this would be to run ls -lha / and see what comes up.

ericx commented 4 months ago

oh.... Now I feel stupid. There is a directory in my root named "sudo:root@ella.ericx.net:" from 2 years ago.

emacs syntax for opening a directory as a sudo'd root is: "sudo::root@[hostname]:/[whatever]" and I must have created the directory by typo. Thanks for your time.