Bringing VSOCK to libzmq: A New Address Family for VM-to-Hypervisor Messaging
Use Vsock with Libzmq
The author discovers that libzmq, despite supporting VMCI, lacks VSOCK support, and proposes a straightforward addition by adapting the VMCI code. This enables using libzmq's features—like CURVE authentication and various message patterns—over AF_VSOCK, which facilitates communication between VMs and hypervisors. The post includes practical examples using pyzmq-vsock, demonstrating a simple REQ/REP exchange and a secure asyncio setup with Curve encryption, all testable on loopback since Linux 5.6.
To my great surprise, there was a VMCI implementation, but no VSOCK.
- dwrodri
I could see this being really useful for people who need VM-Sandboxed software, but also need quick and dirty bridges between host/guest. Great contribution!
- sthustfo
What are the typical use cases for the Guest VM to talk to Hypervisor? I see 2 use cases mentioned on the Proxmox link (https://pve.proxmox.com/wiki/Qemu-guest-agent)
1. shutdown the guest
2. freeze the guest system during backup/snapshot
Just curious about other possible use cases.
- remijouannet
hi, i’ve recently contributed to libzmq by adding AF_VSOCK. if anyone is playing around with it