Score:6

Is there any translation layer for x86 software on Ubuntu ARM?

ua flag

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 many Linux software do 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.

There is a translation layer out there which I could install?

davidbak avatar
cn flag
"... considering it is an open source OS which often makes developing those kind of things easier and faster than on other operating systems" - why would you think that? Open source does nothing of the kind. It might, and if it does that's fortuitous. But as a general statement? No. (It is certainly _possible_ to develop this stuff for an open source OS. But "easier"? "faster"? "easier _and_ faster"? Not in general.)
Peter Cordes avatar
fr flag
It's open source so we don't need an emulation layer for most software, we just rebuild from source. But since qemu and binfmt-misc already exist, the pieces are in place for transparent emulation, just like how x86 Linux machines can be set up to Windows executables can be run with WINE transparently.
eg flag
`as many Linux software do not support ARM yet` - the **majority** of Linux software already support ARM since around 2002. The fact that almost all Linux software support ARM is what makes projects like Android and Raspberry Pi successful.
Ismael Miguel avatar
om flag
VSCode has an ARM version. But, as someone who's been stuck with a Raspberry Pi 4 for the last weeks, I strongly advise you to forget about running VSCode on an ARM CPU. My experience has been below garbage with it. It takes 2 minutes to save a file to a network share, in which VSCode spends all it's time just reading the files and doing nothing else. I have **WAY** better results running Notepad++ on top of WineHQ on top of Box86 on my Raspberry Pi 4. I used PiApps to install WineHQ and just installed Notepad++ from the website. It works ... ok, without autocomplete. Alternatively, use geany.
Josef says Reinstate Monica avatar
cn flag
@IsmaelMiguel that probably has nothing to do with ARM and the reason is only, that the Raspberry Pi 4 has a quite slow CPU. I assume running VSCode on an much much more powerful M1 CPU works without issues.
Ismael Miguel avatar
om flag
@JosefsaysReinstateMonica That is a good point. I didn't notice that there was the MacOS-style UI around the Ubuntu OS. I should have noticed it before saying anything. However, when someone says "on an ARM chip", people will think like micro-computers and similars, not an Apple product.
Ben Voigt avatar
vg flag
@IsmaelMiguel "micro-computers" occupies a much higher space in the size hierarchy than you might think, encompassing all desktop and laptop computers and a great many servers. Exactly the sort of devices that can run a programming IDE well.
Ismael Miguel avatar
om flag
@BenVoigt Yes, but I gave my opinion based on my "micro-computer". A 2020 Raspberry Pi 4 (no overclock). And VSCode is below garbage on my "micro-computer". It's effectively useless to the point that having a Windows program being translated from x86 to ARM is a lot faster than VSCode.
Josef says Reinstate Monica avatar
cn flag
@IsmaelMiguel VSCode is basically a browser which runs an IDE implemented in HTML and JavaScript. Of course it is slow. It was even [known for using a whole CPU core just to blink the cursor](https://github.com/microsoft/vscode/issues/22900) once. Its just that computers are so fast today, that people get away with implementing a slow IDE using web technology... But that is not in any way related to ARM or AMD64. VSCode is slow on AMD64 too, its just harder to get a slow AMD64 CPU today. But try VSCode on an Intel Atom...
Ismael Miguel avatar
om flag
@JosefsaysReinstateMonica In my case, it was using over 30% of the CPU to access the Samba share, and analyze the files in it (for whatever reason). And it would just keep analyzing them, over and over and over and over again. If I open it to edit files locally, without a workplace folder, it behaved quite acceptably.
Score:15
us flag

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.

br flag
I think it should be possible to combine box[64/86] with deb, by making use of `dpkg --add-architecture amd64`
us flag
@Pelle I have not tried that. In case you have tested it, feel free to edit.
FedKad avatar
cn flag
@ArchismanPanigrahi I tried these installations on an ARM based VPS. After completing them and rebooting, I am able to run amd64 command line programs. However, I have a amd64 GUI application (developed and compiled in Lazarus) and it does not run. It gives some errors like `gtk_major_version not found`, `gtk_minor_version not found`, `gtk_marshal_VOID__POINTER_POINTER not found`, and `gtk_key_snooper_install(ver 0: gtk_key_snooper_install) not found`. I think this is mentioned in https://github.com/ptitSeb/box64 under **Notes about GTK programs**
Aaron Franke avatar
ar flag
Is there a way to have native-like support for the `amd64` (x86_32) architecture on ARM systems, similarly to how we can have support for `i386` (x86_32) support on `amd64` (x86_64)? I want to be able to install any `amd64` package via the package manager, either via `sudo apt install` or via installing `.deb` files.
us flag
@AaronFranke Have a look at the comment by Pelle.
Aaron Franke avatar
ar flag
Once I have Box64 installed, how do I install system libraries for `amd64`? I have tried both `sudo dpkg --add-architecture amd64` and modifying `/etc/apt/sources.list` with lines starting with `deb [arch=arm64,amd64] http://us.ports` but apt is not able to find amd64 packages.
Score:4
br flag

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.

br flag
Generally works fine for X, since it's client-server at heart.
Aaron Franke avatar
ar flag
Following this guide, I installed the Qemu packages, `update-binfmts --display` seems to work correctly, then I added the `amd64` architecture in dpkg, but `apt` can't find any packages. `apt update` says `E: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/dists/impish/main/binary-amd64/Packages 404 Not Found [IP: 91.189.91.38 80]`. What are the full instructions? It seems that something is missing that is needed on top of the Debian instructions.
br flag
Ports.ubuntu.com does not contain amd64 packages, you'll need to add the regular Ubuntu repositories.
Score:0
us flag

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/

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.