Like all other virtualization, any kind of nested virtualization is considered YMMV (experimental, not officially supported).
I’ve personally experimented periodically on various virtualization technologies sporadically on a whim, but have had only middling to no success in the past.
So, that should at least be a point of reference for others…
- Keep your expectations in check.
- Always look for the latest info, dates are important. Exclude for the most part anything published over a year ago as a reliable guide but still read articles looking for individual gems of technical importance.
The article Malcolm suggests is therefor a bit old to be used reliably.
It doesn’t look completely unuseful, but more recent references will describe things differently.
Skimming a number of articles on this subject (Nested virtualization, specifically an ESXi Guest on a KVM host)
- You have the option of implementing QEMU instead of KVM paravirtualization. QEMU is a related but different virtualization technology that was absorbed into other virtualization like KVM and Xen a few years ago. QEMU “proper” has certain advantages in emulation over the technologies its been absorbed into, and <maybe> this is one situation it might be helpful. The following writer made this work… I don’t know if the required features are already in openSUSE KVM-QEMU, but if not the article describes how to build and enable…
https://www.server-world.info/en/note?os=CentOS_7&p=kvm&f=12
- The current official KVM reference for enabling nested virtualization. Short, but important info you shouldn’t overlook.
https://www.linux-kvm.org/page/Nested_Guests
- The following is old, so maybe none of what is in the following article is relevant. But, the guy did overcome several obstacles for the technologies of his time. May be a useful reference if you run into anything similar
https://rwmj.wordpress.com/2014/05/19/notes-on-getting-vmware-esxi-to-run-under-kvm/
Also,
IMO is notable that no article I skimmed including most recent ones that were using libvirt mentioned that you’d also want to enable the setting in the Guest properties that turn on nested virtualization. Of course, this setting is probably ineffective if nested virtualization isn’t enabled at a lower level (see the KVM reference I provided you above)
Lastly,
In my own experiments I determined that each time your nested virtualization changed hypervisors, you’d likely experience further performance degradation. Because of that, my more recent experiments have focused on using the same virtualization technology at every level. Just the ability to use different hypervisors with any prospect for working at all is probably relatively recent, within the past 2-3 years.
On a slight tangent,
I also did a search to see if anyone has built ESXi into a Linux container…
Seems to me that the prospects would be good and would avoid all this mess involving nested virtualization by removing one of the virtualization layers (Anything running in a container is running on bare metal).
Surprised that I didn’t get any search hits. Either people have tried it and failed without saying anything or I’m just lousy at keyword selection.
This is how I currently run “nested” applications but in reverse of what you’re trying to do… Instead of running virtualization in a container, I run containers in my Guests and this works for every virtualization technology… And there is plenty about VMware building out this approach.
Good Luck,
TSU