I am working on some pre-logon code for Windows 7 and would like to be able to debug it (at least to see how it works, since the Microsoft documentation is terrible).
My environment is VirtualBox on a Linux host with three Windows virtual machines (Windows 2008 domain controller, Windows 7 dev machine and Windows 7 test machine), and I would like to be able to debug the process of starting the test machine remotely from the development machine using a virtual serial connection of two virtual machines.
[I have in another life debugged Linux kernel drivers in one Linux machine from another that uses a VMware workstation on a Windows host, so I know that such a thing is potentially possible.]
I saw people using windbg to debug Windows in a virtual virtual machine from the host, but I need to do this from the second guest (because my host is not Windows). Has anyone figured out how to do this?
Edit: Before I sent the message, I tried to make an obvious approach. I created a virtual serial port in each configuration of the virtual machine and linked them to the same hosting, which must be created by dev VM (debugger) and used by test VM (debugee). Then i ran
bcdedit /dbgsettings serial debugport:1 baudrate:115200 bcdedit /debug {current} on
in the test VM and turn it off. Ran windbg in dev VM chose kernel debugging (on the correct serial port) and restarted the test virtual machine. There were some reports that they did not have characters available, and the test VM was hanging.
Since then I found this article: http://www.benjaminhumphrey.co.uk/remote-kernel-debugging-windbg-virtualbox/ , which (although this guy uses a Windows host) seems to accurately describe the method I'd tried but his test VM does not hang. The result that I get in the wndbg window is the same as itβs, but it stops before the line looks "Windows XP kernel ..."
Now I'm not sure if this problem is related to VirtualBox and is more unsure whether I am using windbg correctly. Any help would be appreciated.
Other Editing . I tried to connect the virtual serial port of the test virtual machine to the host file, and I received some debug output in the file. I tried installing the virtual serial ports of the two virtual machines to point to the host channel and run the terminal (and not WinDbg) in the Dev VM, and I get debugging information in the terminal.
I think that now I decided that this is definitely a problem with WinDbg and not with VirtualBox (I will remove the virtualbox tag and replace it with windbg), but I'm not sure why WinDbg is not talking.
Additional Information: I just updated the Update to VirtualBox 4.2.4 (not sure if the version matters) and looked at it again.
I rebuilt the test virtual machine and became more patient!
Now it seems that the test VM is working - and in the end I get some result in the windbg window, but it takes about 15 minutes to start the debuggee OS! This is clearly not useful for daily kernel debugging. I have no idea why this should be so slow ... there is no noticeable slowdown if I run a simple terminal in dev VM instead of windbg (although, of course, debugging information is mostly garbage).
Any ideas?