• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2260
  • Last Modified:

Can I connect two VMs via a serial port?

Hi,
 
   I have two legacy applications that communicate via Serial port.  Is it possible to have two VMs on the same physical machine connect via a virtual serial port in VMWare?  If so, how do I do this?

Thanks!
0
pbenito
Asked:
pbenito
1 Solution
 
QlemoC++ DeveloperCommented:
AFAIK you can only map a physical serial port into the VM. So you need to physical serial ports, connected together, and one assigned to each VM.
0
 
SagiEDocCommented:
You simply edit the VM configuration and add a serial port. You will need to add rules to prevent these two connected VM's from migrating to other hosts, or you will need to add a connecting cable to each host and add a rule that these two VM's must always be kept on the same host.
0
 
pbenitoAuthor Commented:
Ok, but is this possible in VMWare....and if so, how is it done?
0
 
easyDKCommented:
I¨m not sure, but VMWare server allowed to work also with named pipes. Try this one:

Steps involved:
Create the serial ports within the VM
Start the VM
Connect to the Special File on the VM host
----

Create the serial ports within the VM

1. With your virtual machine stopped and using the GUI vmware console click on the "add hardware" button
2. Add a serial port with the following parameters
* Connect at Power On: checked
* Use Named Pipe
* Output file is ./serial1
* This end is the server
* The other end is an application
3. You may want to add a second serial port now.

Note: At this point you have told vmware to create the file ./serial1 in the directory containing the other files for this VM. This file won't be created until you start the VM the next time.

Start the VM

1. Start the VM. As soon as the VM reaches the BIOS prompt it will have created the special file ./serial1 on the VMware host machine.

Connect to the Special File

VMWare calls this a "Named Pipe", but it's actually a Unix Domain Socket. A named pipe can be opened as a file, but a UDS cannot. Instead, I use this hackish command to get to the UDS.

socat -d -d -d /var/lib/vmware/Virtual\ Machines/vmtestcli5/serial2tcp4-listen:9988

This links the Unix Domain Socket to port 9988 on the local machine.

1. Using telnet open port 9988 on the vmware host machine. You will be able to communicate into and out of the serial port.
* Rather than "tcp4-listen:9988" you can use "stdio" to go directly to/from a shell on the vmware host server.
* Any control characters do not get passed through appropriately.

see http://communities.vmware.com/thread/28508

Perhaps helps...
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now