Add serial port to VM with the settings:
Use named pipe:
<filename for the named pipe (unix-socket)>
This end is the server
The other end is an application
Connect with:
socat unix-connect:/path/to/socket stdio,echo=0,raw
Make sure that the serial port is enabled in the VM bios if it doesn’t work.