#Windbg Virtual machine dual kernel debugging
When doing kernel debugging , We often use windbg Virtual machine dual machine debugging based on , So here we record the process of dual machine debugging , Convenient inquiry . in addition , Microsoft provides a windbgpreview
tool , It is windbg Upgrade version of ,ui It's better , And put x86 and x64 Together , You don't need administrator rights to run . It's convenient .

First select the connection method , There is only one serial port mode with virtual machine , Through the virtual machine simulation serial port output to the host named pipe , then WinDbg(preview)
Connect this named pipe , So as to realize the connection between host and virtual machine

1. The first step is to create a virtual serial port for the virtual machine .


Turn off the virtual machine , Enter the settings page of the virtual machine . First of all, we need to delete the printer as a hardware device , Because the hardware of the printer occupies a serial port , As a result, the serial port we added later can only be serial port 2. of course , You may not delete it , Only some parameters need to be changed when setting later .
Then click on the “ add to ”.

Select serial port , next step .

Select output to named pipe , next step .

Name the pipe as WinDbg(Preview) What you need to use when connecting
Pipeline name ,\.\pipe\ Prefix is necessary , It can be followed by an easy to understand name . At the other end of the selection is the application , Namely windbg Preview. complete .

2. Add debug startup entry

After setting the hardware connection mode ( Here's the virtual hardware ), Start the system in the virtual machine , Add debug startup entry . Because the virtual machine only virtualizes the serial port , So you can only use serial port mode when setting system startup item .Vista
The previous system was modified boot.ini File implementation , As shown in the table below . The red item indicates a new addition Added startup item ,/debug Indicates that the kernel debugging engine is turned on ,/debugport=com1
Serial port is used 1 signal communication ,/baudrate=115200 set up Set serial port 1 The baud rate of is 115200.
[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft
Windows XP Professional" /noexecute=optin /fastdetect multi(0)disk(0)rdisk(0
)partition(1)\WINDOWS="debug entry" /noexecute=optin /debug /debugport=com1
/baudrate=115200
The boot Item Configuration in the last line is what we want to add .
Restart after adding , After entering the selection interface of startup item , Choose up and down , Make it stay in this interface . Then open it windbg Preview Kernel debugging interface of ,

Technology