A developer shows how you can run Linux when Windows crashes. A useful expedient for debugging the system.

A blue screen in Windows, commonly known as “Blue Screen of Death” (BSOD), appears when a critical system error occurs that prevents the operating system from working properly. There blue screen is displayed to alert the user of the error and to prevent any further damage. In another article we have seen what the blue screen is and what it can be due to.

An independent developer posted on GitHub his BugCheck2Linux project, a mechanism that allows for boot linux when Windows crashes and suddenly presents a blue screen. In this case, therefore, the system does not “die”, rather, a lightweight Linux-based implementation of a RISC V emulator is created.

It is not known that after a blue screen it is still possible to start an executable with Windows. Yet it is possible to do this by resorting to a system function called bug check callback: It allows developers to start an operation after a BSOD error occurs.

During the bug checkthe operating system logs information about the system status and the causes of the error in a file dump, which can be used to analyze and fix the problem. However, the callback function allows developers and engineers to add custom code to perform specific actions. Here is the key used by the researcher on GitHub: BugCheck2Linux is loaded as driver when the blue screen appears and hence the loading of the RISC V emulator built on Linux is ordered.

There are some limits pretty strict on the version of linux that can run after the windows BSOD. For example, the resolution is reduced to 640 x 480 pixels and 16 colors, the mechanism works only on BIOS-based systems legacy (non-UEFI) and performance leaves something to be desired. In other words, it is hardly possible to boot a full installation of Ubuntu or other Linux distributions.

However, instructions for arranging Linux to load after a Windows BSOD are posted on GitHub under paragraph How to run it? The procedure is to activate the loading unsigned drivers digitally with bcdedit then in the setting of the bug check callback with the command scwhich in Windows allows you to configure system services.

Obviously, the presented procedure should be considered as one curiositynot like a tool to be used routinely on your systems.

To test how the bug check callback configured, you can generate a blue screen in Windows. The same effect is achieved by typing taskkill /im svchost.exe /f from a command prompt opened with administrator rights. You can do some tests but proceed only and only after closing all running programs e saved any open files.


Please enter your comment!
Please enter your name here