Skip to content

Instantly share code, notes, and snippets.

@wrmack
Last active August 24, 2024 13:27
Show Gist options
  • Save wrmack/29d580a0bd665bace21609d5ef675ba1 to your computer and use it in GitHub Desktop.
Save wrmack/29d580a0bd665bace21609d5ef675ba1 to your computer and use it in GitHub Desktop.
Windows 11 on MacBook M1

Windows 11 on MacBook M1 (ARM)

Steps I went through to install a Windows Insider Preview VHDX on a Macbook Pro using UTM. I needed Windows because I was developing an app to submit to the Microsoft Store. With the following setup I was able to develop an electron-based app and submit it to the Microsoft Store.

  1. Download the VHDX from Windows Insider Previews. You need to register for the Insider Program and sign in.
    • under Select edition select the Canary channel and press Confirm
    • select language and confirm
    • press Download
  2. Open UTM and press + to create a new virtual machine
    • Virtualize
    • Windows
    • select the VHDX checkbox and provide the path
    • accept all other defaults
    • (optional) tick OpenVM in order to move the VM to an external drive
      • after settings are saved and you are returned to setup, use the move icon on the window bar to move your VM to an external drive
    • (optional) change the default name and add a description
    • (optional) increase the drive size from 64 GB to a larger size
  3. Click the play button to start the VM
    • the BIOS screen will appear, at the prompt press any key to set up Windows from the VHDX
    • once Windows setup starts open a terminal to install the spice tools because the setup procedure requires internet
      • Shift + Fn + F10 to get terminal
      • dir D: to check if the spice tools are mounted on the D: drive; if they are not try dir E: etc
      • install the spice tools: D: [spice tools exe] and reboot
      • continue setting up Windows
    • if a restart is required, do not press a key at the BIOS prompt or setup will start over
    • if you are asked whether to allow Microsoft access to diagnostics etc answer yes to all these - this is the whole point of making previews publicly available and your Windows might not run optimally if you do not cooperate with this
  4. In Windows Settings make the following changes
    • turn on Developer mode (under Privacy and Security)
    • link your Windows Insider account (under Windows Update - Windows Insider Program)
    • check time, date and region are set and synced (under Time and Language)
    • (optional) set to never turn off (under System - Power)
  5. Edit the registry to bypass secure boot and TPM checks and to tell Windows you are using the Canary channel1
    • search for regedit and run it as administrator
    • add a new key Computer\HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig
      • do this by right-clicking Setup in Computer\HKEY_LOCAL_MACHINE\SYSTEM\Setup, then select New then Key and create LabConfig
    • to this add new DWORDs (32-bit)
      • BypassSecureBootCheck (set to 1)
      • BypassTPMCheck (set to 1)
        • do this by first selecting LabConfig in the left-hand pane then right-click in an empty part of right-hand pane to add the DWORDs
        • right-click on each new DWORD and modify its value from 0 to 1
    • in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability
      • set BranchName to CanaryChannel
    • in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Selection
      • set UIBranch to CanaryChannel
    • in comments below see my comment about Microsoft renaming 25000 builds to Canary Channel. If you downloaded a build in the 25000 series and have problems if you set the branch name to Dev try setting it to CanaryChannel
  6. If you later need to update Windows 11 using Windows Update and this fails because TPM and secure boot are missing:
    • copy this script
    • paste it into Notebook and save it, say, as skip_tpm_check.cmd
    • run it (eg right-click on it and run as administrator)
    • Windows Update should work
  7. After any update to Windows 11 itself it is necessary to:
    • run spice tools again to restore proper screen resolution:
      • in file explorer in Windows 11 spice tools should show as being mounted as a CD Drive (unless you have unmounted it)
      • double click spice-guest-tools-0.164.exe
      • once it has made changes, click restart
    • check the registry changes have persisted, otherwise redo them

At this point you should have a working Windows 11 VM.

Note that Windows 11 on ARM64 can run X64 apps. To setup a developer environment I used a mixture of arm-based apps where these were available (eg VSCode and Visual Studio) and x64 apps where there was not an official ARM64 version.

Footnotes

  1. Useful sources for these changes are Toms Hardware, Winaero and Microsoft Techcommunity

@wrmack
Copy link
Author

wrmack commented Mar 12, 2023

In March Microsoft advised they have created a new Insider Preview Channel named Canary. The different channels relate to different build streams:

  • Canary Channel: 25000 series.
  • Dev Channel: 23000 series.
  • Beta Channel: 22000 series.
  • Release Preview: Released versions of Windows 10 and Windows 11.

People in the Dev channel were receiving 25000 builds and Microsoft moved people on the Dev channel to the Canary channel.

My VM now shows it is on the Canary channel.

  • In Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability BranchName shows CanaryChannel
  • In Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\UI\Selection UIBranch shows CanaryChannel

People downloading the ARM Insider Preview from here are given two selections: a 25000 build described as Dev and a 22000 build described as Beta.
These builds might now correspond to Canary and Dev.

Will check back.

@wrmack
Copy link
Author

wrmack commented Jul 15, 2023

When running Windows Update to update to a new Windows 11 release the VM kept freezing at different times. Was using UTM v 4.3.1 (Beta). Replaced with UTM v 4.2.5 (stable release). Update completed without a problem.

@neldredge-unco
Copy link

With UTM 4.3.2 beta, which now includes TPM emulation, the only parts of steps 5-6 that I needed were to set the two WindowsSelfHost keys. After that, Windows Update was able to download and begin installing the latest build.

Unfortunately, UTM then crashed during the install process (around 20%), and on restart, Windows Update refused to download the new build, reporting error 0x80248014. I started over with a fresh install, and the same thing happened at a slightly different point (28% I think).

@wrmack
Copy link
Author

wrmack commented Jul 18, 2023 via email

@neldredge-unco
Copy link

neldredge-unco commented Jul 18, 2023

I reported the crash: utmapp/UTM#5477

Incidentally, even with the TPM emulation, the Windows Update : Windows Insider Program page still reports "Your PC does not meet the minimum hardware requirements for Windows 11. Your channel options will be limited." I ran PC Health Check which reported: "The processor isn't currently supported for Windows 11. Processor: virt-8.0". (I did get green check marks for Secure Boot and TPM 2.0 though, yay!)

The WindowsSelfHost registry changes do circumvent this, but it makes me wonder if they could be avoided by just having UTM report a different type of CPU. Reported at utmapp/UTM#5478.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment