from: https://wiki.qemu.org/Features/VirtioVsock virtio-vsock is a host/guest communications device. It allows applications in the guest and host to communicate. This can be used to implement hypervisor services and guest agents. - POSIX Sockets API so existing networking applications require minimal modification (unlike virtio-serial char devices) - Listen sockets can accept connections from multiple clients (unlike virtio-serial char devices) - No address configuration required inside the guest - No Ethernet or TCP/IP for a reduced attack surface for hypervisor services - Can be used with VMs that have no network interfaces Sockets are created with the AF_VSOCK address family. The SOCK_STREAM socket type is currently implemented for in-order, guaranteed stream semantics. The actual 1.1 spec is at: https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html#x1-39000010
Why do I care about this? I'm working on cloud-init, which uses LXD for testing. LXD uses vsock to communicate between lxd-agent on the virtual machine and LXD on the host. To make FreeBSD run properly on LXD, we need lxd-agent and as such virtio vsock.
note also that we have precedent for something like this on Hyper-V: https://reviews.freebsd.org/D24061
I've been working on a virtio_socket driver and AF_VSOCK as a pet project for some time now. I even got the lxd-agent working (partially) at this point. It can open interactive consoles and copy files to and from the VM with a decent throughput. I'm taking this project more seriously now but it's nowhere close to be ready to be reviewed, but I want to finish it eventually. The code is here: (I'm very often force-pushing to this branch) https://github.com/daniloegea/freebsd-src/tree/virtio_vsocks