Using virtiofs with libvirt/virt-install

Recently we switched our 9p filesystem usage in CoreOS Assembler to use virtiofs.

This is the technology behind a lot of new lightweight container VM technology like kata-containers and libkrun, but can also be easily used with libvirt.

Running as non-root using qemu:///session

Currently the virtiofs integration doesn’t work as non-root via a qemu:///session connection. There is an oustanding RFE for this upstream and downstream in RHEL that can be followed for updates.

virtiosfs with virt-install

I typically use virt-install to automate creation of my libvirt virtual machines. Using virt-install we can use the --filesystem= and --memorybacking= parameters to get what we want. The --memorybacking= parameter will add shared memory to the instance, which is required for virtiofs.

[Read More]