DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk5 min

How to Enable and Troubleshoot Nested Virtualization in KVM on x86

A practical x86 KVM guide to enabling nested virtualization, passing CPU features to a guest hypervisor, checking acceleration, and diagnosing slow or unbootable nested VMs.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To run a virtual machine inside a KVM guest, enable or verify nested virtualization on the physical KVM host (L0), expose the required CPU virtualization features to the guest hypervisor (L1), and confirm that KVM—not QEMU’s TCG software emulation—is accelerating L1. The virtual machine started by L1 is L2. Nested virtualization is documented as enabled by default on Intel and AMD with Linux kernel 4.20 and later, but a distribution can override that setting.

Identify the virtualization layers first

In this setup, L0 is the physical Linux host running KVM, L1 is the virtual machine running a hypervisor, and L2 is a VM created by L1. Nested virtualization lets a guest run another guest; the inner hypervisor can be KVM or a different hypervisor, as the Linux kernel’s nested-guest guide explains.

As an Amazon Associate I earn from qualifying purchases.

Confirm that these are the layers you mean before troubleshooting. A VM running under QEMU with TCG emulation is not the same as KVM accelerated inside a guest, even if the VM starts successfully.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check whether nesting is enabled on L0

The Linux kernel documents nested virtualization as enabled by default for Intel and AMD beginning with kernel v4.20. That is a default, not a guarantee for every distribution or running host: module configuration can override it. Check the active setting on L0 rather than relying on the documented default.

  1. For Intel: run cat /sys/module/kvm_intel/parameters/nested on L0.
  2. For AMD: run cat /sys/module/kvm_amd/parameters/nested on L0.
  3. Check the output against your distribution’s kernel and module configuration. If nesting is disabled, consult that distribution’s instructions for making the setting persistent and applying it.

Changing a module parameter may require reloading the KVM module. Do not unload an in-use host module casually: first determine whether VMs are running and follow the distribution’s operational guidance. The kernel guide covers the parameter and configuration details in its nested KVM documentation.

Expose virtualization features to L1

Enabling nesting on L0 is not enough by itself. L1 must receive the CPU virtualization features its hypervisor needs. Configure the CPU model presented by the QEMU or libvirt setup that launches L1, then verify what L1 actually sees.

CPU exposure choice When it fits Trade-off
QEMU -cpu host When L1 should see the host CPU’s available capabilities. Exposes host capabilities; this may be unsuitable as a stable CPU baseline for migration across different hosts.
A named CPU model with the required virtualization feature enabled When a more consistent CPU baseline is important, such as for migration planning. The model and feature set must be supported by the host, QEMU/libvirt configuration, and L1’s requirements.

There is no universally correct CPU model: the right choice depends on host capabilities, software versions, and migration requirements. Confirm feature exposure from inside L1 instead of assuming that a setting on L0 was passed through. The kernel guide gives CPU configuration examples and caveats in Running nested guests with KVM.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify that L1 is using KVM acceleration

If L1 cannot launch L2, first establish whether KVM is active inside L1. QEMU can run with TCG emulation instead; that is not KVM-on-KVM acceleration. Check that /dev/kvm exists in L1, that the KVM modules are loaded there, and that the VM launch configuration actually enables KVM acceleration. A VM booting is not proof that it is using KVM.

Rank #3
TESmart 16X1 HDMI KVM Switch 16 Port 4K@30Hz, EDID, USB 2.0, Rackmount KVM
  • 16 IN 1 OUT HDMI KVM Switch 4K@30Hz: This HDMI Switch gives you the flexibility of controlling up to 16 HDMI computers from a single USB keyboard, USB mouse, and monitor console. Support resolution up to 3840*2160@30Hz 4:4:4
  • USB 2.0 Ports & Auto Switching: With extra standard two USB 2.0 hub ports, it is possible to connect bar code scanner, USB hard drive or other USB devices to KVM just as you have plug these devices directly to computer. Available to use keyboard and mouse without any delay after switching computers. Support auto switching to monitor computers in a specified time interval
  • Standard 1U 19-inch rack mount: With 8 Pcs 5ft(1.5m) HDMI USB KVM Dedicated Cable, eliminate the troubles you find matching cable, save your time and extra expenses. It is perfect for standard 1U height and 19-inch Cabinet/Rack Design if you maybe use Cabinet/Rack. With 2 Pcs Rack Ears perfect use for Standard 1U 19-inch Cabinet/Rack
  • EDID Emulator: With EDID emulators in every input ports, keep PCs always have correct display information, prevent display settings changed while switching input ports
  • 7 Switching Methods: Easy to control KVM via IR remote, front panel key, keyboard hot keys, mouse wheel switching, RS232 port, IP commands and auto detect mode

Also check that L1 sees the virtualization extensions and CPU features needed by its hypervisor. If those features are absent, revisit both the L0 nested setting and the CPU model used to launch L1.

Troubleshoot by where the failure occurs

  • L1 cannot see virtualization features: recheck the active nesting parameter on L0 and the CPU model used for L1. Verify the feature visibility inside L1.
  • L1 sees the features, but its VMs are not accelerated: check for /dev/kvm and confirm that L1’s QEMU or hypervisor is configured to use KVM rather than TCG.
  • L2 will not boot: verify that L1’s hypervisor supports the required feature set and that the L0 and L1 configuration is consistent. Not every VMX feature is fully supported by KVM.
  • L2 boots but performs poorly: check the vendor-specific performance settings below and compare the actual hardware and software versions at both levels. The available kernel documentation does not establish a universal nested-virtualization overhead figure.
  • Migration or save/restore fails: check the CPU vendor, whether L2 is running, and the Linux kernel and QEMU versions against the documented limitations below.

Investigate slow nested guests without assuming a speedup

For Intel systems, the kernel’s guidance points to settings including EPT and Shadow VMCS when investigating a slow L2. It also describes Shadow VMCS and APIC virtualization in connection with sufficiently capable hardware. Treat these as diagnostic checks, not a guaranteed performance fix: results depend on the platform and configuration.

Rank #4
16 Ports KVM Switch HDMI 4K@60Hz EDID Simulation,1U Rack Mount USB 3.0 HDMI KVM Switch for 16 Computers/Servers, with 6 USB3.0 Port,TF/SD,Audio RS232, Wired Remote & 12V Power + 16 USB Cable Included
  • 【16 Port HDMI KVM Switch】This 16 ports KVM switch can control up to 16 computers to share 1 monitor with 1 set of Wired or Wireless keyboard mouse. You can easily switch by panel button,wired remote(included) or RS232 between 16 computers on 1 monitor and share 6 USB 3.0 devices.
  • 【KVM Switch with EDID Emulation】 ANGEET 16 Port HDMI KVM switch emulates display EDID, stores resolution/refresh rate, and maintains original window positions across 16 computers—eliminating the window re-arrangement hassle of ordinary KVM switches.
  • 【Ultra HD 4K@60Hz】This 16 computers USB 3.0 KVM switch HDMI support resolution up to 4K@60Hz and backward compatible 4K@30Hz, 2560*1440@120Hz. The 4K KVM Switches also work with ultrawide monitors.
  • 【 USB 3.0 KVM Switch 】HDMI KVM switch with 6 USB 3.0 ports and SD/TF card slot for sharing keybaord, mouse, printer, U disk and SD/TF card.Supports ultra-fast USB 3.0 data transfer up to 5Gbps.10 times faster than USB2.0, transfer files in seconds.
  • 【3 Switching Modes】 This 16 ports HDMI KVM switch supports panel buttons (1-16 corresponding to 16 PCs), 1.5m wired remote (with digital display) and RS232 (baud rate: 115200). LED indicates active device.

The cited documentation provides no workload-independent performance penalty or expected percentage. Compare the exact L0 and L1 hardware, kernel, QEMU, and hypervisor configuration before attributing slowness to nesting itself. See the kernel’s Nested VMX documentation for implementation context.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check vendor and version limits before migration

Migration behavior depends on vendor, software versions, and whether a nested guest is active. The kernel documentation distinguishes these cases:

Situation documented by the Linux kernel Guidance
Intel x86 L1 has an active L2 Migration support is documented as working with Linux kernel 5.3 and QEMU 4.2.0 and later.
AMD L1 has started an L2 Do not migrate L1 or save and restore it until L2 has shut down; the documented result is undefined and may be unstable.

The kernel guide also states that L2 migration is expected to work in the scenarios it specifies. These are version-sensitive implementation notes, not a substitute for validating the exact production stack. Review the current kernel migration guidance before designing a migration procedure.

Collect useful evidence when the problem persists

A useful report should let someone trace both the outer and inner hypervisor configurations. Collect the following from L0 and L1 where applicable:

  • Linux kernel, QEMU, and libvirt versions.
  • The complete QEMU command lines used to launch L1 and L2.
  • CPU information and lscpu output at both levels.
  • Full dmesg output from L0 and L1.
  • On x86, the kernel guide additionally suggests x86info -a and dmidecode output from both levels.

Include the CPU vendor and state whether L2 was running when the failure occurred. That distinction matters especially for migration and save/restore issues.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand what nested KVM does not guarantee

KVM aims to provide a standard VMX implementation, but the kernel’s Nested VMX documentation notes that not all VMX features are fully supported. The CPU virtualization limitations page also documents an AMD nested SVM debug-exception behavior that KVM does not fully virtualize. A nested hypervisor therefore should not be assumed to behave identically to one running directly on bare metal.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.