Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulating a Raspberry Pi in QEMU: Host Platform? #420

Open
n1ai opened this issue Jan 19, 2024 · 0 comments
Open

Emulating a Raspberry Pi in QEMU: Host Platform? #420

n1ai opened this issue Jan 19, 2024 · 0 comments

Comments

@n1ai
Copy link

n1ai commented Jan 19, 2024

Googling gave me your article ( https://interrupt.memfault.com/blog/emulating-raspberry-pi-in-qemu ) as the first result in asking about emulating a pi with qemu, so good for you, you're getting noticed by the algorithm! Thanks for the article, I learned (or re-learned) a lot by reading it. I especially appreciate the links at the end.

Since you asked people to open issues, here I am!

In the article you write about the host platform:

Since I’m on a Mac, and the purpose is to get a working Docker image, I set up an Ubuntu 20.04 Virtual Machine in Parallels. If you want to follow along, I recommend you to do the same and get onto a fresh Ubuntu 20.04 with QEMU...

Ok, you're running on a Mac, but what CPU architecture is in that Mac? Intel or ARM / Apple Silicon?

I think it ends up being relevant because I ran into the problem described here:

https://forums.raspberrypi.com/viewtopic.php?t=361643#p2169817

where a person replies with:

I have also seen this message, have no answer, but it works. Although very slow cause all is emulated, so not really interesting. KVM does anyhow not work on real ARM CPU with those RPi kernels, so it is more to show that it can be done, but not for normal use-cases. Use generic virt machine and default Debian distro kernel.

And I found that article because it did not work on an ARM64 CPU. In my case the description of the platform was so open-ended I said, let's try doing it on a Pi 4. I mean, emulating a Pi running Bookworm on a Pi running Bookworm should work? Apparently, not.

So, overall, I think the article would be better if it specified which kind of Mac you used, and if you expect it to work on platforms running ARM CPUs especially Apples or Pis.

And a minor nit, but sudo umount /mnt/image should happen somewhere once you're done with the mounted image, since that really forces all pending writes to hit the disk and it cleans up the namespace for next time.

And a super-nit: Maybe go more into why mount doesn't work inside Docker whereas mtools does? Or if reference states why, put a link to the reference in that section of the article.

Again, this is all small beer. Overall the article is very useful and very well written!

Regards,
Dave, N1AI

vishwamartur added a commit to vishwamartur/interrupt that referenced this issue Nov 2, 2024
Related to memfault#420

Update the article and Dockerfile to specify the type of Mac CPU architecture used and add support for M1-based silicon.

* **Dockerfile Changes:**
  - Add a step to unmount the image after mounting it.
  - Add a comment specifying the type of Mac CPU architecture used.
  - Add support for M1-based silicon.

* **Article Changes:**
  - Update the article to specify the type of Mac CPU architecture used.
  - Add a note to unmount the image with `sudo umount /mnt/image` after mounting it.
  - Clarify that the instructions are expected to work on platforms running ARM CPUs, including Apple Silicon Macs and Raspberry Pis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant