From: Daan De Meyer Date: Thu, 11 May 2023 08:55:18 +0000 (+0200) Subject: action: Allow unprivileged access to kvm, vhost-vsock and vhost-net devices X-Git-Tag: v15~165^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26f2c15502ac9caa252cb2162dd8facbeb446919;p=thirdparty%2Fmkosi.git action: Allow unprivileged access to kvm, vhost-vsock and vhost-net devices These are restricted on Debian/Ubuntu but we want to allow running unprivileged qemu so let's loosen the permissions on these devices to make that possible. --- diff --git a/action.yaml b/action.yaml index f4675781b..738fe3646 100644 --- a/action.yaml +++ b/action.yaml @@ -5,6 +5,22 @@ runs: using: composite steps: + - name: Permit unprivileged access to kvm, vhost-vsock and vhost-net devices + shell: bash + run: | + sudo adduser $(id -un) kvm + sudo sed -i '/kvm/s/0660/0666/g' /usr/lib/tmpfiles.d/static-nodes-permissions.conf + sudo sed -i '/vhost/s/0660/0666/g' /usr/lib/tmpfiles.d/static-nodes-permissions.conf + sudo modprobe kvm + sudo modprobe vhost_vsock + sudo modprobe vhost_net + [[ -e /dev/kvm ]] && sudo chmod 666 /dev/kvm + sudo chmod 666 /dev/vhost-vsock + sudo chmod 666 /dev/vhost-net + lsmod + [[ -e /dev/kvm ]] && ls -l /dev/kvm + ls -l /dev/vhost-* + - name: Dependencies shell: bash run: |