Serial Port emulation/virtualization for Windows XP host

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
ipatch
Posts: 14
Joined: 19. Dec 2009, 01:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: XP, lfs 6.5
Contact:

Serial Port emulation/virtualization for Windows XP host

Post by ipatch »

I did some googlefu about this topic last night before I caught some zzz's and didn't really see a thorough answer. I have a Mac Book Pro which has not serial ports on it. I am trying to use Hyperterminal in Windows XP guest OS to access the USB device. Is this even possible using virtualbox? I saw a serial ports tab within the Settings window for the virtual machine. There is a check box for serial ports within the serial ports tab, but since my host machine does not have any serial ports I am confused as to how my guest OS, Windows XP, is going to see/find the serial port.

Is it possible to setup a pseudo/dummy serial port in OS X so virtual box can use this device to simulate a COM/serial port in Windows XP? Below is a picture I took from the virtual box settings tab of the guest OS (Windows XP). In the Port/File Path: text area would I specify the path to the virtual serial port created in OS X?

Image
cheers
-Chris
hephaestus
Posts: 5
Joined: 1. Apr 2011, 18:08
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: Windows XP

Re: Serial Port emulation/virtualization for Windows XP host

Post by hephaestus »

Disappointing to see no replies to this post. I have a similar problem, so bumping the thread and hoping for some response.

Particulars of my situation:
  • Host: MacBook Pro running OS X 10.5.8 and VirtualBox OSE 4.0.4
  • Guest: Windows XP Pro SP 2
  • Peripheral: USB-to-Serial converter cable (using the pl2303 driver) connected to a Tracker2 TNC (packet radio modem)
I know that the cable+driver combination work on the host, because I can connect to the TNC using the "screen" VT100 terminal emulator application, type commands at it, and get good responses back.

The packet radio applications I intend to run under WinXP want to communicate with the TNC via a COM port, so in VirtualBox's "Machine->Settings..." dialog, "Ports" tab, "Serial Ports" sub-tab, "Port 1" sub-sub-tab, I select the following:
  • Enable Serial Port: checked
  • Port Number: COM1
  • IRQ: 4
  • I/O Port: 0x3F8
  • Port Mode: Host Device
  • Create Pipe: unchecked
  • Port File/Path: /dev/tty.PL2303-0000101D (the device node that appears when I plug in the USB-to-Serial cable)
Seems straightforward enough. But when I try to start my WinXP VM, the "Starting virtual machine ..." dropdown appears in the VM window, with no progress shown in the progress bar. Then a few seconds later, a notifier pops up over the VirtualBox window, with the caption "Starting virtual machine ... (2/2)" and a progress bar that (to my eye) appears to be stuck at about 20%. The last entry in the log file is "00:00:00.858 Serial#0: emulating 16550A", and nothing that looks like an error indication.

Trying to start up the VM with the USB-to-serial device unplugged doesn't work: it fails with the following messages at the end of the log:

Code: Select all

00:00:01.215 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={515e8e8d-f932-
4d8e-9f32-79a52aead882} aComponent={Console} aText={Failed to open host device '/dev/tty.PL2303-0000101D' (VERR_FILE_NOT_FOUND).
00:00:01.215 Unknown error creating VM (VERR_FILE_NOT_FOUND)}, preserve=false
00:00:01.290 Power up failed (vrc=VERR_FILE_NOT_FOUND, rc=NS_ERROR_FAILURE (0X80004005))
(Of course, I can uncheck the "Enable Serial Port" checkbox and start up successfully, but then I have no way re-enabling the serial port once the VM is up and running... :? )

So, come on, someone... what am I doing wrong?

Thanks,

Michael
ipatch
Posts: 14
Joined: 19. Dec 2009, 01:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: XP, lfs 6.5
Contact:

Re: Serial Port emulation/virtualization for Windows XP host

Post by ipatch »

Michael it appears you have put a bit more work into this topic than I have. I hope you are able to achieve success with what you are doing, and if you do reach a solution please feel free to update this thread with your solution.
cheers
-Chris
hephaestus
Posts: 5
Joined: 1. Apr 2011, 18:08
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: Windows XP

Re: Serial Port emulation/virtualization for Windows XP host

Post by hephaestus »

Okay, some progress. Well, not "progress" exactly... more like an additional data point.

