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.
  1. 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!

  2. 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.

  3. remijouannet

    hi, i’ve recently contributed to libzmq by adding AF_VSOCK. if anyone is playing around with it

More from this day

2026-09-10