vsock provides access to Linux VM sockets (
communication between a hypervisor and its virtual machines. MIT Licensed.
Go 1.11+ is required to use package
For more information about VM sockets, check out my blog about Linux VM sockets in Go.
To make use of VM sockets with QEMU and virtio-vsock, you must have:
- a Linux hypervisor with kernel 4.8+
- a Linux virtual machine on that hypervisor with kernel 4.8+
- QEMU 2.8+ on the hypervisor, running the virtual machine
Before using VM sockets, following modules must be removed on hypervisor:
modprobe -r vmw_vsock_vmci_transport
modprobe -r vmw_vsock_virtio_transport_common
modprobe -r vsock
vhost_vsock module needs to be enabled on hypervisor:
On VM, you have to enable
vmw_vsock_virtio_transport module. This module should automatically load during boot when the vsock device is detected.
To utilize VM sockets, VM needs to be powered on with following
Check out the QEMU wiki page on virtio-vsock for more details. More detail on setting up this environment will be provided in the future.
To try out VM sockets and see an example of how they work, see
This command shows usage of the
APIs, and allows users to easily test VM sockets on their systems.