Jump to content

Virtualize a Virtual Machine on a virtual machine in a Virtual Machine on a Desktop.

Go to solution Solved by WereCatf,
3 hours ago, Kisai said:

Then go do the experiment the OP wants and prove it.

Here is Ubuntu 19.10 running under VMware, called Ubuvm, with nesting enabled in VMware and 4 CPU-cores given to the VM. I ran the command kvm-ok in terminal to test if it finds HW VM-instructions enabled in the CPU and it does. On the same VM, I am running another Ubuntu 19.10 in a nested VM with 4 CPU-cores given to the VM and there I have also ran kvm-ok, which also finds HW VM-instructions enabled.

nest1.thumb.jpg.c7b5f5d88d30283a1a530f1dafd01d55.jpg

 

On both the first VM and then the nested VM I run sysbench (sysbench --threads=4 --cpu-max-prime=40000 --events=21000 --time=0 --test=cpu run) via ssh, just so display-processing doesn't cause any noticeable difference and.. well, there is very little difference in the results. There would be, if HW virtualization wasn't working correctly.

nest2.thumb.jpg.49d1aac188f2639b6513180529f6c31d.jpg

 

Would you like to insist for me to go deeper, or do you accept this?

Hey Linus and Community!  :-D.

 

How are you all doing?, I'm new to the Linus tech tips forum, but I'm a long time follower of Linus's Videos.

 

As stated above is this even feasibly in the realm of possibility????, if it is I would love to see it done(I'm poor so I lack the hardware).

 

But Linus is crazy, I hope he's crazy enough for this, SQUARE UP LINUS.

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, BigSpice said:

As stated above is this even feasibly in the realm of possibility?

Yes, it is. It's just nested VMs, I've done it multiple times myself. There's literally nothing special about it.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, WereCatf said:

Yes, it is. It's just nested VMs, I've done it multiple times myself. There's literally nothing special about it.

Whats the LIMIT.

New.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, BigSpice said:

So the 2TB Memory Video could be put to purpose once more yes?

Sure, if one really wanted. It'd be entirely pointless, but sure.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

I don't have a server with 2TB of RAM but I do have one with 0.5TB. I could test this but realistically if the hypervisor only allows you to give up to 50% of your RAM to any one VM then basically divide how much you have by 2 as many times as it takes to reach a quantity too small for modern software to run on (probably the sub-1GB range.) and you have your answer without doing all the work.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Windows7ge said:

modern software

Some linux based o/s are miniscule for memory needs.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, greenmax said:

Some linux based o/s are miniscule for memory needs.

That may be but they have to support the hypervisor. Best case scenario it let's you run a VM with 512MB maybe 256MB. If you drop down to 128MB I can't say if modern Linux distros would keep up. Even SparkyLinux needs about 750MB and I have no idea if it's equipped to run a hypervisor.

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Windows7ge said:

I don't have a server with 2TB of RAM but I do have one with 0.5TB. I could test this but realistically if the hypervisor only allows you to give up to 50% of your RAM to any one VM then basically divide how much you have by 2 as many times as it takes to reach a quantity too small for modern software to run on (probably the sub-1GB range.) and you have your answer without doing all the work.

You can run a modern Linux-distro just fine even with only 256MB RAM, if you skip running a desktop-environment on it. Thus, if we set the minimum limit to 256MB and assume that each hypervisor can only give 50% of the RAM given to itself to a guest, we can run 12 nested VMs on 512GB RAM, if my quick maths is right.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, WereCatf said:

You can run a modern Linux-distro just fine even with only 256MB RAM, if you skip running a desktop-environment on it. Thus, if we set the minimum limit to 256MB and assume that each hypervisor can only give 50% of the RAM given to itself to a guest, we can run 12 nested VMs on 512GB RAM, if my quick maths is right.

Going from 512GB -> 256GB is for the initial VM.

Nesting starts at 128GB.

 

Then if the final nested VM was at 256MB that should be 10. 11 if you want to count the initial VM.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Windows7ge said:

if you want to count the initial VM

Personally, I count the first one as well. I mean, it's VM-level 0, whether it is nesting anything or not.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, WereCatf said:

Personally, I count the first one as well. I mean, it's VM-level 0, whether it is nesting anything or not.

Eh, nested within the native OS. I'll give you that. 11 then.

 

Honestly I think I'd run into system performance issues before I got anywhere near 11. I tried going 3 layers in one time and it was abominable. So slow. I probably could have made it to 5 before everything just stopped working completely.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, BigSpice said:

Hey Linus and Community!  :-D.

 

How are you all doing?, I'm new to the Linus tech tips forum, but I'm a long time follower of Linus's Videos.

 

As stated above is this even feasibly in the realm of possibility????, if it is I would love to see it done(I'm poor so I lack the hardware).

 

But Linus is crazy, I hope he's crazy enough for this, SQUARE UP LINUS.

This is impractical since you lose the VM hardware support after the first VM layer. But since you didn't ask "how many times can I nest a VM and still have it function", sure, technically you can nest more PVM's inside a VM, but a VMception is really just a pain in the butt to setup and there is no practical use case for any nested VM's other than compiling/encoding stuff that doesn't need anything but CPU resources.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

56 minutes ago, Kisai said:

This is impractical since you lose the VM hardware support after the first VM layer

No, you don't. I have told you before and I tell you again: that is not how it works.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, WereCatf said:

No, you don't. I have told you before and I tell you again: that is not how it works.

Then go do the experiment the OP wants and prove it. Because I don't care what you say when the people who write the software say otherwise.

 

Quote

An Intel processor with VT-x and EPT technology -- nesting is currently Intel-only.

https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/nested-virtualization

Quote

How nested virtualization works

Modern processors include hardware features that make virtualization faster and more secure. Hyper-V relies on these processor extensions to run virtual machines (e.g. Intel VT-x and AMD-V). Typically, once Hyper-V starts, it prevents other software from using these processor capabilities. This prevents guest virtual machines from running Hyper-V.

Nested virtualization makes this hardware support available to guest virtual machines.

 

 

https://wiki.xenproject.org/wiki/Nested_Virtualization_in_Xen

Quote

Running PV guests as an L2 has been supported in Xen since the introduction of HVM guests in Xen 3.0. Support for HVM guests as L2 guests is heavily dependent on architecture-specific support. Nested HVM on AMD CPUs is considered "experimental". Nested HVM on Intel CPUs, as of Xen 4.4, is considered "tech preview". For many common cases, it should work reliably and with low overhead. However, there are some important limitations, and we do not recommend that it be used in a production environment at this time.

 

https://www.cloudshare.com/blog/cloudshare/blogvmware-esxi-nested-virtualization

 

https://communities.vmware.com/docs/DOC-8970

Quote

Running Guest Hypervisors with Virtualized HV

Most hypervisors require hardware-assisted virtualization (HV). VMware products require hardware-assisted virtualization for 64-bit guests on Intel hardware. When running as a guest hypervisor, VMware products also require hardware-assisted virtualization for 64-bit guests on AMD hardware.  The hardware-assisted virtualization features of the physical CPU are not typically available in a VM, because most hypervisors (from VMware or others) do not virtualize HV. However, Workstation 8, Player 4, Fusion 4, and ESXi 5.0 (or later) offer virtualized HV, so that you can run guest hypervisors which require hardware-assisted virtualization.

 

With virtualized HV enabled for the outer guest, you should be able to run any guest hypervisor that requires hardware-assisted virtualization. In particular, this means that you will be able to run 64-bit nested guests under VMware guest hypervisors.

 

None of the Virtualization products recommend it, and they all point to each other and go "they don't support it, but we do", when the truth is closer to "use my product instead."

 

So that goes right back to "you lose the hardware virtualization" comment again. As I'm pretty sure you're not getting a L3 HVM to work except until some very controlled circumstances.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Kisai said:

Then go do the experiment the OP wants and prove it

I have done it, like I have mentioned before. I just happen to use VMware and KVM, not hyper-v.

 

Besides, did you even read what you quoted? There's a direct sentence that says "Nested virtualization makes this hardware support available to guest virtual machines." -- BOOM, you shot your own claims down right there. Also, the article is from 2016; I have no idea if hyper-v supports nesting under AMD-hardware, but VMware and KVM certainly do.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Kisai said:

Then go do the experiment the OP wants and prove it.

Here is Ubuntu 19.10 running under VMware, called Ubuvm, with nesting enabled in VMware and 4 CPU-cores given to the VM. I ran the command kvm-ok in terminal to test if it finds HW VM-instructions enabled in the CPU and it does. On the same VM, I am running another Ubuntu 19.10 in a nested VM with 4 CPU-cores given to the VM and there I have also ran kvm-ok, which also finds HW VM-instructions enabled.

nest1.thumb.jpg.c7b5f5d88d30283a1a530f1dafd01d55.jpg

 

On both the first VM and then the nested VM I run sysbench (sysbench --threads=4 --cpu-max-prime=40000 --events=21000 --time=0 --test=cpu run) via ssh, just so display-processing doesn't cause any noticeable difference and.. well, there is very little difference in the results. There would be, if HW virtualization wasn't working correctly.

nest2.thumb.jpg.49d1aac188f2639b6513180529f6c31d.jpg

 

Would you like to insist for me to go deeper, or do you accept this?

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×