Skip to content

Emulation via Virtual Machines

Tim Potter edited this page Aug 1, 2017 · 8 revisions

QEMU/KVM Virtual Machines as Nodes

A virtual machine (VM) offers a great analogy to the SoC on a node of The Machine. A VM has its own DRAM and copy of Linux along with networking and other IO "devices". It's a solid foundation to create the full node; all that's lacking is the fabric-attached memory. If we ignore the "overhead" of the bridge hardware, all that's needed is some way to augment the physical address space of a VM with a backing store and have that backing store shared across multiple VMs.

QEMU offers a feature which exactly fits this need: Inter-Virtual Machine Shared Memory, or IVSHMEM. The IVSHMEM mechanism

  • Provides a pseudo PCI device to a VM with a specified size and NAME
  • BAR2 of the PCI device specifies the physical address of the "memory"

This physical address space in the VM is backed by a file in the host. That file exists as a POSIX shared memory object of the given NAME, visible on the VM host file system as /dev/shm/NAME. Furthermore, if multiple VMs specify the same object name, they do indeed share the same file on the host. Hence, the physical address space is shared among all VMs so configured.

QEMU with IVHSHMEM

All "nodes" share the same backing store. Additionally, they are all connected via standard QEMU/libvirt networking to each other and the VM host.


The "Emulation" repo provides a configuration script and files that can be cloned to a VM host; even a latptop will do. When run, the script will create and configure multiple VMs connected via "fabric-attached memory" realized via IVSHMEM. This is the basic development environment on which much software is being developed within Hewlett Packard Enterprise. It's offered here in a simple form to let early adopters and advanced tinkerers get a glimpse of The Machine's user programming environment. And yes, there's even a "Hello world" program to get started.

Clone this wiki locally