myspaghetti / macos-virtualbox

Push-button installer of macOS Catalina, Mojave, and High Sierra guests in Virtualbox on x86 CPUs for Windows, Linux, and macOS
GNU General Public License v2.0
13.46k stars 1.11k forks source link

VirtualBox does not support hardware-supported virtualization. #639

Closed CompeyDev closed 1 year ago

CompeyDev commented 1 year ago

When running the script, the following is returned at a stage:

Checking that VirtualBox uses hardware-supported virtualization.

Virtualbox is not using hardware-supported virtualization features.
Check that software such as Hyper-V, Windows Sandbox, WSL2, memory integrity
protection, and other Windows features that lock virtualization are turned off.
Exiting.

Is there any way to use the script without disabling WSL2/Memory integrity? I really do not want to have to disable and delete all my WSL Distributions as they store a bunch of required files that I use on a daily basis.

myspaghetti commented 1 year ago

Is there any way to use the script without disabling WSL2/Memory integrity?

Nope, sorry. Well, technically, you could run VirtualBox inside WSLg, but it's slower by an order of magnitude at least.

If you want to run macOS in WSL2 I recommend using QEMU/KVM on WSLg, there are lots of scripts for macOS on KVM. Works faster and better than VirtualBox on Windows, and if you're running Windows 10 or 11 with the lastest WSL2 you already support WSLg and nested virtualization.

CompeyDev commented 1 year ago

I'm not planning to run VBox inside WSL, because that would produce horrible performance (I've tried QEMU and it does not really have the best performance in WSL). I just wanted to be able to run on VirtualBox without compromising on features that I already have.

I was able to make QEMU run on WSL right before trying this script but I ended up not using that as WSL could barely handle itself alone.

myspaghetti commented 1 year ago

With the little I've tested, macOS on QEMU/KVM on WLSg performs better than macOS on VirtualBox on Windows on bare metal. If you're expecting better performance for VBox-on-Windows over KVM-on-WSLg you might be disappointed.

CompeyDev commented 1 year ago

Are you sure? My device currently only has 6 GB of memory, meaning I allocate 4 GB to WSL and 2 GB from that to the macOS instance... Running it on bare VBox gives me 4 GB of RAM, which I assume to be more fluid and performant than the 2 GB within WSL.

myspaghetti commented 1 year ago

If you allocate 4GB for WSLg and 3GB to macOS on KVM you should see better performance than 4GB for macOS on VirtualBox, but in either case I can't fathom how Windows survives running a VM with a modern OS with 6GB of RAM total.

You don't have to delete WSL2 or its VMs, you can disable the hypervisor by running this command and rebooting twice:

bcdedit /set hypervisorlaunchtype off 
CompeyDev commented 1 year ago

Ah, if disabling the hypervisor does not wipe VMs, that's all good.