I’ve been experimenting a lot with Linux VMs lately and one of the use cases that I thought would be interesting is how to send structured requests to the VM without the overhead of virtualizing a network. If you generalize it, it could be pretty interesting — you have a fairly hermetic, isolated environment that you can drive from the outside. In fact, some secure enclaves like AWS EC2 enclaves only give you vsock as the transport protocol into the VM (or at least that used to be the case).
I put together this text along with a GitHub repository where I build a server and a client that can talk via vsock, in an RPC fashion. The project is built with Bazel with very few lines of code.
No network virtualization overhead here!
I hope you like it!