VS 2013 kernel-mode driver debugging - windows

I'm trying to set up kernel debugging with VS 2013. When I go to Drivers/Add to add a new target machine, it connects to the remote computer and runs through a lot of setup, but it there are always 2 commands that fail.
I looked up the command that is failing in the log and I pasted it into a batch file and ran it on the target machine. I runs just fine. But then when I try to rerun Add Computer from VS, I get the same failure.
RemoteExecute: Binary: $KitRoot$\Testing\Runtimes\TAEF\te.exe
RemoteExecution: Arguments:
"%SystemDrive%\DriverTest\Run\DriverTestTasks.dll"
/select:"#Name='DriverTestTasks::_ConfigureKernelDebugger'"
/p:"DebugTransport=NET" /p:"NetHost=192.168.1.109" /p:"NetPort=50015"
/p:"NetKey=8XD3HYLMVI0D.RKFEA2BPIXO.27JOLNYURED5.MV9OGRF4XR9V"
/p:"StartPolicy=Active" /p:"IgnoreUserModeExceptions=0"
/p:"SuppressReboot=1"
/rebootStateFile:%SystemDrive%\DriverTest\Logs\DriverTestReboot.xml
/enableWttLogging
/wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Logs\Configure_debugger_settings_(x86)_(possible_reboot)_00007.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*"
/runas:Elevated RemoteExecute: Process creation return code: 0
RemoteExecute: Process exit code: 0 Initialize: Computer: w8x86wdk-hp
Result completed Test process exit code: -1
I have tried this both with a VMware VM target and against a physical PC target and I have tried adding the computer in the reverse direction and I always get the same failures. I can ping these machines from each other and all machines are Win8 x86. Network discovery and sharing are on. The Windows firewalls are off. These are virgin OS installations so there's nothing on the machines except the OS, VS2013, and WDK 8.1.
Any tips on how to resolve this?

