ARM Emulation on x86 Amazon Linux 2/1/Centos — Ubuntu/Debian

Hello guys,

Today I’m going to write about to ARM Emulation on x86 Centos or Amazon Linux 1/2 . Setting Up ARM Emulation on x86 Ubuntu or Debian is easy because you have a support package called binfmt-support. In Centos this package doesn’t exist.

First, I will install ARM emulation on x86 Debian/Ubuntu — EASY WAY.

We’ll be using QEMU and Docker to set up our emulated environment. QEMU is an open source machine emulator and virtualizer. It allows users to to build ARM CUDA binaries on your x86 machine without needing a cross compiler.

Let’s see what happens before setting up the emulation when trying to execute a program compiled for a different architecture :ARM CUDA binaries on your x86 machine without needing a cross compiler.

$ uname -m # Display the host architecture 

As expected, the instructions are not recognized since the packages are not installed yet. Installing the following packages should allow you to enable support for aarch64 containers on your x86 workstation:

# Install the qemu packages
$ sudo apt-get install qemu binfmt-support qemu-user-static

The installation was successful, the emulation is working. At this point, we can now run aarch64 programs on the host x86_64 workstation.

Note: For advanced details on using QEMU and Docker, please refer to this repository on GitHub.

The first part of the article is not mine.

(This a original blog about running ARM on X86 in Debian/Ubuntu.

ARM Emulation on x86 Amazon Linux 2 / 1 / Centos

To start we can say that Running ARM emulation on x86 Debian/Ubuntu is easy, but in Amazon Linux this is a problem. This happend because we don’t have a package binfmt-support with the cpu instructions.

I read many articles about running ARM emulation on X86 Centos and I found the light at the end of the road.


  • Amazon Linux Instance or Centos
  • QEMU
  • Docker

Launch Amazon Linux2 in AWS:

First, you proceed to install Docker

Second, you start docker demon and I test running ARM Docker container in X86 Amazon Linux/Centos Host.

NOOO!!! Error again….

standard_init_linux.go:211: exec user process caused "exec format error"

The docker container doesn’t work, because the cpu doesn’t support the ARM instructions.

Now, you proceed to install qemu and libraries arm.

$ yum install qemu-user qemu-*-static qemu-kvm-tools qemu-kvm virt-install libvirt libvirt-python libguestfs-tools-c qemu-system-aarch64 glib2-devel pixman-devel -y

Later, you need download QEMU Multiarch scripts with CPU Instructions and set running permissons.

CPU Instructions:

$ wget

In this step you need to edit in the the line 23 with the correct path for script

Don’t forget to modified the line 23 for ./ , and save.

Now, you are ready for running | If the result is corret you see the similar output.

$ ./

In this step you need reboot the instance to see the changes.

$ sudo reboot

Test running the arm docker, you’ll can see that works!!!

NOTE: In some cases you need running the script when Linux system init, So you can add the emulation script in /etc/rc.local for persistent forever :)

$ chmod 777
$ mv qemu-binfmt-conf
$ mv register
$ mv * /etc/rc.d/init.d/
$ ls /etc/rc.d/init.d/
$ vi /etc/rc.local
$ cat /etc/rc.local

Test reboot instance and Enjoy multiarch ARM Running on Amazon Linux/Centos!

Kind Regards,

SRE|Sr. DevOps Ezequiel Arielli @ / CA, San Francisco.

About me — blog:

About Miroculus:

DevOps SR | SRE San Francisco, CA