title: No display with message:"Guest has not initialized the display (yet)." when I try to run Android on qemu
body: <p>I just try to run android on qemu. I work on an Ubuntu 16.04 with <code>Intel(R) Core(TM) i7-4790</code> CPU.</p>
  
  <p>I sync and compile <code>android-6.0.1_r1</code> into <code>aosp_arm-eng</code>. 
  I sync and compile <code>qemu 2.9.91</code> with arm platform.</p>
  
  <p>Then, I try to do my job by the following shell code:</p>
  
  <pre><code>    ANDROID_IMAGE_PATH=${ANDROID_PATH}/out/target/product/generic
      QEMU_ARCH="arm"
      QEMU_OPTS="-cpu cortex-a15 -machine type=virt"
      KERNEL_CMDLINE='console=ttyAMA0,38400 earlycon=pl011,0x09000000 debug nosmp drm.debug=0x0 rootwait androidboot.selinux=permissive'
      LINUX_PATH=${ANDROID_PATH}/prebuilts/qemu-kernel
      KERNEL=${LINUX_PATH}/arm/kernel-qemu-armv7
  
      ${QEMU_PATH}/${QEMU_ARCH}-softmmu/qemu-system-${QEMU_ARCH} \
      ${QEMU_OPTS} \
      -append "${KERNEL_CMDLINE}" \
      -m 1024 \
      -serial mon:stdio \
      -kernel ${KERNEL} \
      -initrd ${ANDROID_IMAGE_PATH}/ramdisk.img \
      -drive index=0,if=none,id=system,format=raw,file=${ANDROID_IMAGE_PATH}/system.img \
      -device virtio-blk-pci,drive=system \
      -drive index=1,if=none,id=cache,format=raw,file=${ANDROID_IMAGE_PATH}/cache.img \
      -device virtio-blk-pci,drive=cache \
      -drive index=2,if=none,id=userdata,format=raw,file=${ANDROID_IMAGE_PATH}/userdata.img \
      -device virtio-blk-pci,drive=userdata \
      -netdev user,id=mynet,hostfwd=tcp::5550-:5555 -device virtio-net-pci,netdev=mynet \
      -display gtk,gl=on \
      -device virtio-gpu-pci,virgl \
      -device nec-usb-xhci,id=xhci \
      -device sdhci-pci \
      -d guest_errors \
      $*
  </code></pre>
  
  <p>Then I get the message: "Guest has not initialized the display (yet)" on qemu window as the following picture:
  <a href="https://i.stack.imgur.com/D5HsM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D5HsM.png" alt="enter image description here"></a></p>
  
  <p>The question may is because that the kernel and the options is not matched. </p>
  
  <p>So first(1) I check the images.
  I run the emulator with the above images and path.
  The emulator is based on qemu and got from Android source code.
  I run the emulator with the following code and it work. </p>
  
  <pre><code>EMULATOR_PATH=${ANDROID_PATH}/prebuilts/android-emulator/linux-x86_64
  ${EMULATOR_PATH}/emulator \
      -kernel ${KERNEL} \
      -ramdisk ${ANDROID_IMAGE_PATH}/ramdisk.img \
      -system ${ANDROID_IMAGE_PATH}/system.img \
      -data ${ANDROID_IMAGE_PATH}/userdata.img \
  -sysdir ${ANDROID_IMAGE_PATH} \
  -memory 512 \
      -partition-size 1024
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/7SHNt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7SHNt.png" alt="enter image description here"></a></p>
  
  <p>Now, there may has something wrong in the options with qemu. 
  So could someone tell me the useful machine type or some other option?</p>
  
  <p>I'll thank you very much if you could give me some help (⊙o⊙)</p>