Debugging Legacy Kernel Panics on Modern Ryzen Hardware: Running Metasploitable 3 on Proxmox VE
Executive Summary
Metasploitable 3 (Ubuntu 14.04 LTS) remains one of the most popular intentionally vulnerable targets for practicing penetration testing and security research in homelab environments. However, attempting to run this legacy image (powered by Linux Kernel 3.13) on modern virtualization hardware—such as an AMD Ryzen 7000 Series (Zen 4) processor under Proxmox VE 8 (KVM/QEMU)—frequently results in an immediate, fatal kernel panic during boot.
This article provides an in-depth forensic analysis of the kvm_unlock_kick kernel panic. By analyzing the kernel panic stack traces and register dumps from the VM console, we explore why standard Proxmox UI configuration tweaks fail, the low-level hypervisor mechanics involved, and the two-step fix required to get Metasploitable 3 booting smoothly.
1. Importing Metasploitable 3 into Proxmox VE
Metasploitable 3 is distributed by Rapid7 primarily as Vagrant boxes rather than standard ISO installation media.
Deployment Workflow
- Obtaining the Disk: Download the
virtualbox.boxarchive (~7.01 GB) from the Rapid7 HCP Vagrant Registry. - Extracting the VMDK: A
.boxfile is a Gzip/TAR archive. Extracting it reveals the underlying VirtualBox disk:
tar -xvf metasploitable3-virtualbox.box
Resulting disk file: box-disk1.vmdk (or metasploitable3-*-disk001.vmdk).
3. Proxmox Shell Import: Create a shell VM frame (e.g., VM 104) with no OS media and import the disk directly into Proxmox storage:
qm importdisk 104 box-disk1.vmdk local-lvm --format qcow2
2. Forensic Analysis of the Kernel Panic Screenshots
Upon starting VM 104, the guest boot sequence aborts within 5 seconds, displaying one of two kernel panic screens depending on early background I/O activity.
Screenshot 1: VFS Lookup & kvm_unlock_kick Page Fault

[ 5.156022] [<ffffffff8181335393>] blk_queue_bio+0x273/0x360
[ 5.156022] [<ffffffff81813316c1>] submit_bio+0x71/0x150
[ 5.156022] [<ffffffff811eba25>] _submit_bh+0x135/0x200
[ 5.156022] [<ffffffff8181246426>] ext4_find_entry+0x2f6/0x4e0
[ 5.156022] [<ffffffff8181246452>] ext4_lookup+0x42/0x150
...
[ 5.156022] [<ffffffff8104ed58>] ? kvm_clock_read+0x1f/0x30
[ 5.156022] [<ffffffff81721dda>] do_page_fault+0x5a/0x70
[ 5.156022] [<ffffffff81721419>] do_async_page_fault+0x29/0xe0
[ 5.156022] [<ffffffff8171e238>] async_page_fault+0x28/0x30
[ 5.156022] Code: 66 44 39 e8 75 bd 0f b6 35 d6 e6 e5 00 40 84 f6 75 2a 83 05 e6 e6 e5 00 01 48 c7 c0 6a b0 00 00 31 db 0f b7 0c 01 b8 05 00 00 00 <0f> 01 c1 0f 1f 44 00 00 5b 41 5c 41 5d 41 5e 5d c3 89 f0 31 c9
[ 5.156022] RIP [<ffffffff8104ed58>] kvm_unlock_kick+0xa8/0x100
[ 5.156022] RSP <ffff8800d929930>
[ 5.156022] CR2: ffffffff8104ed58
[ 5.156022] ---[ end trace c5054884a86fa943 ]---
What Screenshot 1 Tells Us:
- Call Stack Context: The call stack shows file lookup and I/O execution paths (
vfs_fstatat$\rightarrow$ext4_lookup$\rightarrow$submit_bio). While attempting to read system files during early boot, the kernel needed to acquire/release a spinlock. - The Instruction Pointer (
RIP):RIP [<ffffffff8104ed58>] kvm_unlock_kick+0xa8/0x100. The CPU faulted while executing insidekvm_unlock_kick(), a kernel routine designed to unhalt a virtual CPU waiting on a lock. - Faulting Memory Address (
CR2):CR2: ffffffff8104ed58. Notice thatCR2matchesRIPexactly. This indicates an instruction-fetch page fault: the CPU attempted to execute memory at0xffffffff8104ed58, but the kernel’s paravirtualization handler redirected execution into an unmapped or illegal region.
Screenshot 2: Storage Interrupt Context & Fatal Crash

[ 5.624074] [<ffffffff814dba87>] scsi_next_command+0x37/0x50
[ 5.624074] [<ffffffff814dbd4d>] scsi_io_completion+0x24d/0x640
[ 5.624074] [<ffffffff814d1bf0>] scsi_finish_command+0xb0/0x110
[ 5.624074] [<ffffffff814db9fe>] scsi_softirq_done+0x12e/0x160
[ 5.624074] [<ffffffff8133a663>] blk_done_softirq+0x83/0xa0
[ 5.624074] [<ffffffff8106caec>] __do_softirq+0xec/0x2c0
[ 5.624074] [<ffffffff8106d035>] irq_exit+0x105/0x110
[ 5.624074] [<ffffffff81728756>] do_IRQ+0x56/0xc0
[ 5.624074] [<ffffffff8171deed>] common_interrupt+0x6d/0x6d
[ 5.624074] <EOI>
[ 5.624074] [<ffffffff811112fc>] ? acct_account_cputime+0x1c/0x20
[ 5.624074] [<ffffffff81721dda>] do_page_fault+0x5a/0x70
[ 5.624074] [<ffffffff81721419>] do_async_page_fault+0x29/0xe0
[ 5.624074] [<ffffffff8171e238>] async_page_fault+0x28/0x30
[ 5.624074] Code: ... <0f> 01 c1 ...
[ 5.624074] RIP [<ffffffff8104ed58>] kvm_unlock_kick+0xa8/0x100
[ 5.624074] RSP <ffff88013fc03ba8>
[ 5.624074] CR2: ffffffff8104ed58
[ 5.624074] ---[ end trace 111a0e76b4a9d41a ]---
[ 5.624074] Kernel panic - not syncing: Fatal exception in interrupt
[ 5.624074] Shutting down cpus with NMI
What Screenshot 2 Tells Us:
- SCSI Storage Subsystem: The stack frame begins in the storage softirq handler (
common_interrupt$\rightarrow$do_IRQ$\rightarrow$blk_done_softirq$\rightarrow$scsi_io_completion). - Interrupt Context Boundary (
<EOI>): The fault occurred directly within an active End-Of-Interrupt handling context. - Fatal Kernel Violation: Linux kernels allow page faults in user-space or standard kernel threads, but a page fault inside a hardware/software interrupt service routine (ISR) cannot sleep or recover. The kernel immediately triggers:
Kernel panic - not syncing: Fatal exception in interrupt
+-----------------------------------------------------------------------------------+
| SCSI DISK INTERRUPT & PANIC SEQUENCE |
| |
| 1. Virtual Disk Interrupt Fired |
| `common_interrupt` -> `do_IRQ` -> `scsi_io_completion` |
| |
| 2. Spinlock Requested During SCSI SoftIRQ |
| Kernel attempts lock release inside interrupt handler. |
| |
| 3. Call KVM Paravirtualized Function |
| Invokes `kvm_unlock_kick()` via hypervisor call interface. |
| |
| 4. Hardware/Hypervisor Mismatch (Zen 4 APIC / CPUID Leaf) |
| CPU triggers instruction page fault (`CR2 == RIP: ffffffff8104ed58`). |
| |
| 5. Fatal Exception in Interrupt Context |
| Page fault handler cannot sleep during ISR --> IMMEDIATE KERNEL PANIC. |
+-----------------------------------------------------------------------------------+


3. Theoretical Deep Dive: Why Does This Happen?
1. Paravirtualized (PV) Spinlocks (kvm_pv_unhalt)
When multiple virtual CPUs compete for a spinlock, standard spinlocks cause idle vCPUs to loop continuously, wasting host CPU cycles. To solve this, KVM implements PV Spinlocks. When a vCPU is blocked on a lock, KVM halts the vCPU (kvm_pv_unhalt). When the lock holder releases the lock, it calls kvm_unlock_kick() to instruct the hypervisor to wake up the waiting vCPU.
2. The Microarchitecture Gap (AMD Zen 4 vs. Kernel 3.13)
Linux Kernel 3.13 was released in early 2014. Modern AMD Zen 4 processors (Ryzen 7000 series, released in 2022) feature drastically updated hardware virtualization constructs (SVM), modified Local APIC topologies, and restructured hypervisor CPUID leaves.
When KVM presents modern Zen 4 host capabilities to an ancient 2014 kernel:
- The kernel detects KVM paravirtualization flags and enables
kvm_unlock_kick(). - When storage interrupts trigger rapid spinlock requests, the kernel attempts to invoke the hypervisor kick routine using legacy APIC register assumptions.
- The instruction execution fails on Zen 4 hardware, raising an asynchronous page fault (
async_page_fault) inside an un-pageable interrupt handler.
4. Troubleshooting Workflow: What Failed and Why
+-----------------------------------------------------------------------------------+
| TROUBLESHOOTING MATRIX |
+-------------------------------------+---------------------------------------------+
| Attempt | Result & Technical Cause |
+-------------------------------------+---------------------------------------------+
| 1. Change CPU model to `kvm64` or | FAILED: Proxmox Web UI CPU dropdowns alter |
| `qemu64` in Web UI | user-space instructions, but leave KVM PV |
| | CPUID hypervisor leaves active. |
+-------------------------------------+---------------------------------------------+
| 2. Add `nopvspin` to guest GRUB | PARTIALLY FAILED: System panics before |
| boot parameters | reaching GRUB or during early SCSI softirq |
| | initialization. |
+-------------------------------------+---------------------------------------------+
| 3. Command-Line KVM Feature Masking | SUCCESS: Removes PV spinlock & EOI features |
| `qm set <VMID> --args "..."` | at the hypervisor level before boot. |
+-------------------------------------+---------------------------------------------+
| 4. Switch storage controller from | SUCCESS: Bypasses bugged VirtIO SCSI IRQ |
| VirtIO SCSI to SATA | stack in legacy kernel. |
+-------------------------------------+---------------------------------------------+
Why the Proxmox UI CPU Dropdown Failed
Selecting kvm64, qemu64, or x86-64-v2 in the Proxmox Web UI changes the CPU instruction capabilities presented to user-space applications (e.g., hiding AVX or SSE instructions). However, QEMU continues to expose KVM-specific hypervisor feature leaves (0x40000000) to the guest kernel. The guest kernel still identifies itself as running under KVM and continues to call kvm_unlock_kick().
Why GRUB Modifications Were Insufficient

