Kernel Debugging in VS2015 - windows

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.

Related

Connect to Mac running behind NAT on custom SSH port with Xamarin Mac agent

I have Mac, which could be accessed from outside network via NATed port 6535 on my router; router itself exposes port 22 as well. I wish to connect from outside network via Xamarin Mac agent to my Mac.
I am able to connect both to router and Mac via SSH (Putty), but when I try to connect to Mac from Visual Studio 2017 (or MsBuild command prompt) entering in Server IP something like 1.1.1.1:6535 (where 1.1.1.1 is substituted by my router external IP) - I see by fingerprint, that Studio is using port 22 for connections (I see my routers fingerprint, instead of my Mac fingerprint).
Is it ever possible to connect to custom port from Xamarin Mac agent running in Visual Studio and MsBuild?
Can the Xamarin Mac Agent's port be configured? (to something other than port 22) - suggests that I need to connect first successfully, but I could not. Importing registry keys from machine, where connection was successful does not helps, as VS is still trying to bump to remote host via port 22 which is seen by fingerprint (so, I still could not connect from Visual Studio). If I try to invoke an MsBuild directly - it also fails, because MsBuild just ignores port directive.
I start MsBuild with following cmdline at elevated developers command prompt: msbuild mySolution.sln /t:Clean;Build /p:Configuration="Release";IpaPackageDir=C:\t\;Platform=iPhone;ServerAddress=1.1.1.1;ServerPort=6535;ServerUser=user;ServerPassword=password
And in response I receive following:
_SayHello:
Connecting to Mac server 1.1.1.1...
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(63,
5): warning : Ignoring server port when the build is not running inside Visual Studio. [myprojectpath\myproject.csproj]
Starting connection to 1.1.1.1...
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(63,
5): warning : Could not authenticate the user 'user' with the provided credentials [myprojectpath\myproject.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(63,
5): warning VSX1000: A connection to the Mac Server couldn't be established with Address='1.1.1.1' and User='user', so only the main assembly was compiled for project 'myproject'. Connect to a Mac Server and try again to build
the full application. [myprojectpath\myproject.csproj]
please see the following thread, I believe this will help you.
Configure xamarin Mac agent port to something other than 22
I have flagged this as I believe it is a duplicate in most senses.
Follow-up : in your router configuration, can you:
Temporarily assignment port mapping 22 to your Mac and test to make sure this works, you can then set it back.
Create a port mapping that directs "router external" (your 6*** number) to "mac IP address internal port 22" , if your router is like most, you should be able to assign this external port to the Mac's IP on port 22.
If you have trouble with this please provide screen shots of your router configuration for the above so we can assist.
Regards
Edit: added extra info

VS 2013 kernel-mode driver debugging

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.

Not able to start novnc on Windows 2008 # port 80

I have started noVnc on windows using port 6080 and its working fine. Now I would like to start on port 80 and but script shows error on start.
"socket.error: [Errno 1] Operation not permitted"
I tried the following command: utils/launch.sh --listen 80 --vnc localhost:5900
Please let me know how can I fix it, I don't have any IIS installed on windows 2008 R2 machine.
Thanks,
Laxmilal Menaria
Ports less than 1024 are considered privileged so you must have administrative privilege when you run something that wants to use them.
See this answer about using runas.exe: How to run an application as "run as administrator" from the command prompt?

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.

Build automation, VMWare server 2.0, Final builder

I have a database in a VMWare Server 2.0 Virtual machine. I also have a web application in the IIS (7) in the VM.
Now I want to execute some database scripts that are in the VM, from the Host machine.
Also I have a VB script in the VM that I want to run from the Host machine.
How do I go about setting this up. I can buy Final builder if that will help me.
Since I am looking to automate the above from the Host machine, I was wondering what I would have to do to execute the database and the VB scripts that are in the VM, but execute them from the Host machine, so that these update the database and IIS (vb script thing) in the VM.
Thanks.
The easiest approach is to configure the VM with a network connection that is reachable from the host machine, and run the scripts across the network connection the same as you would if you had a physical machine instead of a virtual machine. If your goal is to keep the VM isolated from your existing network and servers, then you need merely configure a private network between the host and the guest, and use that. With this approach, you don't need any extra software.
I'd suggest to attach a host share as a network drive and then use vmrun. Here is an example:
vmrun -T server -h https://hostname:8333/sdk -u root -p mypassword -gu administrator -gp guestpaswd
runProgramInGuest "[Vol1] win2008-1/win2008-1.vmx" -activeWindow "c:\windows\system32\cmd.exe"
Surely, the VmWare Tools are to be installed.

Resources