virtual machine – Networking via shared file(system) – User mode “networking”

I’m looking for ways to create bidirectional connection between 2 virtual machines without a network connection.

VM1 would dump upstream traffic to a file on a shared disk, VM2 will read traffic and forward it to the right process. Traffic in the opposite direction will be handled in a similar way maybe involving a second shared file.

The shared filesystem would be virtiofs. OS is linux.

I guess this should be possible in general. Latency is not important at the moment.
What would be suitable tools? Can tcpreplay be used for replaying while the file is still being written to ?