quickemu-project / quickemu

Quickly create and run optimised Windows, macOS and Linux virtual machines
MIT License
10.29k stars 446 forks source link

bug: Windows 10 x86_64 won't boot on M3 mac #1385

Open popey opened 1 month ago

popey commented 1 month ago

I confirm this bug has not already been reported

Describe the bug

I pulled the tip of git, then ran quickemu, and Windows 10 didn't boot.

qemu-system-x86_64: can't apply global qemu64-x86_64-cpu.migratable=no: Property 'qemu64-x86_64-cpu.migratable' not found

To Reproduce Steps to reproduce the behavior:

  1. On an M3 MacBook Pro, clone the quickemu project
  2. ./quickget windows 10
  3. ./quickemu --vm windows-10.conf

Expected behavior

A window appears with a perfectly smooth and bare-metal fast emulation of x86_64 Windows.

But I'd take a window of some kind.

Quickemu output

Quickemu 4.9.6 using /opt/homebrew/bin/qemu-system-x86_64 v9.0.1
 - Host:     macOS 14.5 running Darwin 23.5.0 Alans-MacBook-Pro
 - CPU:      Apple M3 Pro
 - CPU VM:   qemu64, 1 Socket(s), 4 Core(s), 1 Thread(s)
 - RAM VM:   8G RAM
 - BOOT:     EFI (Windows), OVMF (/opt/homebrew/opt/qemu/share/qemu/edk2-x86_64-code.fd), SecureBoot (off).
 - Disk:     windows-10/disk.qcow2 (64G)
             Just created, booting from windows-10/Win10_22H2_EnglishInternational_x64v1.iso
 - Boot ISO: windows-10/Win10_22H2_EnglishInternational_x64v1.iso
 - CD-ROM:   windows-10/virtio-win.iso
 - Display:  COCOA, virtio-vga, GL (off), VirGL (off) @ (1280 x 800)
 - Sound:    intel-hda (hda-micro)
 - ssh:      On host:  ssh user@localhost -p 22220
 - WebDAV:   On guest: dav://localhost:9843/
 - smbd:     On guest: smb://10.0.2.4/qemu
 - Network:  User (virtio-net)
 - Monitor:  On host:  socat -,echo=0,icanon=0 unix-connect:windows-10/windows-10-monitor.socket
 - Serial:   On host:  socat -,echo=0,icanon=0 unix-connect:windows-10/windows-10-serial.socket
 - Process:  ERROR! Failed to start windows-10.conf as windows-10

qemu-system-x86_64: can't apply global qemu64-x86_64-cpu.migratable=no: Property 'qemu64-x86_64-cpu.migratable' not found

System information

----------------------------------
        Quickemu 4.9.6
----------------------------------
Distro: macOS 14.5
Kernel: Darwin 23.5.0 arm64
Memory: 36G
GPU:
 -Apple M3 Pro
----------------------------------
            curl 8.6.0
----------------------------------
Libraries: libcurl/8.6.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.61.0
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features:  alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL threadsafe UnixSockets
----------------------------------
            QEMU 9.0.1
----------------------------------
Available CPUs:
  a64fx
  arm1026
  arm1136
  arm1136-r2
  arm1176
  arm11mpcore
  arm926
  arm946
  cortex-a15
  cortex-a35
  cortex-a53
  cortex-a55
  cortex-a57
  cortex-a7
  cortex-a710
  cortex-a72
  cortex-a76
  cortex-a8
  cortex-a9
  cortex-m0
  cortex-m3
  cortex-m33
  cortex-m4
  cortex-m55
  cortex-m7
  cortex-r5
  cortex-r52
  cortex-r5f
  host
  max
  neoverse-n1
  neoverse-n2
  neoverse-v1
  pxa250
  pxa255
  pxa260
  pxa261
  pxa262
  pxa270-a0
  pxa270-a1
  pxa270
  pxa270-b0
  pxa270-b1
  pxa270-c0
  pxa270-c5
  sa1100
  sa1110
  ti925t
----------------------------------
               CPU
----------------------------------
Apple M3 Pro

Screenshots

I wish.

Additional context

I like tacos.

ymauray commented 1 month ago

On my m2 macbook I had to remove "migratable=no" from the CPU variable definition, on lines 468 and 470. I then got to the install screen.

Can't do much for your tacos, though.

popey commented 1 month ago

Thanks @ymauray

Yup! That worked.

image
ymauray commented 1 month ago

Now all we need to do is let @flexiondotorg do his magic and turn this hack into something beautiful !

popey commented 1 month ago

Step one: Buy a mac.

Workaround: Come to my office tomorrow and play with mine.

lj3954 commented 1 month ago

What's the purpose of migratable=no in the CPU argument for exclusively Windows guests? #1269 also references an issue with it.

popey commented 1 month ago

I think that with migratable=no QEMU makes the guest CPU more consistent with the host and less basic. Without this option set, it allows for save/load of the VM state, and migration from one version to another. e.g. save state on QEMU 8, upgrade qemu, and load state from that VM on QEMU 9. As the host and guest are different architectures, this passthrough isn't going to work as the feature capabilities of host and guest CPU differ too much.

So I am guessing there needs to be a path in that function which sets the CPU flags based on host CPU as well as guest CPU. Probably around line 403, where there's already a host CPU arch check.

popey commented 1 month ago

I left it running overnight, and now I have a Windows 10 VM on my state-of-the-art Apple M3 Pro laptop, which has the performance of Windows 98 on a 486 :D

image

ymauray commented 1 month ago

Yep, pretty much the same experience over here, with Windows 11 on an M2 macbook air !

lj3954 commented 1 month ago

Related to this, future quickget will be able to build Windows images, including both development channels & aarch64: https://github.com/quickemu-project/quickget_configs/commit/e0217c2d26e0f2ffccd99263ca525a27770decdd. I don't believe quickemu is capable of booting aarch64 Windows yet, though.

flexiondotorg commented 1 month ago

I don't believe quickemu is capable of booting aarch64 Windows yet, though.

Correct :+1: But we should totally support that at some point :slightly_smiling_face: