Pi nebenbei
Troubleshooting

Honeygain on a Raspberry Pi: fixing “exec format error”

If docker run honeygain/honeygain dies instantly with exec format error on your Pi, it is not your fault and not a typo. The official image is built for Intel processors, your Pi has an ARM one. The fix is a single command.

Why the message appears

exec format error is the Linux kernel answering a simple question: “can I execute this file?” The answer is no, because the program contains machine instructions for a different processor architecture. Your Raspberry Pi reports aarch64 for uname -m. The Honeygain image carries instructions for x86_64 – Intel and AMD processors, the kind in an ordinary PC.

Docker does not change that: a container shares the kernel with its host. It brings no operating system of its own that could translate. Without help, an ARM kernel cannot start an Intel binary. Full stop.

First check what your Pi reports You want aarch64. If it says armv7l, you are on a 32-bit system and the translation layer will not help either – in that case reinstall Raspberry Pi OS in its 64-bit variant.

Check the architecture
uname -m

Setting up the translation layer

Linux can run foreign machine instructions if you tell it what to run them with. The mechanism is binfmt_misc, a kernel feature that registers an interpreter for particular file types. The interpreter is QEMU, running in user mode – it emulates the instructions of one program rather than a whole machine.

The tonistiigi/binfmt image registers that association for you. It runs once, exits and disappears – the --rm flag cleans the container up immediately. What remains is the entry in the kernel.

Run once
docker run --privileged --rm tonistiigi/binfmt --install all

Why --privileged is here The command writes into the host kernel and needs elevated rights to do so. For this one step that is unavoidable. Never grant elevated rights to a container that runs permanently or comes from a source you do not trust.

The entry does not survive a reboot. If your container runs with --restart unless-stopped, Docker will start it again after booting – but the interpreter is missing, so the container hits the same error. The next section solves that for good.

Setting Honeygain up completely

If Docker is still missing, this is the route the vendor recommends:

1 · Install Docker
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
newgrp docker

What curl … | sh actually does It downloads someone else's script and runs it immediately with your rights. For get.docker.com that is the official route. For unknown sources, download the script and read it before you run it – that goes for every guide on the internet, including this one.

2 · Translation layer
docker run --privileged --rm tonistiigi/binfmt --install all
3 · Start Honeygain
docker run -d \
  --name honeygain \
  --restart unless-stopped \
  --platform linux/amd64 \
  honeygain/honeygain -tou-accept \
  -email [YOUR_HONEYGAIN_EMAIL] \
  -pass [YOUR_HONEYGAIN_PASSWORD] \
  -device [NAME_FOR_THE_PI]

About the password It sits inside the container and can be read back in plain text later via docker inspect honeygain. Use a long, unique password you do not use anywhere else. Worth remembering if you share the Pi with anyone.

The log lines tell you whether it is running:

4 · Check
docker logs honeygain

Making it survive a reboot

The translation layer is gone after every boot. The cleanest fix is a small system service that runs once before Docker. Honeygain then comes back on its own after a power cut.

Create the service
sudo tee /etc/systemd/system/binfmt-arm.service >/dev/null <<'EOF'
[Unit]
Description=binfmt for foreign architectures
Before=docker.service

[Service]
Type=oneshot
ExecStart=/usr/bin/docker run --privileged --rm tonistiigi/binfmt --install all
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable binfmt-arm.service

How to verify After a reboot, docker ps shows whether the container is running. If nothing is listed, docker logs honeygain will usually show the old error again – which means the service above was not active.

Getting rid of it again

One command and the container is gone along with its contents. You delete the account separately in the provider's dashboard.

Remove Honeygain
docker rm -f honeygain
Frequently asked

Questions about this topic

Why isn't --platform linux/amd64 enough on its own?

That flag only tells Docker which variant of the image to pull. Your processor still has to execute the instructions. Without the registered translation layer you get the same error, just one step later.

Does the emulation cost much processing power?

For bandwidth sharing it makes no difference. The service barely computes anything, it forwards traffic. For compute-heavy programs the emulation would be very noticeable.

Is there no native arm64 image from Honeygain?

At the time of the last check, the Raspberry Pi route requires the translation layer. Providers change their images without notice – a look at the official documentation before you start never hurts.

Does a second Pi on the same network earn more?

No. Honeygain allows one device per IP address, otherwise you get “Network overused”. What is sold is not bandwidth but access from a real household, and that stays singular.

Will the container come back after a power cut?

Only with the system service from the section above. --restart unless-stopped alone does start the container, but without the translation layer it dies again immediately.