Serial port connection between VMs

Jwashwa

New Member
Mar 10, 2025
1
0
1
I'm trying to create multiple serial connections between two Windows VMs (server 2019) and have come across two problems.

1. I need 4 serial ports on both VMs, which I can create on Proxmox VE but within the Windows VM the ports say they don't have the resources.
If I remove 2 of the ports, the serial ports no longer have a resource warning within device manager.

2. I have used the "socat" command described as the solution in Serial port between two VMs? to connect the ports. But if this isn't running the ports still show as active on the VMs and any data being sent seems to disappear.
Is there an alternative?
 
I've been struggling with this myself, so I felt like responding here.
Similar situation as you but I want to use serial to debug the Windows Kernel.

What I usually do is set up a Serial Port on both my Guest VMs, and use `socat` on the host, to map the first guest's serial port to a TCP socket.

Code:
socat TCP-LISTEN:6<vmid>,reuseaddr,fork UNIX-CONNECT:/var/run/qemu-server/<vmid>.serial0

And then on the windows host that I want to debug with I run winsocat to provide a serial port on the second guest.

Code:
winsocat NPIPE-LISTEN:1<vmid> TCP:pve-host:6<vmid>

This however is not optimal, and debugging the kernel is very slow. I also wish there was a way to set this up that did not require access to the host. I've been debating creating a service that listens for events from PVE and does the wiring automatically.

I've also experimented with doing this all through a hookscript but I don't think this is a viable solution as the hookscript I created does not properly handle live migrations.



The solution is
Code:
args: -chardev socket,id=serial0,host=0.0.0.0,port=0,server=on,wait=off -device isa-serial,chardev=serial0
 
Last edited: