Kernel panic when installl AlmaLinux 9.x on KVM VPS
When installing modern operating systems like AlmaLinux 9 on a KVM VPS, you might encounter a critical "Kernel Panic" error that prevents the server from booting. This article explains the cause and provides a definitive solution.
What is a Kernel Panic?
A Kernel Panic is a critical system error that occurs when the operating system's kernel encounters a problem it cannot recover from. The system halts all operations to prevent further data corruption and displays an error message.
1. The Problem: Kernel Panic After Installation
If your VPS fails to boot after a fresh installation of AlmaLinux 9 and displays an error screen like the one below, the issue is likely an incompatibility with the virtual server's CPU configuration.
The primary reason is that AlmaLinux 9 requires modern CPU instruction sets that are not available in KVM's default emulated CPU models (like kvm64 or qemu64). This causes the kernel to fail during initialization, triggering a panic.
2. The Solution: Change the VPS CPU Mode
To resolve this, we need to change the virtual machine's CPU mode within the hypervisor management panel to allow it to use the physical CPU's features. The two recommended modes are:
3. Step-by-Step Instructions
You will need to log into your VPS provider's control panel or your hypervisor's management interface (like Proxmox, SolusVM, or Virtualizor) to perform these steps:
- Step 1: Shut down your virtual private server (VPS).
- Step 2: Navigate to your VPS configuration settings, usually under the "Hardware" or "Options" tab.
- Step 3: Locate and open the CPU settings.
- Step 4: Under "CPU Type" or "Mode", change the value from the default setting to Host Model or Host Passthrough (often simply labeled "Host").
- Step 5: Save the changes and start the VPS.
After rebooting, your AlmaLinux 9 virtual server should now boot up successfully without the Kernel Panic error.