ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.31k stars 227 forks source link

Steam installed via install_steam.sh script not working #975

Open AlphaCraft9658 opened 3 months ago

AlphaCraft9658 commented 3 months ago

I installed Steam via the install_steam.sh script in the root of this repository inside of a proot-distro Debian instance, which was shipped with Termux_XFCE. I made sure that binutils is installed, because the ar command has failed to run. Steam is installed, as it seems, and I tried running it with the steam and box64 steam commands, but I am getting this error, together with the rest of the output (this example is from running it with box64 manually):

Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Cortex-A510 Cortex-A710 - with 8 Cores
Will use Hardware counter measured at 19.2 MHz emulating 2.4 GHz
Params database has 80 entries
Box64 with Dynarec v0.2.9 cac43a1f built on Jul  3 2024 06:22:30
BOX64: Didn't detect 48bits of address space, considering it's 39bits
Counted 25 Env var
BOX64 LIB PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/:/data/data/com.termux/files/usr/glibc/lib/x86_64-linux-gnu/
BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/:/data/data/com.termux/files/usr/bin/:/system/bin/:/system/xbin/
Looking for steam
Apply RC params for steam
Applying BOX64_CRASHHANDLER=1
Applying BOX64_EMULATED_LIBS=libudev.so.0
Not an ELF file (sign=#!/b)
Error: Reading elf header of /usr/local/bin/steam, Try to launch natively instead
steam.sh[19913]: Running Steam on debian 12 64-bit
steam.sh[19913]: STEAM_RUNTIME is enabled by the user
setup.sh[19977]: Steam runtime environment up-to-date!
/home/alpha-craft/.local/share/Steam/ubuntu12_32/steam-runtime/run.sh: line 85: steam-runtime-identify-library-abi: command not found
run.sh[19993]: steam-runtime-identify-library-abi --ldconfig-paths failed, falling back to ldconfig
steam.sh[19913]: Can't find 'steam-runtime-check-requirements', continuing anyway
/home/alpha-craft/.local/share/Steam/steam.sh: line 792: /home/alpha-craft/.local/share/Steam/ubuntu12_32/steam: cannot execute: required file not found

I looked at some things but couldn't figure out what was going on. Am I doing something wrong or might this be a general issue/bug?

RyuRaiko commented 3 months ago

Are you using the BOX86_LOG=1 variable? if not I would do so as it will give you a more comprehensive log. Enable it by entering export BOX86_LOG=1

AlphaCraft9658 commented 3 months ago

Are you using the BOX86_LOG=1 variable? if not I would do so as it will give you a more comprehensive log. Enable it by entering export BOX86_LOG=1

I wasn't using that, but setting this environment variable doesn't seem to have changed the output.

AlphaCraft9658 commented 3 months ago

Are you using the BOX86_LOG=1 variable? if not I would do so as it will give you a more comprehensive log. Enable it by entering export BOX86_LOG=1

I tried tracing which commands and scripts are executed in which way when running the "steam" command, and I found the actual steam binary, which is started in the end. When executing it directly, I get the same error, that the required file is not found. Is that a potential architecture conflict here? Or what might be broken in this case? I read that a similar error happens when trying to run a DOS script in bash, which can be converted, but that's not the case here.

AlphaCraft9658 commented 3 months ago

Are you using the BOX86_LOG=1 variable? if not I would do so as it will give you a more comprehensive log. Enable it by entering export BOX86_LOG=1

I tried tracing which commands and scripts are executed in which way when running the "steam" command, and I found the actual steam binary, which is started in the end. When executing it directly, I get the same error, that the required file is not found. Is that a potential architecture conflict here? Or what might be broken in this case? I read that a similar error happens when trying to run a DOS script in bash, which can be converted, but that's not the case here.

Apparently the scripts don't run steam with box64. Running the binary with box64 manually does start steam, but it immediately crashes, as steam needs to be online in order to update. How does steam not have an internet connection here? The script seems to be kinda broken.

ptitSeb commented 3 months ago

steam is a 32bits process, so it will run with box86 (and then, steam will launch steamwebhelper, that is a 64bits process, and needs box64, so will need both to run steam).

file no found means that you either lack binfmt integration, or the armhf subsystem entirely

Read the COMPILE.md to see how to add armhf subsystem on Debian/Ubuntu type of OS. For anything else, you'll to google it. If you lack binfmt integration (it can happens with Termux), then you need to setup BOX64_BASH to point to a x86_64 version of bash (availabe in the tests folder of box64 repo) and launch the shell script with box64. box64 will then run the shell script with that bash, and launch any 64bits apps with box64 and x86 apps with box86 (as long as there are installed in the same folder). That should compensate for the lack of binfmt.

AlphaCraft9658 commented 3 months ago

steam is a 32bits process, so it will run with box86 (and then, steam will launch steamwebhelper, that is a 64bits process, and needs box64, so will need both to run steam).

file no found means that you either lack binfmt integration, or the armhf subsystem entirely

Read the COMPILE.md to see how to add armhf subsystem on Debian/Ubuntu type of OS. For anything else, you'll to google it. If you lack binfmt integration (it can happens with Termux), then you need to setup BOX64_BASH to point to a x86_64 version of bash (availabe in the tests folder of box64 repo) and launch the shell script with box64. box64 will then run the shell script with that bash, and launch any 64bits apps with box64 and x86 apps with box86 (as long as there are installed in the same folder). That should compensate for the lack of binfmt.

That should be the solution then. I have been warned by apt that binfmt doesn't work inside containers. I gotta do that then. I'll report back to you once I tried it and tell you whether it worked.

AlphaCraft9658 commented 3 months ago

steam is a 32bits process, so it will run with box86 (and then, steam will launch steamwebhelper, that is a 64bits process, and needs box64, so will need both to run steam).

file no found means that you either lack binfmt integration, or the armhf subsystem entirely

Read the COMPILE.md to see how to add armhf subsystem on Debian/Ubuntu type of OS. For anything else, you'll to google it. If you lack binfmt integration (it can happens with Termux), then you need to setup BOX64_BASH to point to a x86_64 version of bash (availabe in the tests folder of box64 repo) and launch the shell script with box64. box64 will then run the shell script with that bash, and launch any 64bits apps with box64 and x86 apps with box86 (as long as there are installed in the same folder). That should compensate for the lack of binfmt.

I added the x86_64 version of bash and have also added the environment variable. In the logs I can see that it uses the x86_64 version of bash when running box64 steam, but it fails when trying to run srt-logger which also is an x86_64 binary?

AlphaCraft9658 commented 3 months ago

steam is a 32bits process, so it will run with box86 (and then, steam will launch steamwebhelper, that is a 64bits process, and needs box64, so will need both to run steam).

file no found means that you either lack binfmt integration, or the armhf subsystem entirely

Read the COMPILE.md to see how to add armhf subsystem on Debian/Ubuntu type of OS. For anything else, you'll to google it. If you lack binfmt integration (it can happens with Termux), then you need to setup BOX64_BASH to point to a x86_64 version of bash (availabe in the tests folder of box64 repo) and launch the shell script with box64. box64 will then run the shell script with that bash, and launch any 64bits apps with box64 and x86 apps with box86 (as long as there are installed in the same folder). That should compensate for the lack of binfmt.

I removed all steam files and re-ran the script. Now it updated the steam runtime environment, but it still fails running steam, with the x86_64 bash set up to be used by box64. Here is a part of the log:

Error: Reading elf header of /usr/local/bin/steam, Try to launch using bash instead
steam.sh[14433]: Running Steam on debian 12 64-bit
steam.sh[14433]: STEAM_RUNTIME is enabled by the user
setup.sh[14509]: Steam runtime environment up-to-date!
/home/alpha-craft/.local/share/Steam/ubuntu12_32/steam-runtime/run.sh: line 85: steam-runtime-identify-library-abi: command not found
run.sh[14521]: steam-runtime-identify-library-abi --ldconfig-paths failed, falling back to ldconfig
steam.sh[14433]: Can't find 'steam-runtime-check-requirements', continuing anyway
/home/alpha-craft/.local/share/Steam/steam.sh: line 792: /home/alpha-craft/.local/share/Steam/ubuntu12_32/steam: cannot execute: required file not found
kpyrkosz commented 3 months ago

Does the issue persist if you either:

AlphaCraft9658 commented 3 months ago

Does the issue persist if you either:

  • perform a clean rebuild of the box86 with -D_TIME_BITS=32 in your CFLAGS and CXXFLAGS or
  • use a version prior to commit d3d971d449a6eb36d068d2a2663d815c08421947?

I would have to compile it then. I'm using the prebuilt package for Android. Also, I don't really know how to include those in the flags. I've never really messed with building things this much.

ptitSeb commented 1 month ago

Can you update and try again, it might work better now.