Learn how to fix “KVM: entry failed, hardware error 0x80000021”. Our KVM Support team is here to help you with your questions and concerns.
KVM: entry failed, hardware error 0x80000021 | Solution
Running into errors when managing virtual machines using Kernel-based Virtual Machine (KVM) can get frustrating. These errors can cause unexpected crashes or downtime. Here is one such error:
KVM: entry failed, hardware error 0x80000021
This issue typically points to a low-level problem with the virtualization environment, often related to hardware compatibility, firmware settings, or guest OS configuration.
Let’s examine the causes of this error and how to resolve it.
An Overview:
- What Does This Error Mean?
- Key Impacts of the Error
- Common Causes and How to Fix Them
- 1. Unsupported Guest Mode
- 2. Outdated Kernel
- 3. Incorrect KVM Module Parameters
- 4. BIOS/UEFI Settings Misconfigured
- 5. Incompatible CPU Features
- 6. Memory Allocation Issues
- 7. Faulty Hardware
- 8. Incorrect CPU Model Configuration
- 9. Misconfigured VM Settings
- 10. Firmware Incompatibility
- Prevention Strategies
What Does This Error Mean?
The error code `0x80000021` translates to `HVMSG_UNRECOVERABLE_EXCEPTION`, indicating that the hypervisor encountered an unrecoverable exception when trying to enter a virtual machine. This can happen when the guest OS attempts to execute an unsupported instruction or enters an invalid state.
This error commonly occurs on Intel-based systems using Intel Virtualization Technology (VT-x), and can render affected VMs unresponsive or crash.
If you’re new to KVM or comparing it with other hypervisors, check out our guide on KVM hypervisor’s advantages and disadvantages to understand how it works under the hood.
Key Impacts of the Error
If not resolved quickly, this error can
- VM crashes or hangs
- System resource wastage, as the hypervisor continues trying to run the failed VM
- Operational downtime for hosted services or applications
Common Causes and How to Fix Them
1. Unsupported Guest Mode
Guest OS is in a mode like “big real mode” that the host doesn’t support.
Click here for the Solution.
- Review the VM’s operating mode in its configuration.
- Set it to use a compatible mode (e.g., protected mode).
- Consult the guest OS documentation for mode requirements.
If you’re facing issues booting a Windows VM, this may also tie into errors like “No bootable device” in KVM, which can stem from guest mode or disk configuration issues.
2. Outdated Kernel
Older Linux kernels may lack proper KVM support.
Click here for the Solution.
- Check the current kernel version and update the Linux kernel to the latest stable version that is supported by the distribution.
uname -r
sudo apt update && sudo apt upgrade
- Reboot the machine after the upgrade to apply changes.
3. Incorrect KVM Module Parameters
The KVM module may be misconfigured for Intel hardware.
Click here for the Solution.
Load the KVM module with specific parameters and verify that the module has loaded correctly by checking its parameters.
sudo modprobe kvm_intel emulate_invalid_guest_state=0
modinfo kvm_intel | grep -i parameters
4. BIOS/UEFI Settings Misconfigured
Virtualization settings are disabled in BIOS/UEFI.
Click here for the Solution.
- First, reboot and enter BIOS/UEFI (usually via F2, DEL, or ESC).
- Then, enable Intel VT-x or AMD-V.
- Save and reboot.
5. Incompatible CPU Features
The CPU lacks virtualization features required by the guest.
Click here for the Solution.
Check the CPU specs online for VT-x or AMD-V support. If not present, consider upgrading the processor.
6. Memory Allocation Issues
Insufficient memory causes instability.
Click here for the Solution.
- Use the VM manager (e.g., virt-manager) to increase the allocated memory—recommend at least 4GB for modern Vms.
- Save and restart the VM.
7. Faulty Hardware
Defective RAM or CPU could be the root of the issue.
Click here for the Solution.
- Run diagnostics like Memtest86 or vendor-specific tools.
- Replace any faulty hardware components.
8. Incorrect CPU Model Configuration
The CPU model configured for the VM doesn’t match the host CPU.
Click here for the Solution.
- First, use virt-manager or Proxmox to edit the VM configuration.
- Then, set the CPU model to `host`:
<cpu mode='host'/>
- Save and reboot the VM.
If you’re using QEMU along with KVM and running into issues with connectivity or device passthrough, see our guide on fixing the “QEMU/KVM not connected” issue.
9. Misconfigured VM Settings
Virtualization features like IOMMU or nested virtualization are misconfigured.
Click here for the Solution.
- Open the VM configuration settings and enable IOMMU in GRUB:
For Intel:
intel_iommu=on
For AMDamd_iommu=on
- Now, enable nested virtualization in the hypervisor settings if needed.
- Reboot the host machine.
10. Firmware Incompatibility
Outdated firmware may cause virtualization features to misbehave.
Click here for the Solution.
Check the BIOS/UEFI version. Furthermore, visit the motherboard or server manufacturer’s website for firmware updates.
Then, apply updates carefully and reboot.
Also, if you’re trying to use USB devices inside the VM and getting denied access errors, this could be tied to permission issues—our USB redirection error fix guide covers that in detail.
Prevention Strategies
Here are some tips to avoid facing this issue again:
- Regularly update the system, especially the kernel and virtualization packages.
- Monitor system logs to catch early signs of VM instability.
- Test new VM configurations in a sandbox before production deployment.
- Back up VM settings and data to enable quick recovery.
- Perform periodic hardware checks to prevent issues caused by aging or failing components.
[Need assistance with a different issue? Our team is available 24/7.]
Conclusion
In brief, our Support Experts demonstrated how to fix “KVM: entry failed, hardware error 0x80000021”.
0 Comments