Automatic Last Known Good Configuration in Windows XP

Windows XP's Last Known Good Configuration (LKGC) is best known as a manual recovery option accessed through the F8 Advanced Boot Options menu. However, the operating system is also programmed to automatically activate this recovery mechanism without user intervention under specific, fatal boot-time conditions. This article outlines the precise system triggers, service failure levels, and registry states that cause Windows XP to automatically reboot and apply the Last Known Good Configuration.

The Mechanism Behind LKGC

During boot, Windows XP relies on hardware configurations and driver settings stored in the registry under HKEY_LOCAL_MACHINE\SYSTEM. This key contains numbered control sets (such as ControlSet001 and ControlSet002) tracked by a Select subkey:

  • Default: The control set Windows intends to use for the current startup.
  • LastKnownGood: The control set that successfully booted the system up to the point of a valid user logon.
  • Failed: The control set that encountered a fatal error during boot.

A configuration is only certified as "Good" after a user successfully logs into Windows XP. If a critical failure occurs prior to this logon checkpoint, the automatic recovery sequence can engage.

Trigger: Service and Driver Error Control Values

The Service Control Manager (SCM) and the Windows executive load core system drivers and services based on their assigned ErrorControl registry value (located under HKLM\SYSTEM\CurrentControlSet\Services\<ServiceName>). Windows XP automatically invokes LKGC when a service or driver configured with specific error values fails to initialize:

  1. SERVICE_ERROR_CRITICAL (Value: 0x3): If a device driver or service marked as critical fails during startup, the startup process halts. Windows XP logs an event, flags the current control set as failed, and automatically reboots the computer directly into the Last Known Good Configuration.
  2. SERVICE_ERROR_SEVERE (Value: 0x2): If a service flagged with severe error handling fails to initialize while booting from the Default control set, the startup process logs an error and automatically restarts the system using the Last Known Good Configuration.

The Prerequisite: Active Control Set Status

Automatic activation only occurs if the system is currently attempting to boot using the Default control set.

If the system has already switched to the Last Known Good Configuration and encounters another SERVICE_ERROR_CRITICAL failure, Windows XP will not attempt another automatic fallback. Instead, the boot process halts entirely and displays a Blue Screen of Death (BSOD), such as STOP: 0x0000007B (INACCESSIBLE_BOOT_DEVICE) or STOP: 0x00000067 (CONFIG_INITIALIZATION_FAILED).

The Timing Constraint

The automatic trigger is exclusively active between the initial kernel initialization phase and the completion of the interactive user logon. Once a user successfully logs on, the system invokes the Winlogon process, which copies the current settings over to the LastKnownGood control set. Any service or driver failures that occur after this milestone will not trigger an automatic reversion, as the current control set has already been marked as valid.