Can I connect two VMs via a serial port?

Posted on 2008-11-04
Last Modified: 2008-11-18
   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?

Question by:pbenito
    LVL 67

    Expert Comment

    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.
    LVL 13

    Expert Comment

    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.

    Author Comment

    Ok, but is this possible in VMWare....and if so, how is it done?
    LVL 2

    Accepted Solution

    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.


    Perhaps helps...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    VMware vSphere 5 VMWare have been specialising in server virtualisation since 2001. It has the largest market share especially in the enterprise market and therefore has a strong reputation for delivering virtualisation solutions. As it was the f…
    First I will try to share a design of a Veeam Backup Infrastructure without Direct NFS Access backup.  ( Note: Direct NFS Access backup …
    Teach the user how to configure vSphere Replication and how to protect and recover VMs Open vSphere Web Client: Verify vsphere Replication is enabled: Enable vSphere Replication for a virtual machine: Verify replicated VM is created: Recover replica…
    Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now