← back to projects

// writeup

VM-TUNE

bash libvirt qemu/kvm vfio github.com/ArchIsOverrated/VM-TUNE ↗
Cyberpunk 2077 running with full gpu acceleration in virtual machine.
Sample of Cyberpunk 2077 running in virtual machine optimized by vmtune toolkit.

What It Is

A small collection of helper scripts I use to build and configure a custom Fedora VM environment — GPU passthrough, VM creation. Meant to make the creation of high performance virtual machines easy through the use of vmtune tool in the CLI.

Why I Built It

Setting up GPU passthrough on a fresh machine means hand-editing kernel command lines, loading VFIO module loads, writing libvirt hooks for hugepages and CPU isolation, takes hours of setup and research to do. This tool handles that for you and makes it easy.

How It's Structured

Two entry points and one runtime CLI:

The supporting scripts are installed to /usr/local/lib/VMTUNE and called by vmtune behind the scenes:

The Libvirt Hooks

The performance wins live here. A dispatcher script under /etc/libvirt/hooks/qemu fans out to three hook scripts on VM start, and reverses them on shutoff:

Assets That Ship With It

Warning: Don't run the VM image off a BTRFS filesystem — performance tanks. If you must, disable copy-on-write on the directory where the image lives.

What's Next

Probably overhaul the whole project. Especially the gui for a making my own Linux distribution I have planned. Some of the code is not optimal so re-writes are needed.