Run aarch64 binary on x86_64 machines

If we use qemu-arm64-system directly, it will cost too much time on IO and systemcalls.So I try to use SuSE’s userpsace mode qemu, which only reinterprets the arm64 instructions to x86_64 but processes all systemcalls to local host.
This installation manual for user-mode qemu-arm64 has tested on debian-7.7.0

Step 1, make directory for chroot.

Step 2, build qemu of SuSE:

Add this patch to SuSE’s qemu before make it:

Make the qemu and install it:

Step 3, download arm64 disk image of Fedora 19, and extract it.

Copy the qemu-arm64

Step 4, configure the binfmts-misc

and put the content below into /usr/share/binfmts/qemu-arm64 in normal system(not the chroot)

Then run

Step 5, you could chroot into the user mode qemu now:

Now, If you typein “arch”, it will report “aarch64”
Addtionally, add below contents into “aarch64” environtment’s /etc/yum.repos.d/stage4.repo:

You could use yum to install rpm of aarch64 now. If it report DNS unavailable, you could append

into /etc/hosts

I use this user-mode of arm64 Qemu to build linux kernel, but the speed of compiling is not very perfrect. After all, the user-mode Qemu only accelerate the speed of systemcall, not the reinterpreter of instructions. But in my opinion, it is still very useful because it could use host’s resource of network and storage efficiently (Don’t you think it looks like linux-container or lxc/docker ?). If this news is true, I think facebook could use cheap x86_64 machines to test their IOS apps instead of costly Mac minis 🙂

How to run aarch64 binaries on an x86-64 host using qemu userspace emulation