0

I would like to emulate the exact copy of the Rasp berry Pi OS on a virtual machine that can run on my jetson nano. I've found this tutorial and I tried to replicate it :

Building a Virtual machine with the .img file of the raspberry pi stretch

this is what happened :

root@zi-desktop:~/Desktop/Desktop_zi/Work/I9/Arm32# udisksctl loop-setup --file ./raspios/2021-03-04-raspios-buster-armhf-full.img --read-only

Mapped file ./raspios/2021-03-04-raspios-buster-armhf-full.img as /dev/loop1.


root@zi-desktop:~/Desktop/Desktop_zi/Work/I9/Arm32# lsblk -o name,label /dev/loop1

NAME LABEL

loop1

??loop1p1 boot

??loop1p2 rootfs


root@zi-desktop:~/Desktop/Desktop_zi/Work/I9/Arm32# sudo mount -o ro /dev/loop1p2 /media/zi/rootfs


root@zi-desktop:~/Desktop/Desktop_zi/Work/I9/Arm32# sudo tar c -C /media/zi/rootfs . | docker image import - raspios-full:buster

sha256 : 55d475ae76144b9ac360a457b2b3966fe7a3214755d605f10bb07fdee2618cfc


root@zi-desktop:~/Desktop/Desktop_zi/Work/I9/Arm32# docker image ls -aREPOSITORY TAG IMAGE ID CREATED SIZE

raspios-full buster 55d475ae7614 33 minutes ago 6.54GB

hello-world latest a29f45ccde2a 15 months ago 9.14kB

At this point the tutorial says to do this :

4. Allow your computer to emulate and run ARM binaries

docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3

ok,but where can I get that code ? because I tried :

docker run --rm --privileged docker/binfmt: 55d475ae76144b9ac360a457b2b3966fe7a3214755d605f10bb07fdee2618cfc

and :

docker run --rm --privileged docker/binfmt: 55d475ae7614

but :

root@zi-desktop:~/Desktop/Desktop_zi/Work/I9/Arm32# docker run --rm --privileged docker/binfmt:55d475ae7614

Unable to find image 'docker/binfmt:55d475ae7614' locally

docker: Error response from daemon: manifest for docker/binfmt:55d475ae7614 not found: manifest unknown: manifest unknown.

See 'docker run --help'.


root@zi-desktop:~/Desktop/Desktop_zi/Work/I9/Arm32# docker run --rm --privileged docker/binfmt:55d475ae76144b9ac360a457b2b3966fe7a3214755d605f10bb07fdee2618cfc

Unable to find image 'docker/binfmt:55d475ae76144b9ac360a457b2b3966fe7a3214755d605f10bb07fdee2618cfc' locally

docker: Error response from daemon: manifest for docker/binfmt:55d475ae76144b9ac360a457b2b3966fe7a3214755d605f10bb07fdee2618cfc not found: manifest unknown: manifest unknown.

See 'docker run --help'
1

You shouldn't replace the tag by the hash of your own image. The binfmt image is independent from your RPi OS image, the tag has nothing to do with your image hash.

You can get the tag of the latest binfmt version here: https://hub.docker.com/r/docker/binfmt/tags?page=1&ordering=last_updated

10
  • I've looked there. There are only amd64 images. I need one arm32 debian image. – Marietto Apr 23 at 19:40
  • @Marietto the instructions you followed are for emulating ARM on an x86 (AMD64) system. If you're already using an ARM system you don't need an emulator to run ARM containers. – tttapa Apr 24 at 1:12
  • I'm running arm64 / jetson nano but I want emulate arm32 / raspberry. – Marietto Apr 24 at 8:37
  • @Marietto you don't need to emulate anything. The Jetson has an ARMv8 CPU which supports both AArch64 and ARMhf (32-bit mode). You might need a 32-bit version of Docker, but definitely not an emulator. – tttapa Apr 24 at 8:42
  • Im not sure that it will work. the armhf sometimes does not work good here on the jetson nano. I tried to run some applications like teamviewer and anydesk but they failed. the first one says that the cpu is not supported. the second one looks for some raspberry libraries and it can't find them. in addition,the repo that I tried to install on the emulated bullseye for arm32 looks for the kernel headers of the raspberry and it can't find them. anyway,I can try. can u point me to a valid tutorial to try to do what u suggest ? – Marietto Apr 24 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.