Virtual machines on GitHub runners using virt-install
2026-08-14
Abstract
GitHub Action adelton/virt-install is available, allowing to create virtual machines of various operating systems on GitHub runners, specifically focusing on GitHub-hosted runners.
There are projects that need to be tested on various operating systems (OS) in GitHub Actions workflows. While podman or docker can provide easy access to containerized setups of most OSes, sometimes full "real" machine environments are needed, for example to test interaction with the OS' kernel, early boot, filesystems, or many other aspects that are not possible in containers.
If the project does not want to maintain a set of self-hosted machines to be used as runners or testing environments, or the desired operating system changes often for example when testing with nightly or weekly OS composes, creating virtual machines (VM) in run-time on the GitHub runners is another option. And it's not that hard, just curl the VM's image and virt-install or qemu-system-x86_64 and add some logic around it ... Except there might be various additional options and tweaks needed on specific host and guest operating system or architecture combinations.
The adelton/virt-install GitHub Actions
aims to implement those compatibility tweaks while keeping
the action.yaml
plain bash for easy review.
It has been tested on GitHub-hosted runners
ubuntu-26.04, ubuntu-26.04-arm,
ubuntu-24.04 (ubuntu-latest) and ubuntu-24.04-arm,
with
fairly
extensive set of operating systems
and virt-install options.
If a virtual machine of a specific operating system is needed
in a GitHub Actions workflow, the adelton/virt-install
now in its initial release v0.5 might be worth a try:
jobs:
virt-install-almalinux-x86_64:
runs-on: ubuntu-latest
steps:
- uses: adelton/virt-install@v0.5
with:
disk-url: https://repo.almalinux.org/almalinux/10/cloud/x86_64/images/AlmaLinux-10-GenericCloud-latest.x86_64.qcow2
osinfo: almalinux10
- run: ssh root@vm1.example.com cat /proc/cmdline