Skip to content

Commit 10c6821

Browse files
committed
kvm: the render node must open as the qemu user, not exist for root
The vgem build worked - 'vgem built and loaded' - and qemu still died with 'egl: no drm render node available' on all four VM jobs. The mechanism, reproduced locally byte-for-byte: an insmod'd node ships 0600 root:root (devtmpfs's default; the runner's udev rules do not widen a faux-bus vgem), and the smoke's qemu runs as the runner user - the workflow's smoke step has no sudo, by design, and the disks it boots are its own files. qemu's node scan silently skips the EACCES and reports no node; the action's ls check passed because ls does not need to open anything. The node is now chmod'd 666 - the same treatment the kvm rule below gives /dev/kvm - and the gate is the qemu user's own access(3), so the next failure, if any, is loud and specific. Validated locally in the vgem-only namespace: an unprivileged qemu with a 0600 node dies with the runner's exact error, the same qemu with 0666 gets past EGL and proceeds to its next argument.
1 parent 58ad184 commit 10c6821

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

‎.github/actions/kvm/action.yml‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,28 @@ runs:
6161
&& echo " .. vgem built and loaded"
6262
fi
6363
fi
64-
# Loud here rather than as a confusing qemu death minutes later.
65-
ls /dev/dri/renderD* >/dev/null 2>&1 \
66-
|| { echo "no DRM render node: the guest's GL (virgl) cannot initialize"; exit 1; }
64+
# A freshly insmod'd node ships 0600 root:root — devtmpfs's
65+
# default, and the runner's udev rules do not widen it — while
66+
# the smoke's qemu runs as this user, not root. An unopenable
67+
# node is indistinguishable from no node to qemu's scan: it
68+
# silently skips the EACCES and reports "no drm render node
69+
# available" (measured: reproduced locally, byte-identical, on
70+
# 2026-10-05). The /dev/kvm rule below is the same lesson.
71+
sudo chmod 666 /dev/dri/renderD* 2>/dev/null || true
72+
# The check is the qemu user's, not root's: ls sees a node root
73+
# owns, open is what qemu needs.
74+
node=""
75+
for candidate in /dev/dri/renderD*; do
76+
if [ -c "$candidate" ] && [ -r "$candidate" ] && [ -w "$candidate" ]; then
77+
node=$candidate
78+
break
79+
fi
80+
done
81+
if [ -z "$node" ]; then
82+
echo "no DRM render node the qemu user can open: the guest's GL (virgl) cannot initialize"
83+
exit 1
84+
fi
85+
echo " .. render node: $node"
6786
6887
# /dev/kvm is present on a hosted runner and the CPU exposes svm;
6988
# the runner user is simply not in the kvm group, and that is the

0 commit comments

Comments
 (0)