Linux-KVM has some support for nested virtual machines. I've asked on the KVM IRC channel and have gotten the following information (but don't take my word, try it yourself):
- AMD CPUs should work well, guests with Xen and Hyper-V are known to work,
- Intel CPUs need the latest KVM Git source code, and only guests with KVM work
I haven't tried this myself yet. A search for "KVM nested" should give you enough info to try it yourself.
EDIT: KVM will run on a Linux host only. I haven't gotten any reliable info on Windows virtualization software concerning proper nested VM support. By 'proper' I mean that the hypervisor exposes virtualization extensions to the guest. You can always run a nested VM using a pure software hypervisor (e.g. dynamic translation), but that will be noticably slower.
EDIT: Bochs, which you mentioned, is a software-only hypervisor. This means that it will always be slow, and it's irrelevent if the hypervisor on the host exposes virtualization extensions to the guest (like KVM does). Most other virtualization softare (KVM, VirtualBox, VMWare) however can make use of those extensions and will perform much better if they are available.
2VirtualMachine-ception :D You have the danger of losing track of how many levels deep in virtual machines you are. That moment when you realise you just corrupted your physical hard disk instead of one of the nested virtual ones you were meant to be testing on :P – developerbmw – 2015-05-19T10:38:22.487
1Dual booting is Linux and Windows is relatively easy to do, and the end result runs much more quickly. The only real downside being you have to reboot to switch OSes. – lyallcooper – 2011-07-19T20:44:36.293
@AUAnonymous: I know that, but I want to keep running Windows. – Javier – 2011-07-19T20:58:27.330
It's just always an option if you don't manage to get the VMs working or if they don't work too well. – lyallcooper – 2011-07-19T21:11:53.080
While you could do a great deal of work with this sort of setup, I strongly urge you to investigate Simics if you are going to be writing a serious kernel. The insight and debugging alone are priceless, however it is rather expensive. – Tim Post – 2011-07-20T03:11:00.147
12
I'm going to argue that this question is poorly titled. Bochs isn't virtualization software in the same sense as VirtualBox and VMWare. It is an emulator. It offers no CPU virtualization. The distinction here is not merely pedantic. You can expect an emulator like bochs to work inside a VM with fairly high confidence. Running a true virtualization software "nested" in a VM is a much trickier problem. For example, this feature was only implemented in VMWare as of Fusion 4.
– superbatfish – 2013-05-22T22:03:47.333