--- VirtualBox-2.1.0/src/VBox/Devices/Serial/DrvHostSerial.cpp.original	2008-12-13 22:59:56.000000000 +0100
+++ VirtualBox-2.1.0/src/VBox/Devices/Serial/DrvHostSerial.cpp	2009-02-13 07:22:43.000000000 +0100
@@ -40,6 +40,7 @@
 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)
 # include <errno.h>
 # include <termios.h>
+# include <linux/serial.h>
 # include <sys/types.h>
 # include <fcntl.h>
 # include <string.h>
@@ -242,6 +243,7 @@
     PDRVHOSTSERIAL pThis = PDMICHAR_2_DRVHOSTSERIAL(pInterface);
 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)
     struct termios *termiosSetup;
+    struct serial_struct *serialStruct;
     int baud_rate;
 #elif defined(RT_OS_WINDOWS)
     LPDCB comSetup;
@@ -308,7 +310,17 @@
             baud_rate = B115200;
             break;
         default:
-            baud_rate = B9600;
+            /* non-standard baud rate handling */
+            serialStruct = (struct serial_struct *)RTMemTmpAllocZ(sizeof(struct serial_struct));
+            ioctl(pThis->DeviceFile, TIOCGSERIAL, serialStruct);
+            serialStruct->custom_divisor = serialStruct->baud_base / Bps;
+            if (!(serialStruct->custom_divisor))
+                serialStruct->custom_divisor = 1;
+            serialStruct->flags &= ~ASYNC_SPD_MASK;
+            serialStruct->flags |= ASYNC_SPD_CUST;
+            ioctl(pThis->DeviceFile, TIOCSSERIAL, serialStruct);
+            RTMemTmpFree(serialStruct);
+            baud_rate = B38400;
     }
 
     cfsetispeed(termiosSetup, baud_rate);

