Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off Windows kernel debugging at boot time?

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?

like image 947
Mark D Jackson Avatar asked Mar 03 '11 14:03

Mark D Jackson


People also ask

How do I disable Windows kernel debugging?

To disable kernel debugging on the target computer, open a Command Prompt window as Administrator and enter the command bcdedit /debug off. Reboot the target computer.

How do I disable Microsoft Kernel Debug network adapter?

Press Windows Logo key + X, to open Device Manager. Expand Network adapters. Now, right click on the Kernel Debug adapter and select Disable device.

How do I exit kernel-mode?

To end a kernel-mode debugging session, return the debugger to dormant mode, and leave the target computer frozen, you can use the following methods: Enter the q (Quit) command (unless you started the debugger with the -pd option) Choose Stop Debugging from the Debug menu. Press SHIFT+F5.

How do I turn off WinDbg?

You can exit WinDbg by choosing Exit from the File menu or by pressing ALT+F4.


2 Answers

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.

like image 169
Mark D Jackson Avatar answered Oct 15 '22 17:10

Mark D Jackson


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.

like image 8
Oliver Avatar answered Oct 15 '22 17:10

Oliver