Host Virtual Machine -- virtual machine running windbg
The running parameters of the host virtual machine include "-serial TCP: 4445, server, Nowait" (4445 is the port number and any available TCP port)
Install windbg and symbols in the virtual machine, specify "symbol file path...", and then start "kenerl debug ..."
Target Virtual Machine -- virtual machine to be debugged
The target VM running parameters include "-serial TCP: 127.0.0.1: 4445"
Enable serial port debugging in virtual machines
1. Run cmd as an administrator
2. Enter the following command in the command prompt line to copy the boot item, which means to copy the current Boot item, and the copy item is described as "for debug ". (The description is displayed as the boot menu title)
Bcdedit/copy {current}/D "for debug"
3. Record the returned identifier for easy editing. In this example, the returned GUID is: {edc961e6-0a37-11df-a30a-92cc1b2fa135}
4. Enter the following command in the command prompt line to enable startup debugging of the system loader for the replication item.
Bcdedit/bootdebug {edc961e6-0a37-11df-a30a-92cc1b2fa135} on
5. Enter the following command in the command prompt line to set global debugging:ProgramSerial debugging with 115200 port on COM1:
Bcdedit/dbgsettings serial debugport: 1 baudrate: 115200
6. Enter the following command in the command line to enable kernel debugging:
Bcdedit/debug {edc961e6-0a37-11df-a30a-92cc1b2fa135} on
7. msconfig you can see the newly added startup Item and set the debugging item as the default item.
8. Restart and start debugging.