Use a Keyspan USB-to-Serial adapter with Virtual Box
Jul 29, '08 07:30:03AM
Contributed by: caver01
Sun's VirtualBox is a slick new virtualization alternative to VMWare Fusion, Parallels, and the like. For some of us, we not only need to run a Windows app, but that app requires a connection to a serial device. Here's what I did just now to get my Keyspan USA-19HS USB-to-Serial adapter working in VirtualBox under Windows XP:
- Windows XP installed without a hitch, but it had no COM ports set up. It turns out that I hadn't turned them on in VirtualBox, so I did that.
- Installed the Keyspan drivers on my Mac (Leopard, 10.5.4).
- Downloaded SerialClient, the excellent app that seems to make this work.
- Attached the Keyspan adapter.
- In XP, I went into the Add Hardware wizard, and scrolled down to the bottom to add hardware I pick from a list. Basically, I wanted to force XP to set up an item in Device Manager for a COM port. The device was created, but for some reason, it ended up being a COM3, IRQ4, at address 3F8 (this is important in a moment).
- In VirtualBox, I then edited Serial Ports in the Settings area of my virtual machine. After enabling Port 1, I set the Port Number drop-down to User-defined, and set it to IRQ 4, 3F8 as above. Port Mode is Host Pipe. Finally, put a checkmark in the box labeled Create Pipe, and enter path of /tmp/serial without the quotes. Click OK to exit.
- Now, finally, run the SerialClient software downloaded above. Make the stream path /tmp/serial, just as above. Select your serial port KeySerial1. Baud Rade is 115200 and defaults on the rest.
- Restart Windows XP, and while it's coming up, go ahead and click Conncect in SerialClient.
Windows now seems just fine with the COM3 I created -- there's no yellow "!" in device manager, and the Keyspan adapter LED is solid green. I then tested the adapter in my windows app and indeed, the serial connection is working! I am using Windows XP Pro as my guest OS, so, unless you are set up the same, the exact steps may differ somewhat.
[robg adds: This same method (or a slight variant of it) should work using Parallels Desktop and VMware Fusion. VirtualBox is a very good (and free!) virtualization solution for OS X; I gave a brief overview of its abilities in my most-recent Macworld video.]
Comments (3)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20080724181208823