VirtualBox VM failing to start with virtual serial port

I recently needed to emulate an RS232 serial port in a Linux guest VM running in VirtualBox on Windows 7.

Specifically I needed to map the virtual serial port to a TCP network port.


This didn’t work as expected. When the serial port was enabled the virtual machine crashed immediately on startup with this message:

The instruction at 0xcdcfdcab referenced memory at 0x00000018.
The memory could not be read.

Click on OK to terminate the program
Click on CANCEL to debug the program


Followed by another message:

Failed to open a session for the virtual machine PM Devel.

The VM session was aborted.

Result Code: E_FAIL (0x80004005)
Component:   SessionMachine
Interface:   ISession {7844aa05-b02e-4cdd-a04f-ade4a762e6b7}


I checked for problem causes using Event Viewer, VBox.log, Process Monitor, Procdump and WinDbg. Unfortunately none of these revealed the cause.


I rechecked the settings and noticed: Connect to existing pipe/socket

This was checked by default. Tried unchecking the setting.


This solved the problem.

The virtual machine could start normally and communication between the virtual RS232 serial port and the TCP network port worked.

Be aware that a VirtualBox VM may also crash on shutdown in a similar way, if the TCP port is still connected.