How to turn off Windows kernel debugging at boot time?
Asked Answered
P

2

10

I have a Vista 32 bit machine which I wanted to enable local kernel debugging on. In WinDbg I selected File/Kernel Debug and selected the Local tab and clicked ok. I got the following message.

The system does not support local kernel debugging. ... Local kernel debugging is disabled by default in Windows Vista, you must run 'bcdedit -debug on' and reboot to enable it.

I naively followed the instructions and opened an elevated command prompt and typed 'bcdedit -debug on' and the rebooted.

However, on reboot the system hangs when it gets to the logon screen - or just after I type in my username and password.

I suspect what is happening is that because a debugger is enabled, user mode exceptions are being triggered in the kernel debugger process and it is waiting for me to enter some input from an attached debugger??

I was hoping to debug on the actual target machine.

My problem is that every time I boot - whatever F8 boot option I choose - it always either hangs or gets so far and then reboots - and then hangs.

Booting in Safe Mode - gets close to the logon screen and then reboots. Same applies for the command line and network boot options. Last known good config - hangs too.

Is there any way to change the boot option before Windows loads so that I can turn off kernel debugging. I have only the one boot config which was, in hindsight, my problem - I should have created a copy of the first boot config for my debug boot option.

Unfortunately the system doesn't have a serial port so I can't attempt to debug through that.

The only option I can think of now is to attempt to connect a debugger from a different machine through a USB port. However, don't I need to configure the target PC to accept a debugger on a USB port or will this just work if I get a proper debug USB cable?

Penman answered 3/3, 2011 at 14:56 Comment(1)
It would only break into the debugger if one is connected. It's usually not enough to enable debugging, a debugger actually has to be connected.Inlet
P
10

Worked out how to get the machine running again.

Pressing F8 during reboot gives the Repair option. Selecting Repair and gives a number of other options including Restoring to a previous restore point and also opening a command prompt.

I had tried the following...

Opening a command prompt and typing "bcdedit -debug off" which was accepted but didn't seem to help. I then tried restoring to a restore point of a couple of days previous. Again I got a hang on reload.

The reason,.... neither of these actually turned off the debug option for the boot config.

What I needed to do was: in the Repair menu - open a command prompt. Then type bcdedit /enum to list the boot configs. Then call

bcdedit /set {default} debug off

I guess my initial attempts to call bcdedit -debug off were turning it off on the (which it already was) on the boot manager config because I didn't specify a particular config name.

Penman answered 3/3, 2011 at 16:6 Comment(2)
Wow, thank you! I was in the exact same situation and I was sure I'd have to reinstall Windows, thanks for posting this solution.Sisterly
boot configuration data could not be opened , Same issue I am facing, even I didn't enable debugging type. If I go to command prompt I am not getting boot optionsGutta
C
8

There is no need for to use the repair option! Just press F10 instead of F8, now you will be able to edit the bootparameter! Just delete /DEBUG and press enter to continue the boot process. After set use bcdedit -debug off to permanently change the debug option.

Craftwork answered 13/8, 2012 at 13:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.