13

I'm trying to install Navicat which is an x86-64 binary onto my aarch64 machine, which results in "cannot execute binary file: Exec format error"

Here's the result of running file on the executable:

navicatess15-sqlserver-en.AppImage: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=d629f6099d2344ad82818172add1d38c5e11bc6d, stripped

And here is my uname -a:

Linux penguin 4.19.98-08076-g24ab33fb8e14 #1 SMP PREEMPT Wed Apr 1 17:17:36 PDT 2020 aarch64 GNU/Linux

Is there any way to run this executable on my machine?

(Idk if this makes any difference but I'm running Linux on my Samsung Chromebook Plus w/ an OP1 processor)

2
  • 2
    Yes and no. Yes you can run x86-64 binaries on arm64. The speed that this would run at might not be useful for you. Ask yourself if something running 10x slower is worth it to you or if you can live with an alternative program designed specifically for arm or at least native.
    – kemotep
    Commented Apr 4, 2020 at 19:33
  • Also check Box86, which let's you seamlessly run x86 binaries on arm. It wouldn't be useful for complex apps but is definitely useful in some use cases.
    – istepaniuk
    Commented Mar 30, 2021 at 20:37

3 Answers 3

8

Each architecture speaks its own hardware language so of course ARM CPUs can only run ARM binaries natively. If you want to run binaries for another architecture you need to use an emulator. The most famous x86-64 emulators are qemu and bochs

But emulation is extremely slow so it won't be suitable for time-sensitive applications, and should be the last resort. You'll better off recompile from source if available, or find an ARM alternative software

8
  • 1
    No, you don't have to run a full emulator. Have you ever heard of qemu-user? And unless the program really is some number crunching thing, it won't be that slow.
    – user313992
    Commented Apr 5, 2020 at 2:37
  • 3
    @mosvy of course I know that qemu has user mode emulation, but it's still a last resort as I said. A native solution is always better
    – phuclv
    Commented Apr 5, 2020 at 2:38
  • 1
    Then why are mixing it up together with bochs, which emulates a complete computer, just like qemu-system-*? And as I said, usual applications (which spend most of their time waiting for system calls to complete) are not that slow with a user-mode only emulation.
    – user313992
    Commented Apr 5, 2020 at 2:43
  • 4
    I'm just giving up emulators and I didn't say anything about their emulation mode. It's not sluggishly slow but still worse than a native app. I never said that never use them, just find a native solution first
    – phuclv
    Commented Apr 5, 2020 at 2:47
  • +1 to this. I can't even get a x86 Linux guest VM to boot up on my armv7 Chromebook, because the VM performance is so awful.
    – Time4Tea
    Commented Jun 30, 2020 at 15:22
7

Debian has multiarch support which means that you can install and run programs built for one architecture on other architectures.

However, you need to take the following into consideration:

  1. As the x86 architecture is very different from ARM, then this will be done through emulation (usually via qemu-user) so there could be some loss of speed and functionality.

  2. This needs binfmt support. If you are using "Linux containers" (crostinit) on a Chromebook then, as explained in this post, this support is not enabled.

  3. On a Chromebook, binfmt support requires crouton at this point. It works as well as can be expected in that context.

If you want to test this run the following:

a. Install the binaries required to support the architecture.

sudo apt-get install binfmt-support qemu-user-static
sudo update-binfmts --display

b. Setup Debian to support multiarch.

sudo dpkg --add-architecture amd64
sudo apt-get update
sudo apt-get upgrade

c. Test it out. (Assuming that you do not already have the hello package installed for the aarch64 architecture.)

sudo apt-get install hello:amd64
hello

This will print the familiar "Hello, World!" message using the amd64 binary.

1
  • 1
    This works, however you may need to adjust your apt sources.list to actually pull the amd64 binaries from the right place. See askubuntu.com/a/1443977/977044
    – tmm1
    Commented Dec 4, 2022 at 20:59
3

For aarch64, projects like FEX or Box64 have better performance than QEMU user emulation. They use dynamic recompilation, also usually provide WINE support for Win32 x86/x86_64 software.

1
  • Rosetta 2 for Linux is better I imagine, though M1 will still win cause it emulates PF (the parity flag) and AF (the adjust flag) in HW. Commented Feb 16, 2023 at 1:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .