[Bug]: Running VMs all hit Guru Meditation -4004 (VERR_VMX_INVALID_VMXON_PTR) when a KVM guest starts on the Linux host
I maintainer di solito rispondono entro 6 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- c, linux
- Ambito
- backend, operating-systems
Direzione di ricerca
Start by reading the VMM / HM VT-x handling around hmR3InitFinalizeR0Intel in src/VBox/VMM/VMMR3/target-x86/HMR3-x86.cpp, then trace how running VMs handle loss of their VMXON region when a KVM guest starts. Reproduce with kvm.enable_virt_at_load=N and a running VirtualBox VM before starting a QEMU guest with -accel kvm. Done means the running VM keeps VT-x or reports a clear error instead of entering Guru Meditation -4004.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
7.2.6 (Ubuntu package: 7.2.6_Ubuntu r172322)
Host OS Type
Linux
Host OS name + version
Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic
Host Architecture
x86 (Intel Core i5-13400, 13th gen, 10 cores / 16 threads, VT-x with EPT/VPID)
Guest OS Type
Windows (also seen with other guests)
Guest Architecture
x86
Guest OS name + version
Windows Server 2019 (Windows2019_64) and others. Three guests were running and all three crashed at once.
Component
VMM / HM (VT-x)
What happened?
Three VirtualBox VMs were running headless. A different program then started a QEMU/KVM guest (qemu-system-x86_64 ... -accel kvm). In the same second, all three VirtualBox VMs went into Guru Meditation:
05:13:35.205505 HM: HCPhysVmxEnableError = 0x0000000c768fd000
05:13:35.206226 Changing the VM state from 'RUNNING' to 'GURU_MEDITATION'
05:13:35.206249 Console: Machine state changed to 'Stuck'
05:13:35.206675 !! VCPU0: Guru Meditation -4004 (VERR_VMX_INVALID_VMXON_PTR)
05:13:35.259159 emR3Debug: rc=VERR_VMX_INVALID_VMXON_PTR
The crashed VMs could not be resumed and had to be powered off.
While the KVM guest was still running, starting a VirtualBox VM failed cleanly:
HM: VMX setup failed with rc=VERR_VMX_VMXON_FAILED!
VMSetError: .../src/VBox/VMM/VMMR3/target-x86/HMR3-x86.cpp(1833) int hmR3InitFinalizeR0Intel(PVM); rc=VERR_VMX_VMXON_FAILED
That clean failure is fine. The bug is that VMs that are already running get killed instead of either keeping VT-x or failing gracefully.
Relevant host details:
kvmis loaded withenable_virt_at_load=N. KVM only turns on VMX when its first guest starts and turns it off again when its last guest exits. VirtualBox therefore loads and starts fine withkvm_intelpresent, then breaks later when a KVM guest appears.- vboxdrv cannot use KVM's VT-x enable/disable on this kernel, so VirtualBox uses its own VMXON:
VBox.log:vboxdrv: Found extra KVM hardware-virtualization symbols vboxdrv: Failed to find KVM hardware-virtualization symbolsHM: VT-x/AMD-V init method: Local,HM: VT-x/AMD-V enable method: VirtualBox - The same kernel log also shows
kvm_amd: CPU N isn't AMD or Hygonon this Intel host, which may be related to #629. - Nested hardware virtualization is off for the guests (
NestedHWVirt = 0).
How can we reproduce this?
- Linux host with kernel 7.0 (likely 6.12 or later), with
kvmandkvm_intelloaded andkvm.enable_virt_at_load=0. Confirm withcat /sys/module/kvm/parameters/enable_virt_at_load, which should printN. - Start one or more VirtualBox VMs. They start normally.
- Start any KVM guest, e.g.
qemu-system-x86_64 -accel kvm -m 512 -nographic. - Every running VirtualBox VM immediately hits Guru Meditation -4004 (VERR_VMX_INVALID_VMXON_PTR).
Expected behaviour
Ideally VirtualBox and KVM share VT-x through the kernel's virtualization enable API, the same way they work together when vboxdrv finds KVM's symbols. Failing that, running VMs should not be destroyed. One of these would be acceptable:
- VirtualBox keeps VT-x and the KVM guest fails to start.
- VirtualBox detects the lost VMXON region and gives a clear error saying another hypervisor (KVM) took VT-x, instead of an unexplained Guru Meditation.
Workaround
Blacklist kvm_intel (blacklist kvm_intel + install kvm_intel /bin/false in /etc/modprobe.d), or make sure no KVM guests run on the host.
Related
- Old Trac ticket #18977: all VMs go to Guru Meditation when a KVM (virt-manager) VM is powered on.
- #139: in 7.2.2 the error was made clearer when KVM is in use at VM start, but running VMs are still killed.
- #629: vboxdrv triggers kvm_amd probe on Intel systems.
- #2: request to run VirtualBox on top of KVM.
Did you upload all of your necessary log files, screenshots, etc.?
Attaching VBox.log from one crashed VM (the other two show the same error at the same timestamp), plus the vboxdrv/kvm kernel log lines.
- Lingua principale
- C
- Stelle
- 1.4k
- Fork
- 219
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di VirtualBox/virtualbox
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
VirtualBox/virtualbox#979 ·
I maintainer di solito rispondono entro 6 giorni
-
[Bug]: Guest Additions 7.2.20 vboxvideo fails to build on Linux kernel 6.12.113 (drm_fb_helper_restore_fbdev_mode_unlocked: too few arguments)Forse già presa @Berbe l’ha presa 11 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
VirtualBox/virtualbox#918 · 9 commenti ·
I maintainer di solito rispondono entro 6 giorni
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 12/100
VirtualBox/virtualbox#981 ·
I maintainer di solito rispondono entro 6 giorni
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 8/100
VirtualBox/virtualbox#980 ·
I maintainer di solito rispondono entro 6 giorni
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
VirtualBox/virtualbox#977 ·
I maintainer di solito rispondono entro 6 giorni
Tutte le issue di VirtualBox/virtualbox
Issue simili
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Status: Opened
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
FriendsofECCE/ECCE#1018 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
immortalwrt/immortalwrt#2522 ·
-
翻译冲突Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
fw876/helloworld#2089 ·
I maintainer di solito rispondono entro 1 giorno