I noticed that when I plug in the USB-to-Serial converter, I actually get two device nodes in /dev :
  • /dev/cu.PL2303-0000101D
  • /dev/tty.PL2302-0000101D
I googled "tty vs cu" and came up with this article, which led me to think that I should try mapping COM1: to the "cu" aspect of the device instead of the "tty" aspect. So I did that, and lo and behold, the VM started up and booted Win XP successfully. :D However, when I went to the Device Manager to look for COM1:, it wasn't there. :(

I'm in no way a "Windows Guy," so I have no idea whether there's something I need to do in Windows to create the COM1: device node. There was an option in the Device Manager (I think) that searches for new hardware (??), but it didn't come up with anything when I tried it.

I also looked at the VM log and I didn't see anything obviously amiss as the VM was coming up. In fact, it all looked very consistent with what I would expect:

Code: Select all

00:00:04.384 [/Devices/serial/] (level 2)
00:00:04.384 
00:00:04.384 [/Devices/serial/0/] (level 3)
00:00:04.384 
00:00:04.384 [/Devices/serial/0/Config/] (level 4)
00:00:04.384   IOBase <integer> = 0x00000000000003f8 (1016)
00:00:04.384   IRQ    <integer> = 0x0000000000000004 (4)
00:00:04.384 
00:00:04.384 [/Devices/serial/0/LUN#0/] (level 4)
00:00:04.384   Driver <string>  = "Host Serial" (cb=12)
00:00:04.384 
00:00:04.384 [/Devices/serial/0/LUN#0/Config/] (level 5)
00:00:04.384   DevicePath <string>  = "/dev/cu.PL2303-0000101D" (cb=24)
And farther down the log: "00:00:06.244 Serial#0: emulating 16550A" (but this time with a lot of other log messages after it). No other relevant mentions of "serial" in the log besides these.

So, anyone have any good suggestions on what I can try next?

Michael
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Serial Port emulation/virtualization for Windows XP host

Post by Perryg »

Windows usually does not auto-detect the com port. You more than likely will need to manually add in from the control panel.
hephaestus
Posts: 5
Joined: 1. Apr 2011, 18:08
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: Windows XP

Re: Serial Port emulation/virtualization for Windows XP host

Post by hephaestus »

Windows usually does not auto-detect the com post. You more than likely will need to manually add in from the control panel.
I'm really such a Windows n00b that I thought I would probably need some guidance/documentation on how to do this, but I seem to have found my way through it. Here's what I did (including the blind alleys).

In the "Device Manager" tab of "System" there wasn't any obvious option for adding ports -- you can "change settings" of things that are already there, but you can't add anything.

The only other likely choice was "Add Hardware." Upon starting the "Add Hardware Wizard," it does a scan and then asks "Have you already connected this hardware to your computer?" Answering "no" would put me on a short path to terminating the wizard so I can "connect the hardware to the computer," so I answer "yes." The wizard then shows me a list of the devices it thinks are installed. "Serial port" isn't among the choices, so I choose "Add a new hardware device."

The next choice is between "Search for and install the hardware automatically (Recommended)" and "Install the hardware that I manually select from a list (Advanced)." I choose the former (not really believing that it will work), and voila, it finds COM1:

So, yay! (And the icing on the cake is that I was able to connect to the TNC using PuTTY, at least once I figured out that I needed to select the "Connection Type" to "Serial" in the main PuTTY confguration panel... duur... :roll: )

So, ipatch/Chris: I think we may know enough now to get you talking to your peripheral from XP. First of all, are you able to talk to your USB-connected peripheral from the host OS (using a terminal emulator like "screen"), with VirtualBox not running? If so, what device node(s) show up in your /dev directory when you plug in the USB device? If you have a device node that looks like "/dev/cu.<your-usb-device's-driver>", that's probably what you want to put into the "Port/File Path" box. And of course you'd want the "Port Mode" to be "Host Device" instead of "Host Pipe," which was what you had in the original post.

Michael
MichaelS
Posts: 2
Joined: 20. Mar 2012, 13:10

Re: Serial Port emulation/virtualization for Windows XP host

Post by MichaelS »

This was a great help for many !!!! Many, many thanks :D :D :D Using /dev/cu.usbserial as device path was the winning step
Post Reply