Page 1 of 1

How to run X86 docker images on RPi 4 ?

Posted: Thu Jul 30, 2020 9:18 pm
by Brestois
Hi, I am doing big data projects on RPi and I need to run X86 docker images, HBase, Spark, Flink etc.
I found this project https://github.com/AlbrechtL/RPi-QEMU-x86-wine, and Exagear, but both are discontinued.

I want to know if there is a way to get a X86 emulator to run docker inside (so that I could pull all X86 images) ?
Thanks.

Re: How to run X86 docker images on RPi 4 ?

Posted: Thu Jul 30, 2020 9:50 pm
by W. H. Heydt
Short answer: Don't.

Longer answer: If you have an x86 simulator running, *and* you have a program that will convert Windows API calls to Linux API calls, then you can get x86 code to run on a PI. However, it will likely run *exceedingly* slow. So slow that it's not worth the effort. Remember that you are having to convert each and every x86 machine instruction into one or more ARM instructions as they are encountered.

Re: How to run X86 docker images on RPi 4 ?

Posted: Thu Jul 30, 2020 9:52 pm
by Heater
This sounds impossible to me.

I might be wrong but don't programs running inside Docker containers use the same kernel underneath as programs running outside of containers?

Which implies any x86-64 emulation would have to run the entire stack, the an x86-64 kernel, enough user land to run Docker, the Docker container and the programs inside it.

If all that could ever be made to work it would be as slow as a slow thing on a slow day.

Better to rebuild your Docker container for ARM.

Re: How to run X86 docker images on RPi 4 ?

Posted: Fri Jul 31, 2020 9:08 am
by LTolledo
get x86 boards to run your project

end of your problem.....

Re: How to run X86 docker images on RPi 4 ?

Posted: Fri Jul 31, 2020 9:54 am
by Brestois
Is there any solution to spin up HBase cluster rather than using Docker on a single RPi ?

Re: How to run X86 docker images on RPi 4 ?

Posted: Fri Jul 31, 2020 10:38 am
by GlowInTheDark
I know the standard answer to the ever-perennial question "How do I run DOS/WIndows/x86_Linux on the Rpi?" is "You can't".

However, that said, the correct answer is, of course, "You can, but it will be very slow".

However, that said, it did work, sort of, in the old days - using QEMU and old versions of Windows. I.e., don't expect to run "Windows 10" on it (not that anyone would want to).

Which all leads to, now that we have the Pi4, which seems to have finally solved the CPU/RAM bottlenecks of the earlier Pi models, it seems to me that it should be doable nowadays - with a sufficiently souped up Pi4 and a sufficiently old version of Windows.

A couple of notes:
1) I personally haven't ever tried this - running Windows on Pi - simply because I no longer have any interest in it. I used to have one specific app that I needed to run, and which did run quite nicely under WIne on x86_Linux, but that app is no longer relevant (i.e., it is broken for reasons which are outside the scope of this posting).

2) It is a testament to the high level of support that the Rpi provides that people would rather try to run their x86 stuff on a Pi, than do the obvious thing of purchasing and using x86-based boards. So, score one up for the Pi there!

Re: How to run X86 docker images on RPi 4 ?

Posted: Fri Jul 31, 2020 10:46 am
by richrussell
Ultimately if you need to run x86 binaries then the Pi is almost always going to be the wrong tool for the job. If you can compile the application to run on ARM, then it may well be suitable. Whilst it is technically possible to run x86 code, it's never going to be a good solution as it's simply not designed to do that.

Kind of like saying that I could use a Ford Mondeo to plough a field. Yes, it'll probably be able to do it but it won't be anywhere near as good as using a tractor, which is ideally suited to do the job. But if it came to transporting a family of four to the seaside, the Mondeo would be the better choice.

If you absolutely have to use a Raspberry Pi in your project, then you could use it as a front end to control the execution of the Docker containers on a second x86 based single board computer (of which there are many, some quite keenly priced) running x86 Linux natively.

Re: How to run X86 docker images on RPi 4 ?

Posted: Fri Jul 31, 2020 11:00 am
by hippy
GlowInTheDark wrote:
Fri Jul 31, 2020 10:38 am
I know the standard answer to the ever-perennial question "How do I run DOS/WIndows/x86_Linux on the Rpi?" is "You can't".

However, that said, the correct answer is, of course, "You can, but it will be very slow".
And yet ExaGear did appear to work and work well enough for many programs which would seem to fit into the 'won't work' and 'won't be usable' categories.

It seems to me that most of the negativity, the discouragement, comes from those who don't want see it succeed, don't want their ARM or Linux platforms 'contaminated' by X86 or Microsoft.

