I would like to do some lib testing on my OS. So I need several environment to run KVM. And I found my guest machine was not able to run KVM.

I was using virtualbox 4.2.


3 Answers 3


KVM requires VT-X/AMD-V, but VirtualBox does not pass VT-X/AMD-V to the guest operating system.

Therefore, KVM can't run in VirtualBox (yet). Please track bug ticket #4032.

VT-X and AMD-V (so-called virtualization extensions) run the guest operating system natively in the CPU. Without them, the virtualization software must interpret the operating system opcodes in software, which is very slow.

For now, you can either

  • run KVM inside a hypervisor which passes virtualization extensions to the guest (e.g. KVM inside VMware Workstation 8), or
  • run another hypervisor inside VirtualBox (e.g. VirtualBox inside VirtualBox). This option will be very slow, because the guest will miss VT-X/AMD-V.
  • what about the possibility to run it in the host? e.g. share the folders he wants to test in his guest, and run say android emulation on the host? how is the performance of that?
    – Toskan
    Aug 12, 2015 at 7:20
  • 3
    command to check if your CPU support KVM: egrep -c "(svm|vmx)" /proc/cpuinfo. 0 means no.
    – Sadegh
    Feb 3, 2017 at 10:07

Virtualbox just released (12/18/2018) version 6 in which is expected to have nested virtualization. However, at this moment it seems is still unavailable on Intel procs. https://www.virtualbox.org/wiki/Downloads

Regarding the main question (Enable nested virtualization in Ubuntu) - KVM module is supporting nested virtualization on Ubuntu 16 and above (maybe lower versions too). Not sure about using XEN on host, but you can nest XEN in KVM for sure.

  • 4
    You can "activate" nested virtualization using: vboxmanage modifyvm yournestedvmname --nested-hw-virt on , or by adding <NestedHWVirt enabled="true"/> in CPU section of your .vbox file, but the only effect will be, the activation of the coresponding checkbox on the UI. cat /proc/cpuinfo on guest, still no vmx. Dec 19, 2018 at 10:49
  • As of 1 March , 2020 it works also on Intel processors (tested on i5, i7, and laptop procs ). Tested version VirtualBox 6.1.4, however you still need to use --nested-hw-virt on from command line in order to activate nested virtualization. You may use this for hyper-v/docker on windows test environment or even esxi. Previous version of virtualbox 6.1 (late december 2019, january 2020) may also work but not tested. You can check the timeline by reading change log virtualbox.org/… or git commits. Apr 12, 2020 at 11:42

Enable nested virtualization in KVM in UBUNTU Before enabling nested VT feature, power off all running VMs.

Next, unload KVM modules.

To unload KVM module on INTEL systems, run:

$ sudo modprobe -r kvm_intel

On AMD systems:

$ sudo modprobe -r kvm_amd

Reload the KVM module with the nested feature enabled on INTEL CPUs with command:

$ sudo modprobe kvm_intel nested=1

Reload the KVM module with the nested feature enabled on AMD CPUs using command:

$ sudo modprobe kvm_amd nested=1

Enable nested virtualization permanently according with:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .