What "nested virtualization" really means

This is for discussing general topics about how to use VirtualBox.
Post Reply
rogonma
Posts: 2
Joined: 29. Dec 2019, 01:08

What "nested virtualization" really means

Post by rogonma »

Hello

I have found some posts discussing about getting the nested virtualization to work but I have not found what does it mean, neither the manual nor the forums.

I have enabled VT-x in my BIOS and it is supossed to enhance my virtual machines performance, but... Do I really need to enable the "nested VT-x/AMD-V" setting in my virtual machines to let the BIOS setting to do its thing or this setting is only mandatory if I want to run a virtual machine inside the outer one, which have "nested VT-x" enabled?

This is a mess but I hope to be understood
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: What "nested virtualization" really means

Post by scottgus1 »

Nested virtualization is when you run a hypervisor (like Virtualbox) on a host PC, then you install a guest OS and install a second hypervisor in that guest, then run another guest OS inside that guest, like this:
Host PC
  > Virtualbox   >   Guest 1
                      > Virtualbox  > Guest 2
This sort of arrangement could be useful, as an example, if you have a super-well-provisioned strong server as the host PC and want to provide separate environments that clients or employees could use to run Virtualbox to spin up their own guests as they want without having to bother you as the IT department to spin up the guests for them. Somewhat like your own private Amazon AWS or MS Azure.

Here on the forums we only try to support Virtualbox on both levels. We wouldn't know what to do if you tried another hypervisor as one or the other levels.
rogonma wrote:Do I really need to enable the "nested VT-x/AMD-V" setting in my virtual machines
If you don't intend to run nested virtualization in your guests, you don't have to set this setting. There are some programs like development environments that might benefit, since they would use VT-x capabilities if it were present in the guest OS. I don't know if there is a performance enhancement or penalty if this setting is on or not, I don't have a host PC this is supported on.
rogonma
Posts: 2
Joined: 29. Dec 2019, 01:08

Re: What "nested virtualization" really means

Post by rogonma »

Got it!

I have only one level of virtualization. I run Virtualbox on my home PC yo try another OS and running development environments on them. The reason I was asking about VT-x is because it's enabled on my BIOS and despite that my VMs run too much slowly. I have an i7 and a lot of RAM, but I suppose the reason of the slowness is another one.

Thank you very much.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: What "nested virtualization" really means

Post by scottgus1 »

rogonma wrote:my VMs run too much slowly.
Zip and post a guest vbox.log from one of the slow guests and we might be able to find out why it's slow. Use the forum's Upload Attachment tab.
mateek
Posts: 8
Joined: 18. Jul 2015, 21:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Ubuntu, Windows

Re: What "nested virtualization" really means

Post by mateek »

I know I'm reviving an older subject. I'm wondering if there are any disadvantages at all to enabling VT-x?

The one big worry I have, which may be remnants of nightmares from VirtualBox of ten years ago, were, when the power went out, or I knocked the power strip attached to my host, getting the guest machine to work again was a major headache, and I remember a time or two that situation meant death for them.

You would think I'd learn my lesson, and I have a bit, but recently I upgraded my PC's ram, and my host started randomly crashing hard. Before someone leaps to say, 'you've got bad sticks, put the old ones back, or get different ones,' I can't afford any better ones whatsoever, and the old ones are slow. Also, weirdly, my PC has stopped crashing for over a week, where the original frequency was about every 3-4 days. The timing listed for them at the motherboards official site were way off, so I should have known what I was getting into, but I can even live with the crashes now (I hope). But I digress.

After those crashes from my upgrade, the guests seemed to degrade a bit. I really need to credit VirtualBox for all the work they've seemed to have accomplished in that area. I'm much more concerned about protecting my guests from that type of event, than using nested VMs anytime soon, although I do see developing them for sliding scale deployment of my website I always dream of self-hosting, for no other reason than bragging rights.

Does anyone think I'm running any heightened risk whatsoever from power outages and crashes by enabling VT-x?

Host Machine: Windows 11, 64GB Ram, i9 Processor
Guests: Windows Server 2016 running Exchange for my personal calendar, etc. (non-domain, so Database Availability Group (DAG) won't work unless I figure that mess out; I'm now considering Data Protection Manager (DPM)), Others

Thanks.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: What "nested virtualization" really means

Post by scottgus1 »

Being that Virtualbox, starting with 6.1, requires VT-x/AMD-V enabled to run any VM, you'll have to enable it to run any VMs under more recent Virtualbox. Also multi-core VMs, 64-bit VM OSs, and faster-processing VMs come with enabled VT-x.

VT-x is used for non-nested VMs too. I have it enabled for my hosts and I've never run nested VMs - my CPUs are too old.
mateek wrote:any heightened risk whatsoever from power outages and crashes
The solution for this threat is the same as for the physical PC, which can also suffer from power failures and BSODS:

Backups.

Regular, restorable host disk image backups while all the VMs are fully shut down from within the VM OSs. Separate copies of the VM folders when the VM is fully shut down from within the VM's OS. On-the-fly backups within the VM's OS: either 3rd-party disk images compatible with the VM OS's services that run while the VM OS is running, and/or cloud-or-LAN-NAS backup of important data within the VM.

If the power loss or BSOD kills anything from some data in a VM up to the whole host, you'll be able to recover. Also get a UPS if possible for power loss.

If you come across someone saying you can back up a running VM with a snapshot, don't believe it. Snapshots 'back up' the VM in a state that is equivalent to power loss or hard crash of the VM, and your data will suffer.
Post Reply