12

I have recently installed Ubuntu ARM on my M1 MacBook Air on a virtual machine (using Parallels), and unlike Windows ARM and macOS ARM, Ubuntu ARM does not seem to include a translation layer for x86 apps, which makes the system almost unusable as a lot of Linux software does not support ARM yet.

For example, I got this error while trying to install VSCode with Gdebi:

screenshot

I cannot believe there is no translation layer on Linux ARM yet, considering it is an open source OS which often makes developing those kind of things easier and faster than on other operating systems.

Is there a translation layer out there which I could install?

3 Answers3

22

Box86 and Box64 are emulators that can be used to run traditional x86 apps in ARM.

Here is how to install Box64, so that you will be able to run amd64 binaries in arm64 (note that you won't be able to install amd64 .deb files this way. .deb files are not designed like that. However, you may still be able to extract the binary from a .deb file and run it.). These instructions are based on this guide.

First, install git and the necessary compilers, download the source with git, and enter the source directory.

sudo apt install git build-essential cmake
git clone https://github.com/ptitSeb/box64.git
cd ~/box64

Now create a directory named build, and generate the makefile using cmake.

mkdir build
cd build
cmake .. -DRPI4ARM64=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo

Now compile, with all the available cores.

make -j$(nproc)

Now install the compiled software

sudo make install

Now restart the systemd-binfmt service.

sudo systemctl restart systemd-binfmt

Finally, restart the computer.

Now, you should be able to run binaries compiled for the amd64 architecture.


However, native arm64 builds for VSCode are available at its official website, you don't need to emulate it.


many Linux software do not support ARM yet...

You seem to be misinformed. Since most of the software in the repositories are Free and Open source, they have already been compiled, and readily available for ARM. According to https://debian.pkgs.org/, the arm64 repository for Debian Sid has 62542 packages, whereas the amd64 repository has 63568 packages (as of 18th Nov, 2021). People usually use box64 to emulate proprietary software created for Windows.

5

Qemu user emulation provides a very nice way to seamlessly run programs from other architectures. I have no practical experience with graphical programs however, so there may be dragons that way.

It also integrates with apt/dpkg by registering a foreign architecture.

Pelle
  • 363
0

I have ran into same issue on Ubuntu Server and got the following error:

-bash: /usr/bin/my-script: cannot execute binary file: Exec format error

I found a general solution for running x86-64 files on arm CPU. Running the following code fixed it:

sudo apt update
sudo apt install -y qemu-user-static binfmt-support
sudo dpkg --add-architecture amd64
sudo apt update
sudo apt install libc6:amd64

Source : https://www.kali.org/docs/arm/x86-on-arm/