Nested Virtualization Issues

Discussions related to using VirtualBox on Windows hosts.
Post Reply
oobi
Posts: 1
Joined: 26. Jun 2022, 03:50

Nested Virtualization Issues

Post by oobi »

Howdy! I'm having an issue with nested virtualization (VM inside of a VM). I have a Windows host that hosts an Ubuntu 22.04 virtual machine that I use for software development. One of the projects I'm working on uses Vagrant to spin-up a VirtualBox machine to run my project within.

When Vagrant attempts to start the virtual machine, I receive this error message back from VirtualBox:

Code: Select all

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "3e464335-050a-417f-84b7-a189adad47ac", "--type", "headless"]

Stderr: VBoxManage: error: Cannot enable nested VT-x/AMD-V without nested-paging and unrestricted guest execution!
VBoxManage: error:  (VERR_CPUM_INVALID_HWVIRT_CONFIG)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
I have all of the required prerequisites on the host machine enabled that allow for VirtualBox VMs inside of VirtualBox VMs. When booting the first-level guest VM, I can mouse-over the "V" icon in the bottom right of the status bar to see that AMD-V, nested-paging, and unrestricted execution report "Enabled". Even though AMD-V and unrestricted guest execution are "Enabled", my guest virtual machine reports that they are not! Running the command "kvm-ok" on Ubuntu reports that I'm able to use the accelerated virtualization (not sure if that helps, but thought I would add it.)

Both the host & guest are running the same version of VirtualBox. There are no other virtual machine providers running within the guest machine, or on the host machine (besides existing VirtualBox instances). Anyone have any ideas on how I can start diagnosing the problem? :D Thank you in advance for any tips or help!!
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Nested Virtualization Issues

Post by fth0 »

You should enable Nested VT-x/AMD-V on the host and disable it on the guest. The error message you're seeing indicates that double nesting (H0 > G1 > G2 > G3) won't work.
Post Reply