socat for serial connection between 2 VM's

gryffoer

Member
Feb 22, 2023
2
0
6
Hello

I have a setup where we need to connect serial ports of 2 VM's with each other.
I have found a solution to add serial sockets to the 2 VM's and connect them via socat:

Code:
socat UNIX-CLIENT:/var/run/qemu-server/100.serial0 UNIX-CLIENT:/var/run/qemu-server/101.serial1

This has to be active all the time.

Does anyone know if it is possible to run this in the background when the two VM's have been booted?
Via a hookscript?

Thanks!

Tuur
 
Via a hookscript?
That is probably your best chance.
Maybe a systemd unit that is enabled & started by the hookscript could be useful to restart the connection should socat crash?
 
Hi aaron
Thanks, I will investigate this.

I have little to no experience in such, so any help would be useful and appreciated ;-)