Questions about using nested VT-x/AMD-V

This is for discussing general topics about how to use VirtualBox.
Post Reply
kdaek
Posts: 16
Joined: 14. Apr 2021, 08:10

Questions about using nested VT-x/AMD-V

Post by kdaek »

A question about nested virtualization in Virtualbox.
It consists of a main question and additional questions.
* For additional questions, you can answer only what you can answer.

This is the main question.
I am curious about the activation conditions of [Use nested VT-x/AMD-V] in [Settings - System - Processor - Extended Features].

It's the same Intel CPU, but there is a CPU that is enabled and a CPU that is disabled.
=> All are Intel CPUs, some are enabled and some are disabled.(Corrected the wording due to a misunderstanding)

CPU enabled to use nested VT-x/AMD-V: Intel Core i7 8700 (Desktop)

CPU disabled to use nested VT-x/AMD-V: Intel Core i7 11800H (Notebook/Laptop)

Each OS is Windows 11 (Intel Core i7 8700 is Home version, Intel Core i7 11800H is Pro version),
Virtualbox version is the same.

I tried using nested virtualization after setting 'Use nested VT-x/AMD-V' with the CLI command on the CPU where the use of nested VT-x/AMD-V is disabled.
It looks like it's using hardware acceleration, but it's actually emulating, not hardware accelerated (like running QEMU in TCG mode).

* We haven't tested how nested virtualization performs on CPUs with nested VT-x/AMD-V enabled.

And, an additional question
1 ) Is it not possible to use 'Use nested VT-x/AMD-V' when Hyper-V is in use? (Nested virtualization cannot be implemented if Hyper-V is used?)
2) It seems that only Oracle products (Virtualbox, etc.) and KVM can be used in the VM that is set to use nested VT-x/AMD-V. ?
(Is it the difference between SLAT (Second Level Address Translation) support?)
3 ) Is nested virtualization not allowed within nested virtualization?
=> Hyper-V and KVM appear to support nested virtualization within nested virtualization.
- WSL2 returns to the Hyper-V engine, and Windows 11 WSL2 supports nested virtualization. In it, you can use KVM with nested virtualization.
- Confirmed that KVM can be used in Linux running on KVM
Last edited by kdaek on 26. Jul 2022, 05:34, edited 1 time in total.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Questions about using nested VT-x/AMD-V

Post by mpack »

kdaek wrote: 1 ) Is it not possible to use 'Use nested VT-x/AMD-V' when Hyper-V is in use? (Nested virtualization cannot be implemented if Hyper-V is used?)
I would expect not, since VirtualBox has no access to VT-x if Hyper-v is in use.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Questions about using nested VT-x/AMD-V

Post by fth0 »

kdaek wrote:I am curious about the activation conditions of [Use nested VT-x/AMD-V] in [Settings - System - Processor - Extended Features].
Short version: Only Intel vPro CPUs support VMCS Shadowing, which is needed for efficient nested virtualization.

Long version: Please read Nested VT-x and VMCS Shadowing for the gory details.
kdaek wrote:It's the same Intel CPU
I beg to differ: The Intel CPUs you mentioned later on are not even the same generation (8th vs. 11th).
kdaek wrote:1 ) Is it not possible to use 'Use nested VT-x/AMD-V' when Hyper-V is in use?
Correct. Hyper-V does not even provide VT-x/AMD-V to its root partition executing the "native" Windows. In consequence, VirtualBox has no access to VT-x/AMD-V at all.
kdaek wrote:2) It seems that only Oracle products (Virtualbox, etc.) and KVM can be used in the VM that is set to use nested VT-x/AMD-V. ?
(Is it the difference between SLAT (Second Level Address Translation) support?)
That's what the VirtualBox User Manual states. SLAT (Second Level Address Translation) (also called EPT (Extended Page Tables)) support probably is one of the reasons. Another reason may be that some hypervisor vendors do not want to support vendor-independent nesting for a lot of possible reasons.
kdaek wrote:3 ) Is nested virtualization not allowed within nested virtualization?
In theory, you can nest infinitely. But VirtualBox 6.1 (and earlier) do not support that.
kdaek
Posts: 16
Joined: 14. Apr 2021, 08:10

