How to enable nested virtualization in ubuntu












22














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.










share|improve this question






















  • Not sure they're appropriate replacements, but I want to mention user-mode linux (more links) - LXC (Linux Containers) - chroot - Linux namespaces (supported from kernel 3.8 upwards)
    – ignis
    Aug 6 '13 at 9:37


















22














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.










share|improve this question






















  • Not sure they're appropriate replacements, but I want to mention user-mode linux (more links) - LXC (Linux Containers) - chroot - Linux namespaces (supported from kernel 3.8 upwards)
    – ignis
    Aug 6 '13 at 9:37
















22












22








22


6





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.










share|improve this question













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.







virtualbox virtualization






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 5 '13 at 2:22









王子1986王子1986

1,30051829




1,30051829












  • Not sure they're appropriate replacements, but I want to mention user-mode linux (more links) - LXC (Linux Containers) - chroot - Linux namespaces (supported from kernel 3.8 upwards)
    – ignis
    Aug 6 '13 at 9:37




















  • Not sure they're appropriate replacements, but I want to mention user-mode linux (more links) - LXC (Linux Containers) - chroot - Linux namespaces (supported from kernel 3.8 upwards)
    – ignis
    Aug 6 '13 at 9:37


















Not sure they're appropriate replacements, but I want to mention user-mode linux (more links) - LXC (Linux Containers) - chroot - Linux namespaces (supported from kernel 3.8 upwards)
– ignis
Aug 6 '13 at 9:37






Not sure they're appropriate replacements, but I want to mention user-mode linux (more links) - LXC (Linux Containers) - chroot - Linux namespaces (supported from kernel 3.8 upwards)
– ignis
Aug 6 '13 at 9:37












2 Answers
2






active

oldest

votes


















30














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.






share|improve this answer





















  • 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 '15 at 7:20






  • 3




    command to check if your CPU support KVM: egrep -c "(svm|vmx)" /proc/cpuinfo. 0 means no.
    – Woeitg
    Feb 3 '17 at 10:07



















2














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.






share|improve this answer























  • 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.
    – George Bungarzescu
    Dec 19 '18 at 10:49













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f328748%2fhow-to-enable-nested-virtualization-in-ubuntu%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









30














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.






share|improve this answer





















  • 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 '15 at 7:20






  • 3




    command to check if your CPU support KVM: egrep -c "(svm|vmx)" /proc/cpuinfo. 0 means no.
    – Woeitg
    Feb 3 '17 at 10:07
















30














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.






share|improve this answer





















  • 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 '15 at 7:20






  • 3




    command to check if your CPU support KVM: egrep -c "(svm|vmx)" /proc/cpuinfo. 0 means no.
    – Woeitg
    Feb 3 '17 at 10:07














30












30








30






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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 6 '13 at 9:50









ignisignis

3,2731924




3,2731924












  • 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 '15 at 7:20






  • 3




    command to check if your CPU support KVM: egrep -c "(svm|vmx)" /proc/cpuinfo. 0 means no.
    – Woeitg
    Feb 3 '17 at 10:07


















  • 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 '15 at 7:20






  • 3




    command to check if your CPU support KVM: egrep -c "(svm|vmx)" /proc/cpuinfo. 0 means no.
    – Woeitg
    Feb 3 '17 at 10:07
















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 '15 at 7:20




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 '15 at 7:20




3




3




command to check if your CPU support KVM: egrep -c "(svm|vmx)" /proc/cpuinfo. 0 means no.
– Woeitg
Feb 3 '17 at 10:07




command to check if your CPU support KVM: egrep -c "(svm|vmx)" /proc/cpuinfo. 0 means no.
– Woeitg
Feb 3 '17 at 10:07













2














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.






share|improve this answer























  • 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.
    – George Bungarzescu
    Dec 19 '18 at 10:49


















2














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.






share|improve this answer























  • 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.
    – George Bungarzescu
    Dec 19 '18 at 10:49
















2












2








2






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.






share|improve this answer














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.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 7 at 0:39

























answered Dec 19 '18 at 10:20









George BungarzescuGeorge Bungarzescu

213




213












  • 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.
    – George Bungarzescu
    Dec 19 '18 at 10:49




















  • 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.
    – George Bungarzescu
    Dec 19 '18 at 10:49


















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.
– George Bungarzescu
Dec 19 '18 at 10:49






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.
– George Bungarzescu
Dec 19 '18 at 10:49




















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f328748%2fhow-to-enable-nested-virtualization-in-ubuntu%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?