VirtualBox

Ticket #1548 (new defect)

Opened 2 years ago

Last modified 6 months ago

Missing characters using serial port.

Reported by: Teuniz Assigned to:
Priority: major Component: uart
Version: VirtualBox 2.1.4 Keywords: Serial port
Cc: Guest type: other
Host type: other

Description

When I use the serial port in Windows XP on a Linux host, I miss characters during receiving. Serial port params are 115K2 8N1 (no flowcontrol).

This happens when an external hardware device is sending a continues datastream to the serial port at the highest baudrate (115K2). It looks likes Virtualbox is not able to handle all the data in time (empty the receivebuffer). When I use a native Linux application to receive the same data at the same baudrate without flowcontrol, no characters are missing. When I use Windows XP without virtualizing, there are no missing characters. The host is OpenSUSE 10.3.

Change History

2008-08-13 09:14:08 changed by frank

  • owner changed.
  • component changed from other to uart.

2009-04-06 18:15:51 changed by TKreuzer

See also #3636 (sorry for duplicate report, maybe someone can mark it as duplicate)

2009-04-07 08:56:36 changed by attoparsec

  • version changed from VirtualBox 1.6.0 to VirtualBox 2.1.4.

2009-04-07 14:10:40 changed by TKreuzer

As described in bug 3636 I get the problems on Windows XP host (AMD64 x2). This also prevents me from connecting WinDbg? to windows running in the VM using a pipe. As a workaround I installed com0com, a virtual com port NULL-modem. It works great and also allows me to connect WinDbg? to Windows running in VBox.

2009-04-17 11:29:39 changed by fvichot

I was about to file a bug report for exactly that error. In my case, vbox also loses characters when a lot of text is send through the serial port.

My setup for testing is quite simple: using a linux host and a linux guest, I run "cat somefile > /dev/ttyS0" in the guest and "socat /tmp/vbox-pipe - > thefile", /dev/ttyS0 being the virtualized serial port in the guest, and /tmp/vbox-pipe the named socket in which vbox redirects the serial port from the guest. Well after transferring a 2Mbytes file that way (base64 encoded so no risk of control characters interfering), only 1.3Mb made it to the host socket... This works fine using KVM/Qemu.

I only describe my methodology for testing from native linux to virtualized linux, but any combination of linux and windows gives the same results: characters are lost.

I would like to stress that this is very annoying, and I've been obliged to code a small protocol over the serial port connection to do error checking and resend frames that didn't get through properly. This is a pretty costly workaround in terms of man hours... Judging from the forum thread at: http://forums.virtualbox.org/viewtopic.php?f=1&t=15761&p=67774 , I'm hardly the only one, so this is a real problem. I insist because I've been following this bug for a while, and nothing has happened in over a year.

If you need me to do more testing, I'd be happy to.

2009-05-18 01:32:46 changed by Kelledin

I'm seeing the same problem in VBox 2.2.2 (PEUL build), with a Linux guest ttyS0 connected to a local socket on a Centos 5.2 host. Essentially large swatches of serial output (several sequential lines of text, with or without control characters) seem to get randomly dropped.

This is especially annoying, as I'm trying to use VB to set up an automated unit-test for an OS installation process that uses the serial port as the default system console. In fact, this is my primary use-case for proposing VirtualBox as an alternative to a certain nameless but rather popular virtualization package. ;-)

The serial port settings in this case are 19200-8-n-1, which closely matches what our real systems deploy with. I can try it with flow control turned on from the guest side, although that would be deviating from real hardware's standard config.

2009-05-18 11:53:52 changed by frank

I assume the correct fix would be to implement buffering which is supported by the 16550. We are currently provide a 16450 emulation. Moving to the 16550 is on our TODO list.

2009-05-19 00:18:24 changed by Kelledin

I just tried again, with 9600 and 19200, with CTS/RTS flow control both on and off. If anything, dropping the baud rate or adding flow control seems to make things even worse. I'm experimentally cranking the baud rate up to 57600 to see if that somehow improves things, but I don't have high hopes.

2009-05-19 18:44:29 changed by Kelledin

Well, higher speeds haven't worked too well either. I'd have to write off the serial port emulation as virtually useless in the state it's in now.

I'm delving into the code to see what it will take to get robust 16550 emulation going.

2009-05-24 19:58:14 changed by jkeil2

I think I observe the same problem on an OpenSolaris? host and VirtualBox 2.2.2, when trying to use the kernel debugger in an OpenSolaris? guest on the virtual serial port console (and a "socat" binary on the host to get at the serial port data). In most of kmdb's output lots of stuff is missing and is lost.

2009-06-02 16:17:09 changed by nitingupta

I'm having similar problem with raw file as serial output. Originally reported in #1023.

The serial output in raw file is garbled when guest logs out at a fast rate (VirtualBox 2.2.4 r47978) Guest: Fedora 10 (kernel: 2.6.29.4-75.fc10.x86_64) Host: Fedora 10 (kernel: 2.6.29.3-60.fc10.x86_64)

Grub command line: console=tty0 console=ttyS0 Also, tried: console=tty0 console=ttyS0,115200

© 2009 Sun Microsystems, Inc.
ContactPrivacy policy