Debugging Windows kernel on a Microsoft Azure platform virtual machine - windows

I want to connect WinDbg to the Windows Server kernel running on a Microsoft Azure platform VM to debug some drivers. I tried to follow the instructions on msdn to connect the debugger over the network, but it seems that requires that the target machine and the host are locate in one local network. What are the options, is it possible to do it at all?
I tried:
Setting Up Network Debugging of a Virtual Machine - KDNET

The problem is solved. It was necessary to add a new rule for the port used by the kernel debugger. This is done in the virtual machine settings in the "Network" section.

Related

Remote Debugging on a Virtual Windows Machine

I am trying to debug an app, using Visual Studio 2017, that I will run on a virtual machine I've set up on my development system. The virtual machine runs Windows 10 (as does my development system).
I've installed the latest VS 2017 Remote Tools package on the virtual machine, and configured it. It is happily running on the virtual machine...but I can't connect to it from the desktop system.
When I do an attach to process, and a Find to find the system, the virtual machine is found.
However, after selecting the virtual machine, I am prompted for credentials. I've tried using the same login credentials I use to log onto the virtual machine, but that doesn't work. And there's no information shown as to what might be the problem.
The virtual machine is running under Hyper-V.
How do I go about setting up a remote debugging connection to virtual machine running on the same system where I am running VS 2017?
I ran into the same issue and managed to get it working, after much effort.
First, try switching the debugger authentication mode to "No Authentication" (Tools -> Options) and setting your project in Visual Studio to match (see the language-specific links in the MS docs link below). That will help you determine if it is a credential issue or something else.
The microsoft docs say, "You can run the remote debugger under a user account that differs from the user account you are using on the Visual Studio computer, but you must add the different user account to the remote debugger's permissions."
In my case, I ran the same account on both machines AND added my account to the debugger's permissions, and it still didn't work. We use Azure AD, and I was using a domain account. My VS computer was on the domain, and the VM was not (even though I could sign in with a domain account). After adding the VM to the domain, I could connect with "Windows Authentication" enabled in the debugger settings.

How to deploy and debug wdk 8 kernel mode driver

I’m trying to set up automatic driver deployment and debugging to test a win 8.1 driver from Visual Studio 2013.
Host machine:
Win 7
VS2013
Target Machine:
Win 8.1
My host machine is set up with 2 network cards, 1 which connects to the corporate network and one spare. The target machine also has a network adapter.
My question is: is it possible to set up automatic deployment and debugging of drivers in Visual studio 2013 by connecting the host and target via a LAN whilst still being connected to the corporate domain and if not, is there a way of debugging wdk drivers on a target pc outside of visual studio, maybe via another application?
The documentation I found here only makes it seem possible by connecting to the same domain name or workgroup.
link to documentation
Many Thanks
Yes you can set up automatic deployment of the driver as well as getting visual studio to do the provisioning of the target pc over a local network as well as being connected to a corporate domain.
Admin rights are needed on the target
An extra ethernet card is needed in the host
All networks connections on the target are open with printer and file sharing options enabled
The ip and name of the target are listed in system32/etc/host in the host PC
A switch is needed and DHCP setting are enable with automatic IP
A good place to start:
https://msdn.microsoft.com/en-us/library/windows/hardware/gg507680.aspx
EDIT:
Basically, this was a nightmare and started dropping its connection. I reverted back to using WinDBG using:
custom scripts to copy everything over to USB
devcon to automactially load the driver
WinDBG to autoload appropriate settings on startup and load source files in to debug

VMnetwork adapter not detected in hyperv vitual machine

