How to Debug Bootloops

128 views
Skip to first unread message

pundir...@gmail.com

unread,
Sep 15, 2020, 6:01:39 AM9/15/20
to Android-x86
Hi Guys,

So i was building android-x86 with custom features and i am encountering a Bootloop. I have a NAT'ed VM setup with VIRT_WIFI=0 to automatically connect it to ethernet and get adb access but this only seems to work when the image has booted to display and stays offline while in bootloop. 

Any ideas on how i can debug this?

Thanks,
Sumit

Michael Goffioul

unread,
Sep 15, 2020, 6:48:42 AM9/15/20
to Android-x86
Not sure this will help you, but I've started recently to run android-x86 in qemu directly from built image (not from the ISO), using the following script:

#!/bin/bash
 
OUT=$1
qemu-system-i386 \
        -enable-kvm \
        -kernel $OUT/kernel -append "root=/dev/ram0 vmalloc=192M console=ttyS0 video=1280x800 DPI=160 VIRT_WIFI=0" \
        -initrd $OUT/initrd.img \
        -m 2048 -smp 2 -cpu host \
        -soundhw ac97 \
        -usb -device usb-tablet,bus=usb-bus.0 \
        -serial mon:stdio \
        -drive index=0,if=virtio,id=system,file=$OUT/system.sfs,format=raw,readonly \
        -net nic -net user,hostfwd=tcp::5555-:5555 \
        -device virtio-vga,virgl=on \
        -display gtk,gl=on,zoom-to-fit=off

You may need some adjustment for your own use case, but one very useful feature is that the android console is in the terminal you started the VM from. That includes kernel initial logs, as well as logcat access. The above command works for Android 11. For Android 9 and below, you'll probably need to add the ramdisk. In any case, it was inspired by this script:


Michael.


--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/e199bf53-922a-4ac1-9b1e-c7bfd2500ed1n%40googlegroups.com.

Sumit Pundir

unread,
Sep 15, 2020, 3:14:34 PM9/15/20
to andro...@googlegroups.com
On Tue, Sep 15, 2020 at 4:18 PM Michael Goffioul <michael....@gmail.com> wrote:
Not sure this will help you, but I've started recently to run android-x86 in qemu directly from built image (not from the ISO), using the following script:

#!/bin/bash
 
OUT=$1
qemu-system-i386 \
        -enable-kvm \
        -kernel $OUT/kernel -append "root=/dev/ram0 vmalloc=192M console=ttyS0 video=1280x800 DPI=160 VIRT_WIFI=0" \
        -initrd $OUT/initrd.img \
        -m 2048 -smp 2 -cpu host \
        -soundhw ac97 \
        -usb -device usb-tablet,bus=usb-bus.0 \
        -serial mon:stdio \
        -drive index=0,if=virtio,id=system,file=$OUT/system.sfs,format=raw,readonly \
        -net nic -net user,hostfwd=tcp::5555-:5555 \
        -device virtio-vga,virgl=on \
        -display gtk,gl=on,zoom-to-fit=off

You may need some adjustment for your own use case, but one very useful feature is that the android console is in the terminal you started the VM from. That includes kernel initial logs, as well as logcat access. The above command works for Android 11. For Android 9 and below, you'll probably need to add the ramdisk. In any case, it was inspired by this script:


Michael.

Hi Michael,

Thanks, but I found a workaround. So what i did was to apparently open a console at boot(alt + f1/f2/f3) and tried to get logcat from there but was getting disrupted by the BootAnimation making it harder for me to stay at the console so i basically  disabled BootAnimation by setting "debug.sf.nobootanimation=1" and it worked like a charm. Debugged and booted the VM :)

Sumit
Reply all
Reply to author
Forward
0 new messages