Features/VirtioVsock: Difference between revisions
No edit summary |
(→Links) |
||
Line 35: | Line 35: | ||
==Links== | ==Links== | ||
* KVM Forum 2015 presentation: [http://vmsplice.net/~stefan/stefanha-kvm-forum-2015.pdf virtio-vsock: Zero-configuration host/guest communication] (pdf) | * KVM Forum 2015 presentation: [http://vmsplice.net/~stefan/stefanha-kvm-forum-2015.pdf virtio-vsock: Zero-configuration host/guest communication] (pdf) | ||
* Connectathon 2016 presentation: [http://vmsplice.net/~stefan/stefanha-connectathon-2016.pdf NFS over virtio-vsock: Host/guest file sharing for virtual machines] (pdf) |
Revision as of 14:39, 2 March 2016
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 (like qemu-guest-agent or SPICE vdagent).
Unlike virtio-serial, virtio-vsock supports the POSIX Sockets API so existing networking applications require minimal modification. The Sockets API allows N:1 connections so multiple clients can connect to a server simultaneously.
The device has an address assigned automatically so no configuration is required inside the guest.
Sockets are created with the AF_VSOCK address family. Both SOCK_STREAM and SOCK_DGRAM socket types are available.
Code
- Virtio specification: RFC
- Linux kernel: stefanha's linux.git
- QEMU: stefanha's qemu.git
- netcat-like utility: nc-vsock
Quickstart
QEMU:
$ git clone -b vsock https://github.com/stefanha/qemu $ cd qemu $ ./configure --target-list=x86_64-softmmu $ make
Linux:
$ git clone -b vsock https://github.com/stefanha/linux $ cd linux $ cp /boot/config-$(uname -r) .config $ make menuconfig # select CONFIG_VHOST_VSOCK=m and CONFIG_VIRTIO_VSOCKETS=m $ make install modules_install
To use vhost_vsock.ko you must boot into the new host kernel and modprobe vhost_vsock.
The guest should also use the kernel so that modprobe virtio_transport can load the vsock guest driver.
For details on host and guest boot, see go.sh. Use nc-vsock 2 1234 inside the guest to connect to vsock port 1234 on the host. Use nc-vsock -l 1234 on the host to listen on that port.
Links
- KVM Forum 2015 presentation: virtio-vsock: Zero-configuration host/guest communication (pdf)
- Connectathon 2016 presentation: NFS over virtio-vsock: Host/guest file sharing for virtual machines (pdf)