From: Vincent Fu Date: Fri, 4 Apr 2025 11:41:50 +0000 (-0400) Subject: ci: set kvm permissions for GHA QEMU jobs X-Git-Tag: fio-3.40~39 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=c283fe11bda9efde7f063e6fe693802724ddc8c0;p=fio.git ci: set kvm permissions for GHA QEMU jobs The image used by GitHub-hosted runners changed the default kvm device permissions recently rendering us no longer able to start guest VMs. The error message: Could not access KVM kernel module: Permission denied qemu-system-x86_64: failed to initialize kvm: Permission denied Working run: https://github.com/fiotestbot/fio/actions/runs/14186873066 Failed run: https://github.com/fiotestbot/fio/actions/runs/14211189491 Explicitly give the GitHub Actions runner user permission to access the /dev/kvm device following the guide at https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/ Signed-off-by: Vincent Fu --- diff --git a/.github/actions/start-vm/action.yml b/.github/actions/start-vm/action.yml index 3449aac5..ab13aa09 100644 --- a/.github/actions/start-vm/action.yml +++ b/.github/actions/start-vm/action.yml @@ -25,6 +25,12 @@ runs: - name: install wait-for-it shell: bash run: sudo apt update && sudo apt-get -qq install wait-for-it + - name: Enable KVM group perms + shell: bash + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm - name: Start VM in background shell: bash run: |