Re: Questions about using nested VT-x/AMD-V

Post by kdaek »

mpack wrote:
kdaek wrote: 1 ) Is it not possible to use 'Use nested VT-x/AMD-V' when Hyper-V is in use? (Nested virtualization cannot be implemented if Hyper-V is used?)
I would expect not, since VirtualBox has no access to VT-x if Hyper-v is in use.
If you use VirtualBox with Hyper-V, do you think that nested virtualization is not available at all?

Is virtualbox nested virtualization possible only by accessing VT-x/AMD-V? In other words, will the ability to use nested virtualization be added or not when used with Hyper-V in the future?
kdaek
Posts: 16
Joined: 14. Apr 2021, 08:10

Re: Questions about using nested VT-x/AMD-V

Post by kdaek »

fth0 wrote:
kdaek wrote:It's the same Intel CPU
I beg to differ: The Intel CPUs you mentioned later on are not even the same generation (8th vs. 11th).
Both are Intel CPUs, but some are enabled and some are not.

I didn't say they were of the same generation.
Both are Intel CPUs, so it is written as the same Intel CPU.
If it's confusing, I'll correct it.
fth0 wrote:
kdaek wrote:3 ) Is nested virtualization not allowed within nested virtualization?
In theory, you can nest infinitely. But VirtualBox 6.1 (and earlier) do not support that.
In VirtualBox, do you think that nested virtualization cannot be used in nested virtualization in the future?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Questions about using nested VT-x/AMD-V

Post by mpack »

kdaek wrote: In VirtualBox, do you think that nested virtualization cannot be used in nested virtualization in the future?
None of us are (VirtualBox) developers. But it looks unlikely.
kdaek
Posts: 16
Joined: 14. Apr 2021, 08:10

Re: Questions about using nested VT-x/AMD-V

Post by kdaek »

fth0 wrote:
kdaek wrote:I am curious about the activation conditions of [Use nested VT-x/AMD-V] in [Settings - System - Processor - Extended Features].
Short version: Only Intel vPro CPUs support VMCS Shadowing, which is needed for efficient nested virtualization.

Long version: Please read Nested VT-x and VMCS Shadowing for the gory details.
I checked the two Intel CPUs on the Intel website.

The i7-8700 has 'Intel® vPro™ Platform Eligibility' marked as 'Yes' and

The i7-11800H is not marked with vPro.

In the case of Intel CPUs, does it mean that nested virtualization is supported on CPUs with vPro platform eligibility? (For unsupported CPUs, it seems to be emulated as if it is supported when used after forced setting)
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Questions about using nested VT-x/AMD-V

Post by fth0 »

kdaek wrote:In the case of Intel CPUs, does it mean that nested virtualization is supported on CPUs with vPro platform eligibility? (For unsupported CPUs, it seems to be emulated as if it is supported when used after forced setting)
In principle, you can use nested virtualization without VMCS Shadowing, just like you can use non-nested virtualization without SLAT/EPT. But after you've tried it once, you probably don't want to do it again. ;)
kdaek wrote:In VirtualBox, do you think that nested virtualization cannot be used in nested virtualization in the future?
To see what the future brings, wait for the VirtualBox 7.0 Beta phase (no ETA, no guarantee ;)).
kdaek
Posts: 16
Joined: 14. Apr 2021, 08:10

Re: Questions about using nested VT-x/AMD-V

Post by kdaek »

Just because vPro eligibility is yes doesn't mean nested virtualization performs better.

I tested it on a PC with the specifications below, and it behaved like emulation.
CPU: Intel Core i7-8700 (Desktop)
Host OS: Windows 11 Home
Guest OS: Debian 11
Guest OS in nested virtualization: Windows 10 Pro (64-bit)

Below are the specifications of the PC I tested when writing the question.
CPU: Intel Core i7-11800H (Laptop)
Host OS: Windows 11 Pro
Guest OS: Debian 11
Guest OS in nested virtualization: Windows 11 Home

As a result of the test, the guest OS speed of nested virtualization was slow, and if you look at the CPU item in the Performance tab in the task manager, it is observed that individual cores do not work together as if they were natively, but operate one by one sequentially.
Post Reply