Had same issue when used ws2012 for TARGET machine.
When installed WIN81 instead, turned off UAC and DID NOT install wdk on TARGET - everything started working. Read carefully how to PROVISION TARGET. (it says: dont' install WDK there:)
HOST and TARGET was in the same home workgroup with same passwords for Administrator and MyUserAcc.
also:
under HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System set EnableLUA=0

I am just testing it so I think you should first check your target computer security issue. Then set your port pipe connection and your network adapter setting in your virtual pc.
After that setting make your computer configuration then works perfectly.

Related

problem with an autorun devserver 17 in windows startup on windows 10

I have a program that builds with Delphi and It uses MySQL for DB in Windows 10. I install Devserver 17 but it can not be run in windows startup. I need to run Devserver before my program. I searched on google and used some tips but my problem still alive. for example I use "shellexecuteEx" for run Devserver (run-devserver.exe) when my program start ( on FormCreat event) but it has a delay that is not good for me and give me a new PROBLEMS!. After running the "run-devserver.exe" with "shellexecuteEx", the Http server and database server aren`t running! if I run them manually everything is ok but I want all of them (Devserver and HTTP server and database server) to start automatically before my program.
I use "shellexecuteEx" to execute "eds-dbserver.exe" too but it not working.
I think to avoid a chain of problems I should solve the first problem that is running Devserver and HTTP Server and Database server in Windows StartUp in Windows 10.
I used some tips that not worked for me (in the below):
-Using "shellexecuteEx",
-Run as Administrator,
-change "eds.ini" file : set "Autostart_httpserver=1" and "Autostart_dbserver=1"
-check the windows and antivirus firewall rules
-Run Programs Automatically Using Windows Task Scheduler
please give me a new way.
I had to uninstall devserver 17 and install it again. I put a shortcut of "run-devserver.exe" in the startup folder in this address: "C:\Users\MyPCName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup". the Devserver started on windows startup but HTTP server and database server didn't start. i put a shortcut of dbserver and httpserver to the startup folder too and everything is ok!
dbserver address : C:\Program Files (x86)\EasyPHP-Devserver-17\eds-binaries\dbserver\mysqlxxxx\bin\eds-dbserver.exe
http server address :
C:\Program Files (x86)\EasyPHP-Devserver-17\eds-binaries\httpserver\apachexxxx\bin\eds-httpserver.exe

Kernel Debugging in VS2015

I'm having a fair bit of difficulty in trying to get VS2015 Community running on 2 separate computers to enable remote kernel debugging over the network. Both PCs are running on Windows 10 Enterprise.
Here's the IPs:
192.168.1.79 - Host
192.168.1.84 - Target
On the target I ran as administrator:
bcdedit /debug on
bcdedit /dbgsettings net hostip:192.168.1.79 port:55252
When I try to connect to it from the host in VS2015 I put in 192.168.1.84 as the host, then the key and the hostip and port listed above. It says it can't connect to 192.168.1.84:50005 even though I put the port as 55252?
I followed this article here:
https://msdn.microsoft.com/en-us/library/windows/hardware/hh439346(v=vs.85).aspx
The hostip on the target should be pointing to 192.168.1.79 (host) right? Are there any other services I need to start or am I missing anything? I tried a reboot too.
Make sure that you've run:
C:\Program Files (x86)\Windows Kits\10\Remote\x64\WDK Test Target Setup x64-x64_en-us.msi
After you've installed the WDK/VS Tools and BEFORE you connect to the remote debugger with the host computer. I had to read the above from this separate article on provisioning.
https://learn.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/provision-a-target-computer-wdk-8-1
It's doing all of its copying now. The host/target nomenclature can be a little confusing I would prefer it to just be source/destination as I usually instinctively think of a host in terms of a destination not a source.

Jenkins doesn't recognize slave being down and thus does not allow for it to reconnect

We have a Jenkins instance running on Ubuntu that has several slaves in different systems. One of them is a Windows 7 host, having jenkins slave instance configured as a service.
We have a problem that when that machine is rebooted, master Jenkins doesn't realize it's gone. It looks to be just fine in the nodes view. Then, when a build is issued that is supposed to use that slave it gets stuck. If that is stopped, the next build fails immediately
Caused by: java.util.concurrent.TimeoutException: Ping started at 1457016721684 hasn't completed by 1457016961684
... 2 more
[EnvInject] - [ERROR] - SEVERE ERROR occurs: channel is already closed
When the slave has started up and it tries to connect back to master, connection is refused, and in the logs there is an error saying connection with that name already exists:
Server didn't accept the handshake: xxx is already connected to this master. Rejecting this connection.
There is issue JENKINS-5055 which claims a fix was committed allowing the same JNLP slave to reconnect without getting rejected, apparently this commit, and according to changelog, it was introduced in version 1.396 (2011/02/02). We are however using version 1.639 and seeing this. Somebody else seems to be seeing it as well. By looking at current codebase, I see where the error is coming from, but don't see the fix done in Jenkins-5055.
Any ideas on resolving this?
Edit: also asked on jenkins user mailing list, but no responses.
We faced the same issue. Used https://wiki.jenkins-ci.org/display/JENKINS/slave-status as workaround
Reinstalling the slave on a Windows Server 2012 R2 machine shows no signs of this behavior, so it seems that either there was a mistake done during installation steps or this is something caused by using a workstation Windows version.
Regardless, here were the steps to get it working, assuming a brand new installation of Windows, with no network connectivity, and master instance using a self-signed certificate:
Install JRE on the machine. If you have 64-bit operating system, install both 32-bit and 64-bit, otherwise go with 32-bit. Download link here
Install .NET 3.5 on the machine. This is needed by the Jenkins service. You can follow the steps outlined by my other answer for this.
Install Jenkins using Windows installer (.zipped) to C:\Jenkins. It can be downloaded from here.
Check your installation is responding by navigating to http://localhost:8080 . In case of trouble, check for logs in the jenkins folder. If there is a port conflict, edit jenkins.xml and change the httpPort to something else.
From the Windows computer, navigate to your master jenkins and configure a new node there.
Start a slave agent using Java Launch Agent in configure -> node screen (you need to be still using your Windows slave computer)
You should see a visible window opening. From there, select File -> Install as a service. (details and screenshots) If you experience an error without proper explanation, confirm .NET 3.5 is properly installed. If you see "WMI.WmiException: AccessDenied", save the jnlp file locally and start it from administrator prompt or otherwise with elevated privileges (details).
From the Administrative tools -> Services, stop and disable the Jenkins service, and stop Jenkins Slave Agent but leave it on Automatic so it will start up when starting up the computer.
This is only relevant if you're using a self-signed or otherwise problematic certificate:
download the previously mentioned Java Launch Agent file (.jnlp file) again and save it to C:\jenkins
open c:\jenkins\jenkins-slave.xml to your editor
change it to refer to your local .jnlp file by changing jnlp url parameter (file:/C:/jenkins/jenkins-slave.jnlp)
add -noCertificateCheck to parameters
replace the -secret parameter with -auth "user:pass", since otherwise automatic url get parameters will be added which will mess finding the .jnlp file
Start the Jenkins Slave Agent service again
For problems with jenkins slave service, check out jenkins-slave.err.log. For Windows Server 2012 R2, you can get the functionality of tail by using Get-Content .\jenkins-slave.err.log -Wait -Tail 10 in Powershell prompt. For older versions of Powershell, leave out -Tail 10.

Does anyone here uses Linux host/VMWare/VirtualKD debug environment?

Does anyone had a successful experience with VirtualKD setup on Linux host running VMWare Workstation 8 (with Win7 guests)?
Despite the facts there's a lot of admiring comments about 'speed' and 'other benefits' of that VirtualKD, most of them come from Windows/VirtualBox users, and I really don't want to waste my time on trying to get it working on unsupported configuration.
P.S. Official VirtualKD forum has a similar thread that is still unanswered for two years, so decided to ask for reviews here.
P.P.S. My actual problem is that VMWare's socket-based COM port debugging is very slow.. it takes 10 to 20x more time to copy debug output from debuggee to debugger machine, than it takes to print same output to DbgView.
Does anyone had a successful experience with VirtualKD setup on Linux host running VMWare Workstation 8 (with Win7 guests)?
VirtualKD is a Windows-only application. The poster on the forum has worked around the problem of it being Windows-only by redirecting a Unix socket to TCP, therefore allowing Windows clients to connect over the network.
I've used socat to successfully bridge two VMs using a tcp socket. I created pipes in /tmp and ran socat between them; one VM can then debug the other.
In my case, because I'd configured the debugger to use serial connections I was rate limited by the serial connections. I haven't tried the VirtualKD-style setup; however, my bet is it won't work. From the VirtualKD explanation of its internals on VMWare, the client-side code is basically using hypervisor provided functionality. VirtualBox has to be patched by VirtualKD; I expect this is to provide such functionality to VirtualBox clients.
The bad news is this means, ultimately, that the Linux host hypervisor (VMware/VirtualBox on the host) must know to process that information and pass it out to the appropriate location. By default, it won't know how to do this.
I have a successful experience running it on Windows if anyone is looking for that:
Install VirtualBox 5.x or less and create a virtual machine with a Windows .iso SATA device and set it up
Download VirtualKD-3.0
Open the VM and run vminstall.exe on the guest
On admin cmd on the guest: bcdedit /dbgsettings SERIAL DEBUGPORT:1 BAUDRATE:115200
Shut down VM, close VirtualBox and kill the VBoxSVC.exe process
Run VirtualIntegration.exe. If it crashes open an admin cmd and cd to C:\Program Files\Oracle\VirtualBox and then type vboxmanage setextradata <VMNAME> VBoxInternal/Devices/VirtualKD/0/Config/Path <VirtualKD-3.0 folder> i.e. vboxmanage setextradata Windows7 VBoxInternal/Devices/VirtualKD/0/Config/Path C:\Users\lewis\Downloads\VirtualKD-3.0
Open vmmon64.exe and set the debugger path i.e C:\Program Files\Debugging Tools for Windows (x64)\windbg.exe, and then select WINDBG.EXE and start debugger automatically
Launch VM and highlight the VirtualKD entry and press f8 and disable driver signature enforcement and you will soon break into the debugger at nt!RtlpBreakWithStatusInstruction, which is a debugger symbol for the first address of the DbgBreakPointWithStatus, which is called from InitBootProcessor, which is the breakpoint you'd get from sxe ibp;.reboot. There is an earlier breakpoint of sxe ld:nt
You will need to unpatch the VM in order to be able to boot it without vmmon open. VirtualKD is good for logging with debugging protocol packets and automating windbg connection but you can't boot debug with it. In order for boot debugging to work you will need to create a COM1 serial port on the VM and set it to create a pipe \\.\pipe\pipename. You then need to connect to the pipe via windbg manually. Make sure that you have done bcdedit /bootdebug /on && bcdedit /bootdebug {bootmgr} /on && bcdedit /set {bootmgr} debugtype serial && bcdedit /set {bootmgr} baudrate 115200 && bcdedit /set {bootmgr} debugport 1 on the guest before booting.

partially trusted reading app.config on Windows 7 in network share

I'm getting this error in Windows 7 64 bits:
An error occurred creating the configuration section handler for '': That assembly does not allow partially trusted callers.
This happens when I try to read a config section, the section is mapped to a class that is in a DLL in the GAC, I'm using Visual Studio 2010 targeting the framework 3.5, I'm in a domain and the exe is running from a network share, the exe is signed.
This is failing only on Windows 7, an XP Machine can run the app just fine from the same network share, I'm using my domain account on both machines.
Does anyone know why this is failing on Windows 7?, thanks a lot for your time.
Having bumped into similar trouble when our IT department did a stealth upgrade of users' machines to Windows 7, I suspect you may need to update the trust level with caspol.exe
For XP we would normally run:
%windir%\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -q -m -ag 1.2 -url file:\\s:\* FullTrust
but now with Win7 it has changed to:
%windir%\Microsoft.NET\Framework64\v2.0.50727\CasPol.exe -q -m -ag 1.2 -url file:\\s:\* FullTrust
I Fixed using this command:
caspol -cg 1.2 FullTrust
The Intranet Zone had the LocalIntranet permissions set, (don't know why it was LocalIntranet, it should be FullTrust).
Thanks to dreynold.

Resources