Debug configuration of Visual studio 2017

Hi
I am trying to debug my driver with Visual Studio 2017. But I failed to connect to the target computer.
Who can tell the cause?

The configuration of target computer is as following.

And I checked that the NIC supports Kdnet.

When I turned the target computer to debug mode and restarted it, the messages captured by Windbg(X64).exe in host computer are as following.

Microsoft (R) Windows Debugger Version 10.0.17763.1 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

Using NET for debugging
Opened WinSock 2.0
Waiting to reconnect…
Connected to target 169.254.125.11 on port 50005 on local IP 192.168.0.30.
You can get the target MAC address by running .kdtargetmac command.
Connected to Windows 10 18362 x64 target at (Mon Jul 15 17:13:33.715 2019 (UTC + 9:00)), ptr64 TRUE
Kernel Debugger connection established.
Symbol search path is: srv*
Executable search path is:
*** ERROR: Symbol file could not be found. Defaulted to export symbols for ntkrnlmp.exe -
Windows 10 Kernel Version 18362 MP (1 procs) Free x64
Built by: 18362.1.amd64fre.19h1_release.190318-1202
Machine Name:
Kernel base = 0xfffff8020fe00000 PsLoadedModuleList = 0xfffff802102432f0
System Uptime: 0 days 0:01:08.750
KDTARGET: Refreshing KD connection
Capacity:48600, FullChargedCapacity:16610, Voltage:12397, Rate:0

It seems that they are connected.

I configued the connection in Visual Statio 2017 in the host computer as below.

When I tried to connect Visual Studio in host computer to the target computer, below messages come up.

Installing necessary components…
Failed operation: An error occurred while connecting from the remote machine.
Error: 10061 (ConnectionRefused)
Error message: Failed to connect due to being rejected by the target computer. 192.168.0.30:50005

What is the problem?
Help me.

Tatuo

Do not try to debug your driver via Visual Studio. This is very hard, and rarely work correctly.

Instead just use WinDbg as your debugger.

Build your driver in VS and debug with WinDbg.

Peter

Dear Mr. Viscarola

Thank you very much.
It is said that “Setting Up Kernel-Mode Debugging over a Network Cable in Visual Studio” is not available in Windows 10, version 1507 and later versions of the WDK. Is it true?
https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/setting-up-a-network-debugging-connection-in-visual-studio

I feel very sad.

Any way, thank you.

Tatuo

I strongly suspect that warning was added by mistake. 1394 debugging was removed in Windows 10, and someone probably just copied the warning into too many places. Ethernet debugging wasn’t even introduced until Windows 8.1, and it’s certainly still alive now.

However, the end result is just what Peter said. Use Windbg as your debugger, not Visual Studio. That works perfectly fine.

Dear Mr. Roberts

Thank you very much.
I have gived up with debugging in Visual Studio.
And I am learning Windbg with
https://docs.microsoft.com/ja-jp/windows-hardware/drivers/debugger/debug-universal-drivers—step-by-step-lab–echo-kernel-mode-

When I proceeded to Section 5, I failed to load the symbols.
Here are the messages when I typed command “.reload /f”.

0: kd> .symfix
0: kd> .sympath+ E:\test\echorig\kmdf
Symbol search path is: srv*;E:\test\echorig\kmdf
Expanded Symbol search path is: cache*;SRV*https://msdl.microsoft.com/download/symbols;e:\test\echorig\kmdf

************* Path validation summary **************
Response Time (ms) Location
Deferred srv*
OK E:\test\echorig\kmdf

0: kd> .reload /f

Connected to Windows 10 18362 x64 target at (Fri Jul 19 15:45:28.383 2019 (UTC + 9:00)), ptr64 TRUE
Loading Kernel Symbols
…*** ERROR: Symbol file could not be found. Defaulted to export symbols for clipsp.sys -
…*** ERROR: Module load completed but symbols could not be loaded for WdFilter.sys

Press ctrl-c (cdb, kd, ntsd) or ctrl-break (windbg) to abort symbol loads that take too long.
Run !sym noisy before .reload to track down problems loading symbols.


…*** WARNING: Unable to verify timestamp for Null.SYS
*** ERROR: Module load completed but symbols could not be loaded for Null.SYS
…*** ERROR: Module load completed but symbols could not be loaded for igdkmd64.sys
.*** ERROR: Module load completed but symbols could not be loaded for TeeDriverW8x64.sys
…*** ERROR: Symbol file could not be found. Defaulted to export symbols for drmk.sys -
…*** ERROR: Module load completed but symbols could not be loaded for Apfiltr.sys
…*** ERROR: Module load completed but symbols could not be loaded for iwdbus.sys
…*** ERROR: Module load completed but symbols could not be loaded for CSLFDx64.sys
…*** ERROR: Module load completed but symbols could not be loaded for bcbtums.sys

…*** ERROR: Module load completed but symbols could not be loaded for peauth.sys
…*** ERROR: Module load completed but symbols could not be loaded for WdNisDrv.sys

Loading User Symbols

Loading unloaded module list

************* Symbol Loading Error Summary **************
Module name Error
clipsp--------------------------------------The system cannot find the file specified
WdFilter----------------------------------The system cannot find the file specified
Null----------------------------------------The system cannot find the file specified
igdkmd64--------------------------------The system cannot find the file specified
TeeDriverW8x64----------------------The system cannot find the file specified
drmk--------------------------------------The system cannot find the file specified
Apfiltr-------------------------------------The system cannot find the file specified
iwdbus-----------------------------------The system cannot find the file specified
CSLFDx64-------------------------------The system cannot find the file specified
bcbtums---------------------------------The system cannot find the file specified
peauth-----------------------------------The system cannot find the file specified
WdNisDrv-------------------------------The system cannot find the file specified

You can troubleshoot most symbol related issues by turning on symbol loading diagnostics (!sym noisy) and repeating the command that caused symbols to be loaded.
You should also verify that your symbol search path (.sympath) is correct.

Can you tell me how to fix them.

Best regard.

Tatuo

Dear Mr. Roberts

I got it.

After I set symbol file path to the directory which contains the pdb file in target computer, it runs fine.
(It is a path in target computer. It is not a path in developing computer.)
Thanks a lot.

Tatuo

If the system on which you’re running WinDbg is connected to the Internet, you can use the command “.symfix” to set the symbol search path to the MSFT symbol server. It perhaps you have done this already.

Peter