New Build with Nested Virtualization in MacOS VM


Recommended Posts

Hello everyone,

I want to build a new workstation for work and play.

The general idea of the workstation is to allow me to run Linux/Windows/MacOs on the same box, and switch between them depending on the use case.

Linux - as my default OS
Windows - as my gaming OS
MacOS - as my work OS

The first two I know how to setup, but the third one gets slightly more complicated.

As a mobile developer I need to be able to run multiple Simulators/Emulators of Mobile Devices inside MacOS, so I don't have to own multiple physical devices for debugging.

Questions:
1. Is this even possible at this moment in time ?

  • I've already tried to make this run on a i5 6600k just to see if it would work.
  • I've installed Macinabox and booted my MacOS instance, but as soon as I opened Android Studio, and wanted to start an emulator, I was greeted with the message "Your CPU does not support VT-x".
  • I've already seen posts on the forum about enabling VM nesting in UNRAID, but this didn't help.

 

2. What hardware would you recommend ?

  • I'm looking at the Ryzen 9 5950X, but since we are in the concept phase this is subject to change.


Any input is much appreciated.

Thank you.

Kind regards.

Link to comment
1 hour ago, viskanic said:

Is this even possible at this moment in time ?

Nested virtualization in mac os is only possible with intel cpu (mac os doesn't support nested virtualization with amd):

you need to enable nested virtualization by:

 

1- add this line to syslinux configuration:

kvm_intel.nested=1

in the append line, so that it looks like:

append kvm_intel.nested=1 initrd=/bzroot

Reboot unraid

 

2- set up your mac os virtual machine for cpu passthrough: if you have the custom qemu arg at the end of the vm xml with penryn emulation nested virtualization will not work (it may work with other newer intel emulated cpu, I never tested); for cpu host passthrough you need:

  <qemu:commandline>
    ...
    ...
    ...
    <qemu:arg value='-cpu'/>
    <qemu:arg value='host, ....
  </qemu:commandline>
</domain>

 

Note that macinabox emulates penryn cpu, so if you didn't change the last lines of the xml to set the passthrough of the cpu, nested virtualization won't work.

Intel core 2 duo lacks EPT (extended page tables) and UG (unrestricted guest) for virtualization, this is why Penryn is not working.

Edited by ghost82
  • Like 1
Link to comment

Hi ghost82,

Thank you for your prompt reply.
 

20 hours ago, ghost82 said:

Nested virtualization in mac os is only possible with intel cpu (mac os doesn't support nested virtualization with amd)


So even though you could run MacOS on a AMD CPU and make it think you are using a Xeon,
when it comes to extra features like in my case nested virtualization, there is no workaround ?

That's dissapointing :(

So I guess my first choice for an Intel CPU with 16
cores, would be the i9 9960X.
It seems I just can't get away from Intels 14nm processors.

If you have any other thoughts or ideas, please feel free to share.

Kind regards.

Link to comment
49 minutes ago, viskanic said:

So even though you could run MacOS on a AMD CPU and make it think you are using a Xeon,
when it comes to extra features like in my case nested virtualization, there is no workaround ?

I think so: I don't have any amd to test with, but to have nested virtualization in mac os you should need vt-x and amd has amd-v; if anyone has an amd cpu he can try to emulate a "Skylake-Client" cpu, but I would not bet it will work (I think that having virtualization working inside a vm is possible only with the passthrough of the cpu, and not possible to emulate, with an emulated cpu).

I know @david279 had a similar setup, if he's around maybe he tried and can confirm this with his amd cpu.

Edited by ghost82
  • Like 1
Link to comment

Hi @david279,

Thank you for your reply.

I was hoping not to run MacOS on bare metal.
Just to have a bit more control over the OS so an update doesn't mess up the installation.

I realise this is quite a niche requirement, but you can't blame me for trying :)

If anyone has any additional input, feel free to share.

Cheers.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.