Skip to content

Commit c283fe1

Browse files
committed
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 <[email protected]>
1 parent 58818df commit c283fe1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/actions/start-vm/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ runs:
2525
- name: install wait-for-it
2626
shell: bash
2727
run: sudo apt update && sudo apt-get -qq install wait-for-it
28+
- name: Enable KVM group perms
29+
shell: bash
30+
run: |
31+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
32+
sudo udevadm control --reload-rules
33+
sudo udevadm trigger --name-match=kvm
2834
- name: Start VM in background
2935
shell: bash
3036
run: |

0 commit comments

Comments
 (0)