WSL2 / Ubuntu 20.04 (Windows build 2004) (bootcamp) setup fails with errr code 0x80370102

6,528

The answer to this problem comes in 2 parts. Most macs support virtualisation, but you need to find out how to check this. I found this issue on stackoverflow How to enable support of CPU virtualization on Macbook Pro?. From a macOS terminal, you need to run this command:

sysctl -a | grep machdep.cpu.features

This returns something like:

machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX SMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C

If the string returned contains "VMX", then Virtualisation is supported.

Now, you need to ensure that virtualisation is enabled from the macOS side. Open up system settings then go to Start Up disk. Now just looking at the current setting may show that your windows partition is set as the start up disk. You need to explicitly go in and set it to windows, so unlock the padlock and click on your windows partition. The act of doing so activates other settings including enabling virtualisation. When I first encountered this issue, I could already see that my windows partition was visibile in the list of disks to selected as the startup disk and I probably thought no more of it, not realising you have to set it to windows explicitly.

After I did this then rebooted into windows, then open "Programs and Features" (run appwiz.cpl), then select "Turn windows features on or off", look at the options and ensure that "Hyper V" is not a disabled greyed out option. Select "Hyper V", then enable "Windows subsystem for linux". You should now be able to proceed with WSL2 without seeing errors pertaining to virtualisation not being enabled.

Share:
6,528
Plastikfan
Author by

Plastikfan

Updated on September 18, 2022

Comments

  • Plastikfan
    Plastikfan over 1 year

    The first thing I did, was enable WSL in the Windows Features dialog, then I installed Ubuntu 20.04 from the store. Befote doing anything else, I found an article WSL Kernel that said that I should install an update to the Linux kernal from here, this was an msi installer (wsl_update_x64.msi). I noticed there was an indication that the Virtual Machine Platform should have been enabled before installing Ubuntu, but it was too late by then. I then launched Unbuntu from the start menu link and a console window popped up with this error:

    Installing, this may take a few minutes...
    WslRegisterDistribution failed with error: 0x80370102
    Error: 0x80370102 The virtual machine could not be started because a required feature is not installed.
    
    Press any key to continue...
    

    The microsoft article Windows Subsystem for Linux Installation Guide for Windows 10 says this for error (0x80370102):

    Installation failed with error 0x80070003 or error 0x80370102
    
        Please make sure that virtualization is enabled inside of your computer's BIOS. The instructions on how to do this will vary from computer to computer, and will most likely be under CPU related options.
    
    

    but macs do not have a bios. So how do I ensure virtualisation is enabled on a Macbook PRO running windows 10 (2004) on bootcamp, without access to bios settings?

    If I uninstall everything and disable WSL and Virtualisation and so this all over again in the right order, will this aleviate the issue or will I still need to change the bios setting which I have no access to.

    • amb85
      amb85 almost 4 years
      Did you ever figure out how to solve this?
    • VidathD
      VidathD almost 4 years
      Did you not turn on Virtual machine platform after installing Ubuntu. You can uninstall and install Ubuntu again if it doesn't work after turning Virtual machine platform on.
    • Yunfei Chen
      Yunfei Chen over 3 years
      "So how do I ensure virtualisation is enabled on a Macbook PRO running windows 10 (2004) on bootcamp,"... Please if you gonna use mac use MacOS, dont mix oses....
  • Nick McCurdy
    Nick McCurdy over 3 years
    I didn't have to select Windows as the startup disk (it doesn't even appear in system preferences), what worked was enabling ALL sub-features of Hyper-V.
  • Plastikfan
    Plastikfan over 3 years
    Hey Nick, so how did you do that; ie "enable ALL sub-features of Hyper V"? (Is that on the windows side under turn windows features on/off? If I remember rightly, even that Hyper-V was greyed out if I didnt enable from with mac side as previously described.
  • Nick McCurdy
    Nick McCurdy over 3 years
    Yes, it’s on the Windows side. I didn’t have to enable anything on the Mac side. I’m not sure why it’s greyed out for you.
  • Plastikfan
    Plastikfan over 3 years
    Hi again Nick, well that indeed is strange. Perhaps it is down to differences in hardware. I am running a Mid2014 MACBOOK-PRO, if you run that command I showed above do you see the same machdep.cpu.features list? I know its a long list, but if you posted your list, I could script a solution to compare the 2 without having to manually eye-ball it.
  • Yunfei Chen
    Yunfei Chen over 3 years
    @Plastikfan On windows I get sysclt is not a recongized command ???
  • Plastikfan
    Plastikfan over 3 years
    Hi @YunfeiChen,sysctl is a macOS command not windows. Run it from a mac terminal and that should work.
  • Yunfei Chen
    Yunfei Chen over 3 years
    @Plastikfan op asked for "WSL2 / Ubuntu 20.04 (Windows build 2004) (bootcamp) setup fails with errr code 0x80370102" A windows solution so why is a mac solution viable??
  • Plastikfan
    Plastikfan over 3 years
    @YunfeiChen, I am the OP. I am running windows on a mac via bootcamp. (I mentioned bootcamp in the title)