TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Transparently running binaries from any architecture in Linux (2018)

104 pointsby billwashereabout 3 years ago

12 comments

quagabout 3 years ago
For those on NixOS add boot.binfmt.emulatedSystems = [&quot;aarch64-linux&quot;]; to &#x2F;etc&#x2F;nixos&#x2F;configuration.nix and it will enable running ARM binaries.<p><a href="https:&#x2F;&#x2F;search.nixos.org&#x2F;options?channel=21.11&amp;show=boot.binfmt.emulatedSystems&amp;from=0&amp;size=50&amp;sort=relevance&amp;type=packages&amp;query=binfmt" rel="nofollow">https:&#x2F;&#x2F;search.nixos.org&#x2F;options?channel=21.11&amp;show=boot.bin...</a>
评论 #31148037 未加载
fargleabout 3 years ago
Toward the end of the article they use chroot to run an entire rootfs as sort of a user-level system emulation.<p>The next step is to do the same thing except using containers&#x2F;namespaces. I was able to run a Yocto rootfs build for ARM completely, including init, and IIRC networking, using LXC and binfmt_misc. A very handy technique for testing and it does run much faster than full-system emulation.
评论 #31154924 未加载
评论 #31146258 未加载
评论 #31146096 未加载
评论 #31146409 未加载
评论 #31145028 未加载
giomasceabout 3 years ago
First: you don&#x27;t necessarily need an alternative chroot, Debian allows installing packages of foreign architectures in the same main tree. It has some hiccups, but it should mostly work.<p>Second: of you like playing with foreign architectures, I have a collection of ready to boot Debian images of many architectures, that you can promptly boot with QEMU. Command line included. It is mostly aimed at full system emulation, though (but if you look through the cogs you can also download chroots). <a href="https:&#x2F;&#x2F;people.debian.org&#x2F;~gio&#x2F;dqib&#x2F;" rel="nofollow">https:&#x2F;&#x2F;people.debian.org&#x2F;~gio&#x2F;dqib&#x2F;</a>
FooBarWidgetabout 3 years ago
How does qemu-user&#x27;s performance compare to Rosetta 2? The latter is marketed as nearly native performance because it performs binary translation. But I read that qemu-user <i>also</i> performs binary translation.
ranger_dangerabout 3 years ago
You can also do this with docker containers for other architectures + the binfmt qemu-user trick, which may be easier to work with pre-existing rootfs images and other software.
sgtnoodleabout 3 years ago
I&#x27;ve been using this technique to manipulate raspberry pi OS images for use in embedded system prototypes. It&#x27;s very easy to set up. It&#x27;s also nice to be able to use the image&#x27;s embedded toolchain rather than set up a proper cross-compiler. It&#x27;s slow to compile stuff due to the emulation, but relatively foolproof.<p>Of course, the best long term solution is to use something like yocto or buildroot, but that takes considerable time and knowledge to do properly.
mkoubaaabout 3 years ago
What exactly does &quot;transparently&quot; mean in this context. I&#x27;ve seen that term used in a dozen different ways within software engineering
评论 #31148038 未加载
评论 #31148743 未加载
lprovenabout 3 years ago
All that work to recreate what Inferno (Unix 3) did out of the box over 25 years ago.<p>FOSS Unix: 42 steps forward, 42 steps back. :-&#x2F;
snvzzabout 3 years ago
I have found this useful in practice when debootstrapping for a different architecture.
hsnewmanabout 3 years ago
This is exaggeration, I doubt that it can run AS&#x2F;400 binaries.
评论 #31145076 未加载
anonymousDanabout 3 years ago
I presume it is not safe to do this with malware?
skykoolerabout 3 years ago
Does this work for graphical programs?
评论 #31147033 未加载