Neuigkeiten

⬅ Neuer Älter ➡

2023/10/31/8:39 | Debian: Run 64-bit binaries on x86-only cpus

More and more applications are not offered for i386 cpus anymore. Too few people still use these so developers save their time by just offering amd64 or arm variants. But there is a way you can run amd64 executables on your old i386 cpu. Here is how to do it!

Required packages

First, you need to apt install these packages:

Libraries

Statically linked executables (with no external dependencies) run without them but others need additional packages for the target architecture to be installed. Do this:

dpkg --add-architecture amd64
apt update

If you run your amd64 app and it misses some .so files, just install the matching library via apt install libFOO:amd64.

Fixing a bug

There is a bug report that the i386 variant of qemu-user-binfmt does not include x86_64. Michael does not want to fix this as it could mess with modern setups. But you can fix it for yourself!

I just grabbed the package file for arm64 which includes x86_64. Since I am not a jerk, here is the file you need to have. Just create /usr/lib/binfmt.d/qemu-x86_64.conf with this content:

:qemu-x86_64:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/x86_64-binfmt-P:OCP

Then, I rebooted and it worked.

Conclusion

Michael claims that emulating amd64 on i386 would not be of any use as it would be slow but this ignores the fact that there is software that is simply not offered for i386 anymore, so slow is better than nothing. Actually, bun (JS runtime) and psst (spotify client) are now totally usable on my NC10.