VirtualBox Serial Debugging on Windows

This tutorial uses VirtualBox version 4.2.6. You can set Port Mode as either Host Pipe Mode or Raw File Mode when serial debugging with VirtualBox.

With Raw File Mode, you can easily and quickly save the debugged onto a .txt file whereas it might be rather difficult for to check out the content of debugging real time. When it comes to Host Pipe Mode, it’s a little more complicated than the Raw File Mode, but you can confirm what is being debugged real time. The results made by the two modes differ little from each other, so we recommend you employ a relatively simpler way: Raw File Mode.

Serial Debugging using a Raw File

1. Run VirtualBox. Select your haiku image then click settings. Select Serial ports. Tick the tickbox "Enable Serial port". Change Port Mode to "Raw File". Then set the name and directory of the file to be saved in File Path.

And click start (virtual machine) or double click your Haiku image. 2. Once you open the file on the designated path, you can make sure it has been debugged.

Serial Debugging using Host pipe

HyperTerminal and VMWareGateway Method

  1. First of all, you need vmwaregateway.exe (you can find that here) Move the downloaded file to the directory you want.

  2. Start Command Prompt by pressing WinŠž+R and enter “cmd”. Then drag and drop vmwaregateway.exe onto cmd with the mouse. Then add “/t” before pushing the Enter button on your keyboard.

C:\Documents and Settings\me>"C:\where\vmware\gateway\is\vmwaregateway.exe" /t

test mode - press Ctrl+c to stop program
  1. Run HyperTerminal. If your OS is Windows XP, you can find it here: Start>Programs>Accessories>Communications>HyperTerminal

However if you are running Windows vista, Windows 7, and Windows 8, then sadly HyperTerminal is not included as a bundled application like XP had. These later versions of windows do have software we can use, but it is not at all user friendly, rather you should just download HyperTerminal from here and follow the directions given. If you run HyperTerminal, it will ask you to create a new connection, pick a name and icon. Click OK.

After it will ask you what you are connecting with, change it to “TCP/IP(winsock)“ Change the host address to “localhost” and change the port number to “567”, click OK again.

If it can’t connect, vmwaregateway.exe isn’t running in Command Prompt properly.

Command Prompt should now read:

C:\Documents and Settings\me>

C:\Documents and Settings\me>"C:\where\vmware\gateway\is\vmwaregateway.exe" /t

test mode - press Ctrl+c to stop program incoming telnet request accepted
  1. Run Virtualbox. Select your Haiku image then click settings. Select Serial ports. Tick the tickbox “Enable Serial port” and for Port Number tick “COM1”(Because Haiku by default writes debug information to the COM1 port)

Change Port mode to “host pipe” and change the port path to: \.\pipe\vmwaredebug and click OK

When you start your VM, it will now be debugging onto HyperTerminal.

PuTTY Method

A simpler way is to use PuTTY Telnet, which can read VirtualBox’s fake serial port pipe directly without the need for vmwaregateway.exe. You can get Putty from the author’s site at http://www.chiark.greenend.org.uk/~sgtatham/putty/


[PuTTY Settings for displaying a Pipe as a Serial Port]

The trick is to use Serial mode, and replace the COM1 with \.\pipe\vmwaredebug or whatever you called the pipe in the VirtualBox serial settings.  There are additional serial settings near the end of the preferences where you can set the baud rate to 115200, turn off handshaking and use 8N1 bits.

Then fire up VirtualBox, and once it is running your VM, the pipe will exist and you can start up PuTTY.

Configure Haiku

If you are to control the output port and speed, you should do it with Haiku.

Run Haiku on VirtualBox Open the file /boot/home/config/settings/kernel/drivers/kernel.

  1. To revise Output Port,
#serial_debug_port num

Turn “num” into any figure you want. Default setting is 0 (COM1).

  1. To change Transmission speed,
#serial_debug_speed values

Change values. Values available are <9600|19200|38400|57600|115200> with the default being 115200. Turn “num” into any figure you want. Default setting is 0 (COM1).