8

I would like to run a RaspberryPi system on my MacOSX using QEMU. I tried the following, using this tutorial:

./qemu-system-arm -M versatilepb -cpu arm1176 -m 256 -hda ArchLinuxARM-2014.06-rpi.img -kernel kernel.img -append "root=/dev/sda" -serial stdio

Where ArchLinuxARM-2014.06-rpi.img is my RPi image and kernel.img precisely comes from ArchLinuxARM-2014.06-rpi.img (I made a copy of it, I am not sure it was a brilliant idea though).

I get two QEMU windows as a result. One has a "Machine" and a "View" menu, and a black screen showing the following message:

Guest has not initialized the display (yet).

The second one is simply a black window.

I had the same problem using a Raspbian image and the same command. What am I doing wrong?

1 Answer 1

6
  • First of all, I had to use another kernel, kernel-qemu that I found here.

  • Then, I could make it work using QEMU 1.7.1:

    With Raspbian:

    ./qemu-system-arm -kernel /path/to/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda /path/to/2013-12-20-wheezy-raspbian.img

    With Arch Linux, I had to:

    1. Start in terminal mode (not sure if necessary, though) using:

      ./qemu-system-arm -kernel /path/to/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda5 panic=1 rootfstype=ext4 rw init=/bin/bash" -hda /path/to/ArchLinuxARM-2014.06-rpi.img

      (Note that init=/bin/bash was added here, and Arch Linux requires root=/dev/sda5 instead of sda2)

    2. Modify /etc/fstab as follows (the partition was wrong):

      # <file system> <dir>   <type>  <options>       <dump>  <pass>
      /dev/sda1       /boot   vfat    defaults        0       0
      
    3. Start normally using:

      ./qemu-system-arm -kernel /path/to/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda5 panic=1 rootfstype=ext4 rw" -hda /path/to/ArchLinuxARM-2014.06-rpi.img

  • I finally realised that I could use the latest version of QEMU (2.1.1), but I had to specify the console output:

    ./qemu-system-arm -kernel path/to/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "console=ttyAMA0 root=/dev/sda5 rootfstype=ext4 rw" -hda /path/to/ArchLinuxARM-2014.06-rpi.img

    (Note that I specified the console using console=ttyAMA0)

3
  • Does anyone have a link to the kernel linked here -- I have the same issue and the page is gone :( Commented May 22, 2015 at 18:52
  • 2
    The one I used in my answer is here Commented May 23, 2015 at 11:07
  • I tried to recreate this with my own ArchLinuxARM-2014.06-rpi.img, but arch boots into emergency mode. Any chance you have that image still lying around somewhere? Or any other tips to get the system to boot normally? It complains about /dev/sda1 not being the correct boot device
    – rien333
    Commented Jul 9, 2017 at 20:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .