views:

935

answers:

2

I'm writing an application that communicates with the serial port to control a device. The development environment is on a virtualized Windows 2003 R2 machine hosted on a Windows Vista machine. When I try to map the COM ports through virtual PC so they can be use in the virtual machine, I get the following error right after the machine begins to boot:

There was an error trying to open the following COM port on your physical computer: \.\COM2 Before this port can be connected to your virtual machine you must verify that a device is attached to the port and that it is not being use by another process.

I've tried remapping the serial port to different ports on the virtual machine and also tried changing the port configuration on the host... No dice...

I'm not 100% certain that the serial ports are working correctly, but I'm not sure how to test them short of writing an application to do so. Any help would be much appreciated.

Thanks very much!

+1  A: 

I'm not sure how to test them short of writing an application to do so.

There used to be a program called HyperTerminal, for opening serial ports and for interatively sending/receiving data through an opened port. This program doesn't ship anymore with Vista, but this article suggests you can jut goo and find a copy on the net and use it.

Searches like http://www.google.ca/search?hl=en&q=device+manager+serial+port suggest that if you have a serial port then you should see it in Device Manager. If you don't have a serial port, you might need to enable it in your BIOS. Note that a serial port that's being used by a mouse will not show up as a serial port. If COM1 doesn't exist on your computer, try others like COM1.

ChrisW
+1  A: 

Thanks for the quick response, Chris. I think I have it figured out. As it turns out, you apparently have to have a device connected to the mapped COM port in order for the VM to successfully use the port. I did end up writing a quick app to test the ports and found it on the host system. I then took that knowledge and mapped that port (and only that port) to the VM... Viola! It works!

Matt Ruwe