Qemu + VPP + Vhost user

This article shows you how to set up a VM or a bare metal machine with qemu and KVM and VPP handling L2 networking between VMs.


The main resource for the setup was: https://gist.github.com/egernst/5982ae6f0590cd83330faafacc3fd545

Install Qemu/KVM

The installation is straightforward when following this guide (Make sure KVM is available): https://help.ubuntu.com/community/KVM/Installation


It is also possible to do all this within a VM utilizing nested virtualisation. With e.g. PROXMOX, it’s just a matter of turning on nested virtualisation according to: https://pve.proxmox.com/wiki/Nested_Virtualization After that, a VM can be installed with Qemu and KVM as if it were a bare metal machine.

Install VPP

Just install VPP (see this guide) and start it up…

Configure VPP

The following configuration can be used to connect two VMs using VPP as the vhost interface server side:

This configuration is SERVER for VPP and CLIENT for VMs and there is a bridge domain between interfaces in VPP

Start VMs

The following command starts FreeBSD VM and attaches it to the opened socket by VPP:

The image was taken from: http://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/10.3-RELEASE/amd64/Latest/

Ubuntu 14
The following command starts Ubuntu14 VM and attaches it to the opened socket by VPP:

The image was taken from: https://uec-images.ubuntu.com/releases/14.04/release/ The command does not use the qcow image directly. Instead it uses the following guide to configure password login to the VM according to this guide: https://help.ubuntu.com/community/UEC/Images (Section: Ubuntu Cloud Guest images on 12.04 LTS (Precise) and beyond using NoCloud)

… Ubuntu cloud images do not allow password login via e.g. VNC

Network config in VMs

Accessing VMs
Each VM can be accessed using VNC at:

so in the case of the earlier FreeBSD example and IP being e.g. it would be:


The default credentials for VMs are:

FreeBSD: root, no password
Ubuntu: ubuntu, passw0rd


The configuration for the VMs could look like:


Now, ping and any other traffic should be working fine between VMs.


VPP vhost user bug: Fix: https://gerrit.fd.io/r/#/c/6735