Revisiting KVM support for Hosted GitHub Actions · community · Discussion #8305

3 min read Original article ↗

There are a lot of exciting developments in the operating space with unikernels, testing tools, networking labs, and more. It would be much easier to collaborate on and encourage new developers to explore this level of the system if GitHub Actions supported KVM.

What are the chances that Actions may support using KVM in the future?

You must be logged in to vote

Hi @grahamc - great question. If we offered nested virtualization, would this be sufficient? Or is there more that we would need to provide to support you using KVM?

You must be logged in to vote

9 replies

@ustiugov

we would be interested in this feature very much as well!

@maxkratz

Another +1; we would also be interested in this feature. Currently, it is the only reason we have to use a self-hosted runner.

@javierhonduco

+1, it would be fantastic to have nested virtualization to run tests in VMs. Our use case is ensuring that our software works in various kernel versions

@obbardc

nested virtualisation on the default runners would be great :-)

@jacob-carlborg-apoex

This comment was marked as disruptive content.

This comment was marked as disruptive content.

This comment was marked as disruptive content.

You must be logged in to vote

0 replies

I managed to run KVM on the large hosted runners, but it requires some packages installed.
It would be awesome if they'd be included in the large runners by default and permissions are setup as needed.

      - name: Enable KVM group perms
        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
          sudo apt-get update
          sudo apt-get install -y libvirt-clients libvirt-daemon-system libvirt-daemon virtinst bridge-utils qemu qemu-system-x86
          sudo usermod -a -G kvm,libvirt $USER
You must be logged in to vote

3 replies

@alexellis

Some of what you're referring to there is about libvirt - not KVM. KVM is installed and working if /dev/kvm is available.

@joshiste

yes your'e right. but would be nice to have it anyway

@nebuk89

What's the progress on this?
The last response from github was two years ago and by now @ethomson doesn't seem to work for github anymore.

You must be logged in to vote

0 replies

Would be nice if the runner-user would be part of the kvm group. This way, you wouldn't always have to re-configure the permissions when you want to use KVM. I also don't expect that applications which don't use KVM would be impacted by this change.

You must be logged in to vote

1 reply

@JojOatXGME

I noticed there is already actions/runner-images#8542 about this topic. Unfortunately, the ticket was closed as a duplicate for a reason I find a bit strange, and the other ticket was shortly afterward closed for a different reason which seems completely unrelated to the kvm group. I commented there as well: actions/runner-images#7670 (comment).

Fwiw, kvm virtualization seems to work just adding the udev rule now

You must be logged in to vote

1 reply

@jacob-carlborg-apoex

Yes, hardware accelerated virtualization works since GitHub updated the Linux runners.