3

Windows Server 2012r2 running Hyper-V with a WinXP 32-bit VM. There is a particular application that will only run on WinXP that uses a serial connector to interface with an old diesel governor.

I have researched on how to pipe COM ports between guest and host but I am either doing it wrong or I am not understanding the capabilities.

Among other resources:

https://social.technet.microsoft.com/Forums/windowsserver/en-US/171143f5-716b-4c4b-8f2b-ad05bf7fd147/attaching-serial-ports-to-hyperv-?forum=winserverhyperv

https://charbelnemnom.com/2014/10/hyper-v-enhanced-session-mode-show-options-issue-hyperv/

https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/learn-more/use-local-resources-on-hyper-v-virtual-machine-with-vmconnect

Integration tools are installed Enhanced Mode is enabled for machine and users

On the host in powershell entered:

[System.IO.Directory]::GetFiles("\\.\\pipe\\")

and it returned with \\.\pipe\\COM3 for my USB to serial adapter. In Hyper-V on the XP guest I edited the COM1 Serial Port setting by selecting Named Pipe and in the pipe name field entered \COM3 this caused the Named pipe path: field to display \\.\pipe\\COM3

I then connected the serial cable to the port ran Putty on the guest as admin and nothing displays, there is no interaction. I ran Putty as admin on the host and I am able to connect.

I am convinced the issue is somewhere in the "piping" of the two interfaces but do not know how to troubleshoot further. I am not certain it makes a difference that the host connection is USB to serial and that is causing an issue integrating with the guest. Any help would be appreciated. I will be monitoring this thread closely so should be able to provide additional requested info in a timely manner.

Thank you in advance!

HelicanV
  • 31
  • 1
  • 1
  • 2
  • just for grins, have you tried renaming the pipe on your vm to leave off the leading slash? – sippybear Jan 24 '18 at 20:21
  • also, does the guest return any result for this query? `[System.IO.Directory]::GetFiles("\\.\\pipe\\").Contains("\\.\\pipe\\COM3")` – sippybear Jan 24 '18 at 20:42
  • Sorry for the delay, had to find a pile of XP updates to run before I could get Powershell installed. I ran the command you requested and the it errored on `.Contains` so on the guest I ran `[System.IO.Directory]::GetFiles("\\.\\pipe\\")` and no pipe was listed with either COM1 or COM3 in the name. I changed the Host config from `\COM3` to `COM3` reran the command and still nothing listed – HelicanV Jan 25 '18 at 15:25
  • if you log into the server and run `vmconnect /edit` under *Local Resources* > *More...* does your usb/serial device show up under *Other supported Plug and Play (PnP)* devices? – sippybear Jan 25 '18 at 19:58

1 Answers1

2

Hyper-V provides data from a named pipe into the VM as a COM port. It does not connect that named pipe to the host's COM port, which is what you would need to pass the data through to your VM.

I wrote a Windows program that runs on the host OS and provides a link between the host COM port and the named pipe, allowing you to use the host COM port from your Ubuntu VM.

You need to run this as an admin user.

https://github.com/tdhoward/COMpipe