While adding nopvspin to GRUB tells Linux not to use PV spinlocks, applying this inside a VM that cannot boot creates a catch-22. Furthermore, nopvspin only disables spinlocks—it does not disable Paravirtualized End-Of-Interrupt (kvm_pv_eoi), which continues to crash the storage subsystem under SCSI I/O load.
5. The Complete Resolution
To permanently fix the boot crash, we must modify the QEMU flags at the hypervisor level and adjust the virtual storage topology.
Step 1: Strip KVM PV Features via Proxmox CLI
Open the Proxmox Host Shell (or SSH into your Proxmox node) and execute:
qm set 104 --args "-cpu host,-kvm_pv_unhalt,-kvm_pv_eoi"
(Replace 104 with your Metasploitable 3 VM ID).
How This Fixes the Root Cause:
-kvm_pv_unhalt: Completely strips the PV spinlock capability from the CPUID flags presented to the guest. Kernel 3.13 falls back to native architecture ticket spinlocks, bypassingkvm_unlock_kick()entirely.-kvm_pv_eoi: Disables paravirtualized interrupt signaling, forcing the guest to use standard hardware APIC interrupt clearing.
Step 2: Remap Disk Controller from SCSI to SATA
- Log into Proxmox Web UI, navigate to VM 104 > Hardware.
- Select the hard disk and click Detach.
- Select the detached Unused Disk 0, click Edit, and set Bus/Device to SATA (or IDE).
- Click Add.
- Navigate to VM 104 > Options > Boot Order, enable the new SATA disk, and drag it to the top.
+-----------------------------------------------------------------------------------+
| CORRECT VM HARDWARE PROFILE |
+-----------------------------------------------------------------------------------+
| [ Proxmox VE Hypervisor ] |
| | |
| +-- CPU Config: -cpu host,-kvm_pv_unhalt,-kvm_pv_eoi |
| | (Masks PV spinlocks & PV EOI from guest kernel) |
| | |
| +-- Disk Controller: SATA Interface (Emulated) |
| (Bypasses broken VirtIO SCSI driver softirq stack) |
| |
| [ Guest OS: Metasploitable 3 (Ubuntu 14.04 / Kernel 3.13) ] |
| --> Boots cleanly to login prompt (`vagrant` / `vagrant`) |
+-----------------------------------------------------------------------------------+

6. Verification and Takeaways
After applying the hypervisor CLI arguments and switching the disk bus to SATA, power on the VM. Metasploitable 3 boots cleanly to the console prompt:
Ubuntu 14.04.5 LTS metasploitable3 tty1
metasploitable3 login: vagrant
Password:
Last login: Wed Nov 16 20:30:11 UTC 2016 on tty1
vagrant@metasploitable3:~$ uname -r
3.13.0-100-generic

Key Technical Lessons:
- Understand Kernel Stack Traces: A
RIPmatchingCR2points to an instruction-fetch page fault, while aFatal exception in interruptmeans a fault occurred inside an ISR context where recovery is impossible. - Web UI vs. Low-Level QEMU Args: High-level hypervisor GUIs do not always expose low-level CPUID paravirtualization flags. Using
qm set <vmid> --argsallows fine-grained CPU feature masking. - Legacy OS Considerations: When running kernels older than 2015 on modern microarchitectures (Zen 4, Alder Lake/Raptor Lake), disable PV spinlocks and stick to legacy SATA/IDE storage interfaces.