aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest8
1 files changed, 4 insertions, 4 deletions
diff --git a/test b/test
index de6eaf6..7ccfc8f 100755
--- a/test
+++ b/test
@@ -69,10 +69,10 @@ if [ -n "$needs_kvm" ]; then
echo " sudo usermod -aG kvm $(id -un)" >&2
exit 3
fi
- # Pass through the host's kvm gid so the container user (mapped to
- # host uid:gid) can actually open /dev/kvm.
- kvm_gid=$(getent group kvm | awk -F: '{print $3}')
- kvm_args="--device /dev/kvm --group-add ${kvm_gid:-kvm}"
+ # Pass through /dev/kvm's owning gid (numeric - group names from the
+ # host don't exist inside the container) so the container user
+ # (mapped to host uid:gid) can actually open it.
+ kvm_args="--device /dev/kvm --group-add $(stat -c %g /dev/kvm)"
fi
# Forward Ctrl-C cleanly, run as the host user so files in .tools/ stay