How to scroll up after a kernel panic

kernel-panicterminal

While tinkering with a Linux VM I regularly get kernel panics, that push up all the helpful output with stuff I don't understand and that is probably not helpful to me.

The panics mostly occur during the initramfs phase. I'm using VirtualBox.

The normal Shift+Pg Up does not work (in my case).

Is there another way to scroll back up and look at the output of whatever came before?

Best Answer

Serial port

The serial port is an old and reliable communication protocol hardware that the Linux kernel supports and most emulators emulate.

You can stream the kernel messages to a host file or console through it:

Serial alternatives

There are even fancier methods mentioned at: Determining cause of Linux kernel panic | Unix & Linux Stack Exchange

  • netdump: sends trace over network.

    Supposes panic didn't break networking, which is more likely than the serial.

    The advantages over serial are:

    • works for systems that don't have serial exposed such as modern laptops

    • serial cables have quite limited maximum wire lengths, which is problematic if you want to have all the boards of your company on a remote room to share resources across developers.

      There are however serial connectors with an Ethernet server which I would recommend instead if your target exposes serial, e.g. this one:

  • kdump: boots a secondary Linux kernel that inspects the panicked kernel. What could possibly go wrong?

Those methods are more flexible, but less reliable.

See also: Scrolling up the failed screen with kernel panic | Super User

Related Question