VMX feature not enabled for guest even though Nested VT-x is checked

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
Will Johnson
Posts: 2
Joined: 28. Mar 2023, 22:58

VMX feature not enabled for guest even though Nested VT-x is checked

Post by Will Johnson »

Hello,

Summary:
I am attempting to run a virtual machine within a virtual machine on OS X Ventura 13.0.1.

Specs:
Model: Macbook Pro 15" 2017
Processor: Intel Core i7-7700HQ CPU @ 2.80GHz
OS: OS X Ventura 13.0.1
Memory: 16GB 2133 MHz LPDDR3
Hard Drive: 250GB
VirtualBox version: 7.0.6 r155176 (Qt5.15.2)
Extension Packs: 0
Guest Additions: virtualbox-guest-additions-iso/jammy-updates 6.1.38-1~ubuntu1.22.04.1 all
Guest Settings: Please see attached

Issue:

As stated in the summary above, I would like to run a VirtualBox vm inside of a VirtualBox vm that is running on my mac. My understanding is that this has been supported since version 6.1. Here are the steps I took:

1. Download the latest Ubuntu server iso from Ubuntu's website.
2. Open VirtualBox and import the iso image. Continue with setting up the image using the default entries.
3. Once the vm is up and running, power off the vm.
4. In a bash shell, do the following:
a. Run "vboxmanage list vms" and note the id of the vm that was powered down
b. Run "vboxmanage modifyvm <vm id> --nested-hw-virt on"
5. Verify that "Enable Nested VT-x/AMD-V" is checked under Settings -> System -> Processor
6. Power on the vm
7. SSH into the vm and run: "cat /proc/cpuinfo" and look for the vmx feature flag. In my case, this flag is not listed and therefore, I cannot run a vm inside this vm.

Important Notes:
1. I verified that my processor does in fact support VT-x, so I don't understand why it is not enabled in the guest OS.
2. The VirtualBox logs also indicate that the host OS does support VT-x but it is disabled on the guest. I don't understand why:

Code: Select all

00:00:07.866882   Mnemonic - Description                                  = guest (host)
...
00:00:07.866914   VMX - Virtual Machine Extensions                        = 0 (1)
I'm attaching the VirtualBox log file and guest settings. Please let me know if there is any other information that I can provide. I thought this would be as simple as enabling the VT-x checkbox but it seems that there might be another step that I am missing. Thank you in advance.

Regards,

Will
Attachments
vm_log.zip
Log file and guest settings
(36.54 KiB) Downloaded 11 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VMX feature not enabled for guest even though Nested VT-x is checked

Post by scottgus1 »

The following CPU items are necessary to make nested virtualization work, according to our forum hex whisperer fth0:
00:00:07.867081 VMX - Virtual-Machine Extensions = 0 (1)
00:00:07.867095 Ept - Extended Page Tables = 0 (0)
00:00:07.867098 UnrestrictedGuest - Unrestricted guest = 0 (0)
00:00:07.867101 VmcsShadowing - VMCS shadowing = 0 (0)
Your computer's CPU only has the first one. This means nested virtualization will not likely work on your Mac.
multiOS
Volunteer
Posts: 800
Joined: 14. Sep 2019, 16:51
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: WIN11,10, 7, Linux (various)
Location: United Kingdom

Re: VMX feature not enabled for guest even though Nested VT-x is checked

Post by multiOS »

Even if f the Host CPU does have the necessary features to support nested virtualisation, then I suspect the underlying cause for the absence/loss of the nested virtualisation feature is that, with the release of macOS Ventura, third-party virtualisation software is now 'forced' to use Apple's own Hypervisor Framework, which blocks direct access to hardware virtualisation capabilities (VT-x) - i.e. Just as with the Windows Hyper-V platform, pass-through of VT-x features is not (currently) possible; and probably never will be given the declining Intel Mac User base.
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: VMX feature not enabled for guest even though Nested VT-x is checked

Post by fth0 »

multiOS is right:

macOS Ventura doesn't allow applications like VirtualBox to use kernel extensions. In consequence, VirtualBox cannot use VT-x itself, but only indirectly through Apple's Hypervisor Framework. And since VirtualBox has no access to VT-x itself, it cannot provide it to the guest OS and VirtualBox running on the guest OS.

scottgus1 is right, too:

If you'd use another host OS that allowed VirtualBox to use VT-x itself, your host CPU wouldn't allow efficient nested virtualization. The VMCS Shadowing feature (Intel vPro in marketing terms) is part of the more expensive lines of Intel CPUs, which are rarely used in mobile devices.
Will Johnson
Posts: 2
Joined: 28. Mar 2023, 22:58

Re: VMX feature not enabled for guest even though Nested VT-x is checked

Post by Will Johnson »

All,

Thank you for the detailed feedback. I now understand why I cannot get nested virtualization working on my mac.

Regards,

Will
Post Reply