i have hyperV server running on which , i have just created a windows server 2008 virtual machine, where in that virtual machine network adapter is not detected. how to solve this problem.
#kaustubh93 Try installing a LEGACY network adapter. For machines as old as Win2K8 Server, the default network adapters may not work (did not for me), but installing a Legacy adapter did the trick.
This fix (using a Legacy adapter) worked this evening on a Windows 10 Pro installation running Hyper-V Client. I'd installed a Windows 7 Pro VM, but it wouldn't access the Internet via the Virtual Switch (external). Once I installed the legacy NIC, I had Internet access from within the VM.
Windows 2008 R2 is essentially Windows 7 anyway, so this solution is likely to work for you as well.
Jeff W.
Reading, PA
To add a network adapter
Open Hyper-V Manager. Click Start, point to Administrative Tools, and then click Hyper-V Manager.
In the results pane, under Virtual Machines, select the virtual machine that you want to configure.
In the Action pane, under the virtual machine name, click Settings.
In the navigation pane, click Add Hardware.
On the Add Hardware page, choose a network adapter or a legacy network adapter.
Click Add. The Network Adapter or Legacy Network Adapter page appears.
Under Network, select the virtual network you want to connect to.
If you want to configure a static MAC address or virtual LAN identifier, specify the numbers you want to use.
Click OK.
More : technet troubleshooting

Visual Studio 2012 Windows kernel debugging - can't provision VM target

Host: Visual Studio 2012, Windows 8 Host, WDK8
Target: VirtualBox - Windows 7
When I try to add the target computer (Driver -> Test -> Configure Computers) in Visual Studio (like at http://msdn.microsoft.com/en-us/library/windows/hardware/hh439359%28v=vs.85%29.aspx ):
I select "Provision Computer and choose debugger settings"
I choose to use a Serial connection
But the result is always "Could not find a host entry for Name of VM"
VS gives the same response if I try to connect through the network (I know kernel debugging from a Win8 host to a Win7 target isn't supported through the network).
I can't see a problem in the connection; connection without provision works after hitting Debug -> Break (otherwise, I hit a Waiting to reconnect... message).
Anyone get this working or has better idea on how to debug the Windows OS in VirtualBox?
You should not choose the debugger option to provision the target, as the debugger docs state that "Provisioning is not supported for virtual machines." (See this page: Provision a computer for driver deployment and testing.) This is most likely because provisioning requires network connectivity to the target, no matter how you choose to connect for the actual kernel debugging session.
As you've already observed, connection without provisioning works just fine, so you can just do that instead. Make sure you've properly attached the virtual serial port on the target to a host named pipe.
In any case, provisioning isn't strictly necessary to run the kernel debugger. It's just a convenience that automatically enables kernel debugging on the target, makes some other useful configuration changes, and installs a set of useful tools. You can see what provisioning does on this page: What happens when you provision a computer?
Here is some general guidance on setting up kernel debugging of a VM: Setting Up Kernel-Mode Debugging of a a Virtual Machine in Visual Studio
This link Kernel-Mode Debugging in a VM using Visual Studio 2012describes how to provision to virtual machine. You will need to configure network in a way that host and guest can ping each other.
After that you need to update "hosts" on both computers(add ip and NetBIOS of guest to host "hosts" file and ip and NetBIOS of host to guest "hosts" file).

Hyper V to Virtual PC

I am currently using Windows Server 2008 Standard and have several Hyper V machines. These are development VM's and I want to now switch back Vista x64 because I am missing Aero.
I know Windows Server 2008 can have aero but the host performance is very very bad when I run VM in Hyper V.
I want to export my Hyper V machines so that I can use it in Virtual PC. Anyone know an easy way?
If you have built them as Hyper-V machines, I don't think you can go back. There are serious differences in the HAL for Virtual PC and Hyper-V. You can move a VPC to Hyper-V permanantly by removing the VPC add-ins ans adding the Hyper-V integration drivers/services and re-detecting the hardware.
A VPC can run in Hyper-V just fine, don't add the machine drivers for Hyper-V and you can go back to VPC with no problem.
VPC to Hyper-V is one way.
Hyper-V is designed to be used on the server, obviously. Whereas VirtualPC is designed for the end user. Hyper-V will give you more control, and the ability to create and restore snapshots. However, it does not have a direct console interface to the VM, you would use a browser to access the console. I would go Hyper-V, but it really depends on what you're using your VMs for. Luckily, they share the same format for virtual disks, so you can try it out with your existing VMs.
You should review Windows 2008 R2 SP1 upgrade with RemoteFX, it comes with a new video driver for VM's that allow 3D, extended desktops and more. It will help resolve some of the issues you are seeing today.
Both the Host server and VM need to be running SP1 of Windows 2008 R2.
http://blogs.technet.com/b/virtualization/archive/2010/03/18/explaining-microsoft-remotefx.aspx

Resources