The Easy Guide
It's really hard figuring out how to make those mythical debug logs the devs keep asking for, so I decided to write a (hopefully!) easy to follow guide. (Sticky it if you think it's worth it.) Note that I'm using 64-bit Windows 7 and haven't tested with other Windows versions. The steps should be very similar for Vista and later. Earlier versions of Windows likely won't have to fight with getting unsigned drivers to install. This tutorial assumes you have some experience with using VirtualBox. While this guide is written specifically for Windows, the overall idea should be the same for Linux etc (just make sure to name your ports correctly).
Please also note that I'm typing this up after I have tried several things to make it all work. I may have inadvertently included an extra step or omitted a necessary step because of that. If you encounter problems, let me know and I'll update this post.
Overview
VirtualBox can send debug output to a COM port. PuTTY can listen to a COM port and write it to file. All we need is a "bridge" between the two and you've got your debug logs!
Software You'll Need
VirtualBox - you can use another VM but I have never used anything else and this tutorial is written specifically for VirtualBox.
A ReactOS Debug build. It'll be named something like "bootcd-#####-dbg.7z" or "bootcd-#####-dbgwin.7z". You MUST use a Debug build. You will also need 7-Zip to get the ReactOS ISO out of the .7z file.
PuTTY - This is the program that creates the debug logs. If you don't know what you're looking for, get the "For Windows on Intel x86" putty.exe file. It doesn't need to be installed; you just have to know where you downloaded it to.
com0com - This is our VirtualBox/PuTTY bridge. Very important. Install it. It gives you the option to have 2 COM port pairs, but you really only need 1 COM port pair. It's your choice. We're going to use Virtual Port Pair 0. You can rename them if you like by running com0com's setupg.exe (I use COM4 and COM5) but it really doesn't matter. You may have trouble installing its unsigned drivers, which brings us to...
Installing Unsigned Drivers on Windows Vista / 7 / etc
Again, earlier versions of Windows may not have this problem at all or may need to take different steps to make this work. I'll update this notice if anyone can provide me good feedback.
Windows Vista, 7, etc users will need to grab Driver Signature Enforcement Overrider. Run it (give it Admin privileges) then click the following buttons:
- Yes
- Next
- Enable Test Mode & Next
- OK
- Sign a System File & Next
Now Enter com0com's driver file. It'll be something like C:\Windows\system32\DRIVERS\com0com.sys
- OK
Now reboot your computer. You'll know it's working when your Device Manager shows 3 working drivers under "com0com - serial port emulators". You'll have 2 of "com0com - serial port emulator" and a third driver which for me is called "com0com - bus for serial port pair emulator 0 (COM4 <-> COM5)". Whatever name you gave the ports is what shows up in the driver's name. If you installed 2 port pairs instead of 1 port pair, you may see more com0com driver entries.
Configuring VirtualBox
Open up VirtualBox and select the virtual machine you want to test (again it MUST be a Debug build of ReactOS). Go to Settings -> Serial Ports -> Port 1. Check Enable Port 1. Make sure Port Number is set to COM1. No matter what you called your com0com ports, use COM1 here. For Port Mode choose Host Device. For Port File/Path type in the name of one of your com0com (virtual pair 0) ports. I use COM5. That's all there is to it for VirtualBox.
Configuring PuTTY
Open PuTTY. Make sure Session is selected on the TreeView on the left. In the main part of the window, under Connection Type, choose Serial. Under Serial Line type the name of your other com0com (virtual pair 0) port. I use COM4. Under speed, type 115200. Go to the TreeView on the left and click on Logging under Session. Under Session Logging, choose "All session output". Log file name indicates where the debug log will be and what it will be called. Use the Browse button to change the location if you like, but make sure you know where it's being saved! Go back to the TreeView on the left and click on Serial (under Connection). Set Flow Control to None. PuTTY is now configured. Note that on the main page of PuTTY you can Save/Load configurations which makes it even easier!
Getting that Debug Log
Finally! In PuTTY click on Open at the bottom of the window. This activates PuTTY's magical debug-log-creating abilities, which is a black window with a flashing green cursor. Open up VirtualBox and start your Debug ReactOS build. Make sure you choose the "ReactOS (debug)" option at boot! If you can see your PuTTY window in the background, you'll see lots of text flying past as PuTTY does its thing. When you've finished making ReactOS (or whatever it was you were aiming for), you'll have your debug log that is so coveted by the devs! Stick it in a bug report, upload it to the forum, mail it to your aunt, whatever. You've got your debug log!
One Last Thing
If you're going to run VirtualBox without PuTTY, make sure you disable Serial Port 1 again. VirtualBox (or ROS) does not like to have an open port if there's nothing to receive the data. It frequently results in BSOD or outright failure to boot.