没有显示消息:“访客尚未初始化显示(尚未)".当我尝试在qemu上运行Android时 [英] No display with message:"Guest has not initialized the display (yet)." when I try to run Android on qemu
问题描述
我只是尝试在qemu上运行android.我在使用 Intel(R)Core(TM)i7-4790
CPU的Ubuntu 16.04上工作.
I just try to run android on qemu. I work on an Ubuntu 16.04 with Intel(R) Core(TM) i7-4790
CPU.
我将 android-6.0.1_r1
同步并编译为 aosp_arm-eng
.我使用arm平台同步并编译了 qemu 2.9.91
.
I sync and compile android-6.0.1_r1
into aosp_arm-eng
.
I sync and compile qemu 2.9.91
with arm platform.
然后,我尝试通过以下shell代码完成工作:
Then, I try to do my job by the following shell 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 \
$*
然后我得到消息:访客尚未初始化qemu窗口上的显示(如下所示)",如下图所示:
Then I get the message: "Guest has not initialized the display (yet)" on qemu window as the following picture:
问题可能是因为内核和选项不匹配.
The question may is because that the kernel and the options is not matched.
因此,首先(1)我检查图像.我使用上面的图像和路径运行模拟器.该仿真器基于qemu并从Android源代码获得.我使用以下代码运行模拟器,它可以正常工作.
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.
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
现在,qemu的选项中可能有问题.有人可以告诉我有用的机器类型或其他选项吗?
Now, there may has something wrong in the options with qemu. So could someone tell me the useful machine type or some other option?
如果能给我一些帮助,我会非常感谢(
I'll thank you very much if you could give me some help (⊙o⊙)
推荐答案
尝试 -display gtk,gl = off
禁用GL显示驱动程序,该驱动程序可能会有所不同.
try -display gtk,gl=off
to disable the GL display driver, which possibly may vary.
或 -nographic
,以便无头运行.
请参见 https://www.linux-kvm.org/images/b/b2/01x10b-QEMUGfraphics.pdf
这篇关于没有显示消息:“访客尚未初始化显示(尚未)".当我尝试在qemu上运行Android时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!