From 46dc19ce6d92942a4fa58296a7273d586e6affcb763f4ac55747b7283de20885 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 29 Dec 2024 23:37:21 +0100 Subject: [PATCH] kvm.enable_virt_at_load=0 modprobe.d file --- virtualbox.changes | 7 +++++++ virtualbox.spec | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/virtualbox.changes b/virtualbox.changes index ab42557..cbd5c37 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Dec 29 22:25:33 UTC 2024 - Jan Engelhardt + +- Set kvm.enable_virt_at_load=0 via a modprobe file when virtualbox + is installed, to workaround kvm.ko stealing VMX mode. + + ------------------------------------------------------------------- Thu Nov 14 16:03:49 UTC 2024 - Jan Engelhardt diff --git a/virtualbox.spec b/virtualbox.spec index 064bf28..4587cd3 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -519,7 +519,8 @@ mkdir -p \ %{buildroot}%{_sysconfdir}/vbox \ %{buildroot}%{_sysconfdir}/vbox/autostart.d \ %{buildroot}%{_udevrulesdir} \ - %{buildroot}%{_sysconfdir}/X11/xinit/xinitrc.d + %{buildroot}%{_sysconfdir}/X11/xinit/xinitrc.d \ + %{buildroot}%{_modprobedir} echo "entering guest-tools install section" install -m 755 out/linux.*/release/bin/additions/VBoxControl %{buildroot}%{_bindir} @@ -579,6 +580,12 @@ install -m 644 components/* %{buildroot}%{_vbox_instdir}/components/ # install languages install -m 644 nls/* %{buildroot}%{_datadir}/virtualbox/nls/ install -m 644 UnattendedTemplates/* %{buildroot}%{_datadir}/virtualbox/UnattendedTemplates/ + +# Workaround kvm.ko usurping VMX. +# (Linux kernel commit b4886fab6fb620b96ad7eeefb9801c42dfa91741 is the culprit. +# See also https://lore.kernel.org/kvm/ZwQjUSOle6sWARsr@google.com/T/ ) +echo options kvm enable_virt_at_load=0 >"%buildroot/%_modprobedir/50-virtualbox.conf" + # install kmp src mkdir -p %{buildroot}%{_usrsrc}/kernel-modules/virtualbox mkdir -p %{buildroot}%{_usrsrc}/kernel-modules/additions @@ -822,6 +829,7 @@ export DISABLE_RESTART_ON_UPDATE=yes %dir %{_unitdir}/multi-user.target.wants %{_prefix}/lib/virtualbox/vboxdrv.sh %{_prefix}/lib/virtualbox/vboxautostart-service.sh +%{_modprobedir}/ %{_unitdir}/vboxdrv.service %{_unitdir}/vboxautostart-service.service %{_unitdir}/multi-user.target.wants/vboxweb-service.service