Re: How to run X86 docker images on RPi 4 ?

Posted: Fri Jul 31, 2020 11:25 am
by PeterO
hippy wrote:
Fri Jul 31, 2020 11:00 am
It seems to me that most of the negativity, the discouragement, comes from those who don't want see it succeed, don't want their ARM or Linux platforms 'contaminated' by X86 or Microsoft.
I think it's more about managing people's expectations ....
Can you imagine the number of complaints about poor performance if the default line was "yes you can, use an x86 emulator" ?
It's more about managing expectations ....
PeterO

Re: How to run X86 docker images on RPi 4 ?

Posted: Sun Aug 02, 2020 1:58 pm
by GlowInTheDark
I think you are both right. That there is some "We don't want no stinkin' WInBlows cr*p on our lovely Linux based Pi" sentiment both here on the board and in Pi Towers. But also that nobody wants to be in the position of having running Windows stuff be a supported feature of the platform - and, thus, having to support it.

That said, in my day-dreams, I wonder how much longer it will be until the folks at Pi Towers come up with an x86 based board. I can already hear the howls of protest, but if you look at this with a clear mind, you'll see that it is a good idea. Probably not anytime soon, but long-term, it is a very good idea.

Re: How to run X86 docker images on RPi 4 ?

Posted: Sun Aug 02, 2020 2:16 pm
by PeterO
GlowInTheDark wrote:
Sun Aug 02, 2020 1:58 pm
Probably not anytime soon, but long-term, it is a very good idea.
Unless you can actually explain why you think it is a good idea all you've done is state your own belief as fact :roll:
PeterO

Re: How to run X86 docker images on RPi 4 ?

Posted: Sun Aug 02, 2020 3:09 pm
by Heater
GlowInTheDark wrote:
Sun Aug 02, 2020 1:58 pm
I can already hear the howls of protest, but if you look at this with a clear mind, you'll see that it is a good idea.
I'm have often been told I am empty headed. As such I must have a very clear mind. Thinks... hmmm... no, it's not coming to me.

Please do tell. Why would an x86 based Raspberry Pi be a good idea?

If you are desperate to turn your dreams into reality perhaps you should just get an x86 based SBC: https://www.seeedstudio.com/ODYSSEY-X86 ... -4445.html

Re: How to run X86 docker images on RPi 4 ?

Posted: Sun Aug 02, 2020 3:22 pm
by hippy
GlowInTheDark wrote:
Sun Aug 02, 2020 1:58 pm
That said, in my day-dreams, I wonder how much longer it will be until the folks at Pi Towers come up with an x86 based board.
I can't see that happening. RPF's work is platform agnostic so shouldn't matter much to them, so long as money keeps rolling in. But RPT don't seem to be an X86 shop in any manner or form, so don't appear to be in a position to leverage X86 hardware to their advantage as they can with ARM.

Now a RISC-V based board ... that's a possibility. I could even envisage some BCM27xx SoC of the future having RISC-V cores embedded alongside the ARM.

Re: How to run X86 docker images on RPi 4 ?

Posted: Sun Aug 02, 2020 3:54 pm
by Heater
hippy wrote:
Sun Aug 02, 2020 3:22 pm
Now a RISC-V based board ... that's a possibility. I could even envisage some BCM27xx SoC of the future having RISC-V cores embedded alongside the ARM.
Now that it looks likely that ARM will be bought by Nvidia it is perhaps time for all those building with ARM to consider getting together and cooking up a RISC-V replacement for their cores.

https://www.theverge.com/circuitbreaker ... hase-rumor

Re: How to run X86 docker images on RPi 4 ?

Posted: Mon Aug 03, 2020 6:45 am
by ejolson
Heater wrote:
Thu Jul 30, 2020 9:52 pm
This sounds impossible to me.

I might be wrong but don't programs running inside Docker containers use the same kernel underneath as programs running outside of containers?

Which implies any x86-64 emulation would have to run the entire stack, the an x86-64 kernel, enough user land to run Docker, the Docker container and the programs inside it.
User-mode QEMU binary emulation might allow an x86 docker image to run on a Raspberry Pi. As shown in

viewtopic.php?p=1691235#p1691235

one would expect the resulting speed to be equivalent to half the performance of the Pi B, or about the same as the slot-based 450 MHz Pentium III processors introduced in 1999. Those were pretty nice computers back then.

While it's astonishing to see the Pi 4B execute x86 Linux binaries, I found it even more amusing to run AARCH64 binaries on the Pi Zero.