Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
while there's no practical case for doing this, perhaps beyond 2 levels deep, sometimes some people do this just to see if they can or to see how much it slows down, i'm curious who has tried this and how deep they got with which virtualization technology on what physical hardware host (or cloud provider as the case may be).
why? embedding VMs into VMs is possible, depends only on the available resources (if you have enough resources to start a new VM). But as you told there is no practical case. It is extremely inefficient.
If I remember well we created an openstack environment inside a VM, probably that was 2 or 3 levels deep (altogether). Also started to test some software inside, but unfortunately I can't remember the details. It was definitely not a performance test. Usually we want to avoid that situation.
if you are into systems or system setup or such, you may want to just play around. i did back in my mainframe days when i had an IBM 370/158 (8 MB memory) all to myself. i managed to run IBM's VM/CP (runs directly on hardware or as a guest OS in a VM) 6 levels deep before i ran out of spare disk space. it was a lot slower by this point. and it bogged down the host system rather hard, too, which is why i didn't try this on our primary machines.
i am also curious how well VirtualBox performs like this compared to QEMU/KVM with various Linux setups.
it's all for fun. those who have never done fun things on their own computers need not bother trying to answer in this thread.
Most modern VM's have pretty good resource management. You just have to have almost unlimited resources to run almost unlimited nested VM's. Each VM has a bit of overheard and then the OS.
I run embedded VMs at work daily. Doing it as we speak. My attack box (jump box) is a Windows box which is a VM hosted on VMware (huge enterprise host somewhere). On that jump box, I run VirtualBox which hosts my Kali instance. Works perfectly That's as deep as I go though - no point in any more for me anyway.
You limit the resources of every VM and you need to divide these resources among the embedded VMs. That may mean you will be low on resources in the 3rd level, because there will be no [enough] resource to manage.
From the other hand every VM has its own [virtual] memory manager and that means on the 4th level [of nested VMs] you will have 4 (or 5) memory managers working "together" to try to serve its processes - without knowing anything about the other VMs. That will make the full system unstable, unreliable and most probably useless.
Embedding VMs only one by one into each other is just wasting resources (like in post #5), but can work without problems - if you have enough resources to waste.
Most modern VM's have pretty good resource management. You just have to have almost unlimited resources to run almost unlimited nested VM's. Each VM has a bit of overheard and then the OS.
Nothing can get past the need for resources.
so you are saying that i can run as many levels of VMs as i have resources for?
i have about 16GB of RAM and 1TB of storage to play with. how many levels do you think someone could achieve with that and their choice of distro and VM software (same at each level except the first host, configured best for this effort)? a VM that need a zillion libraries would be one that i would avoid.
i already "play" with resources like trying to run the largest buffers i can in a process to see how slow everything else comes to be. i do other kinds of resource consuming "playing around" like that when not running anything serious on here (as i am right now, running 3 concurrent copies of ffmpeg for the past 2 weeks reformatting over a hundred MP4 videos into WEBM/VP9 format to save space).
each level of VM will need to be configured with enough resources to run all the levels it hosts. each level would be smaller and smaller until the last can barely run helloworld.
I run embedded VMs at work daily. Doing it as we speak. My attack box (jump box) is a Windows box which is a VM hosted on VMware (huge enterprise host somewhere). On that jump box, I run VirtualBox which hosts my Kali instance. Works perfectly That's as deep as I go though - no point in any more for me anyway.
are you running an embedded distro as the guest OS?
In my case, most of our servers are virtualized on VMWare. I and each of my testers has their own server jump box that we attack hosts from. On each of those virtualized hosts, we run Kali Linux in VirtualBox. Performance is near bare metal, as far as I am concerned. I have no idea what the physical VMWare hosting server is though, but I believe it is quite beefy.
I thought about this question a long time ago. I can give it a try.
Research problem:
Virtual machine nesting ability test:
1. Is infinite nesting possible?
2. Actually feasible nesting level.
Conjecture: VMWare supports unlimited nesting.
Because VMWare supports virtualized VT and VTx, it is speculated that in theory, it can be nested infinitely. If the virtual machine's ability to "virtualize" does not decrease as the number of nesting levels increases, this assumption is true.
Experiment procedure:
The first layer is no problem, VMWare is successfully installed in the virtual machine.
Then when running VM-XP2, the splash screen was loaded, and then the VM crashed. There is no documentation for this magical error.
But the Linux virtual machine can run normally, and it runs in the VT-x/EPT virtualization mode
Therefore, it is certain that multi-level nesting is actually feasible. In fact, it is of course possible to use pure software to simulate hardware operations, such as Bochs. But the performance will drop by several orders of magnitude. The performance degradation of VM-XP is too severe. I think changing to VMWare, Hyper-V, VirtualBox, Xen or even Bochs with Linux and Windows may be better. Forget it, I can continue to do it anyway... I have lost the interest in studying how many levels can be nested, it doesn't make much sense anyway.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.