Closed nguyenthienminh closed 2 years ago
Hello and welcome to the repo!
Thank you!
Update: I happened to use the newer version of 10 ARM (version 2004 and later) which doesn't work. I had to use version 1909 to make it work, but it still BSODs when booting the installer with a ACPI_BIOS_ERROR blue screen: I looked in the BIOS and the RAM amount reported is 0MB: Also, more info:
Well, I also tried that firmware (some years ago) but if you feel is just old for now, you can get the new prebuilt UEFI firmware online. You can get one from here. Remember to choose AARCH64 version for QEMU.
Also, there is a bug in qemu virt
machine (this have been fixed in 5.x). You said you use the QEMU from 2018, so it's equal to version 3.x. In that case, virt-2.12
seems to work for Windows ARM. If it still results in error, try disabling highmem
and enable EL2 by using -machine virt-2.12,highmem=off,virtualization=on
and see if it works. (I wonder why you choose this QEMU version)
I have read somewhere (didn't remember to save the link, sorry) that Windows 20H1 arm64 and later doesn't work on QEMU without KVM (virtualization, not emulation). So if you want some recent Windows arm64 on QEMU, you should use KVM (you can try on some hardware like RPi and other SBCs)
Also, you should change the display from VGA
to ramfb
, as VGA
is usually for x86 emulation. -device VGA
to -device ramfb
.
Again, try this:
qemu-system-aarch64.exe ^
-M virt-2.12,highmem=off,virtualization=on^
-cpu cortex-a57 ^
-smp 3 ^
-m 3072M ^
-pflash QEMU_EFI.img ^
-pflash QEMU_VARS.img ^
-device ramfb^
-device nec-usb-xhci ^
-device usb-kbd ^
-device usb-mouse ^
-device usb-storage,drive=install ^
-drive if=none,id=install,format=raw,media=cdrom,file=.\WindowsARM.iso ^
-device usb-storage,drive=drivers ^
-drive if=none,id=drivers,readonly=on,file=.\drivers.vhdx ^
-device virtio-blk,drive=system ^
-drive if=none,id=system,format=raw,file=.\system.vhdx
Try this and see if it works! Thank you for taking a look at this repo and feel free to ask about this.
Edit: If you find it too hard for installing using the installer, you can also create a VHD, mount it on Windows, then use dism
to apply the wim
image to it (extracted from the iso) and then put efi files on it, and it works normally just like using the installer.
The BIOS file kind of got really corrupted and such caused this error when executed the cmdline: If I use the old BIOS, the cmdline will (once executed) got this error: And yes, if the video card's emulation files are not found, then the machine won't start again: But interestingly, the serial display actually works and showed the bios. But then when I chose to boot from DVD, it'll display a prompt to press a key to boot into DVD, then it'll stop at a blinking cursor. So I changed the display type too back to VGA, and this time, it boots fine. Weird.
No it is not corrupted, it just not fit the QEMU's flash. The QEMU's flash is 64MB in size and you should have the firmware also in 64 MB.
From this, on Linux you can use dd if=/dev/zero bs=1M count=64 of=QEMU_EFI.img
and then dd if=QEMU_EFI.fd bs=1M of=flash0.img conv=notrunc
.
On Windows you can use fsutil file createnew QEMU_EFI.img 67108864
to create a 64MB file and then use some hex editor you can copy the content of QEMU_EFI.fd to the beginning of the new file. QEMU will happily accept it.
EDIT: Windows does require a graphic display so even it output to serial, it can't show you the installer through that.
EDIT #2: QEMU can work without vgabios-ramfb.bin
but it requires driver inside the UEFI firmware, so i guess the old firmware doesn't support ramfb.
Oh well, it still works, so yeah. It's currently at the installer, which is going to take not a long time (maybe). I sped it up using GVM (KVM for Windows) too, so yeah, it's going to be a little bit faster.
Oh man, which platform are you running on? Is your host platform x86 or ARM?
If you are using an x86(_64) machine, you cannot use KVM for running an ARM64 VM! KVM requires the guest to use the same instruction set as the host processor.
Woopsie. Let me uninstall GVM.
Excuse me, can you provide the link to GVM? I have googled it but couldn't find any information. Thanks!
Thanks! Is your VM ok now?
Well, it booted the installer successfully, but it didn't detect the hard drive at all. Even after loading the driver, it still only appear a tiny 60MB volume on the "Choose a partition to install Windows" screen.
The line -drive if=none,id=system,format=raw,file=.\system.vhdx
Try changing it to format=vhdx
and see if something better
That fixed it. Thanks! Now just to see how much time it's going to install... (already 10 mins so far)
Good to see it works! If you have any other questions, feel free to put a comment here. Thanks!
Oh. So now it's really stuck at the "Installing updates" screen for 30 mins already:
Oh nevermind, it's unhung anyways
You should be patient. Emulation is always slower than you expected.
If you want to know is things in process (eg if is hang or not), you can press Shift+F10 to open cmd and then open task manager from it.
Yeah, I opened the taskmgr like that, and.... the CPU got capped at 100%, that's why it's so slow
oh, and it refused to boot from the hard drive. It only wants to boot from the DVD.
Ok you should remove the cd from qemu. Or you can go to firmware setting and choose to boot from hard drive
Yep, I go into the firmware settings, chose the hard drive and it refused to boot. Just exited out to the BIOS screen. When I removed the DVD, it wants to network boot.
Is the installer show some errors or it just ask you to reboot?
Oh nevermind, by a little probing found out the device name. The BIOS menu is just so messy...
Try all of the options and you will find the one correct :)
I saved the statistics into a .txt file, once the install's done i'm going to upload the statistics up here
Can I let my computer sleep when the VMs doing this? I have to go to another place so yeah.
You have to keep your computer on, of course. Or you can pause the VM and when you come back you can unpause it.
oh, I already let it slept for... a while, and it kind of pauses the vm, but starting it up'll basically unpause it.
Huh, now it got stuck on the "Just a moment..." screen for a whole 2 hours (not included the time I let the computer hibernate and I let the VM pause, which is roughly 14 hours). Sometimes the VGA output got black, but moving the cursor kind of un-blacks it.
Well, black is normal, it just show black when you leave it for a long time, it will turn off the screen.
Keep the installer for some more time, and if the loop is endless, I will show you the way to bypass OOBE. (Sometimes QEMU is just to slow)
Yeah, it's 2 hours. I know how to skip OOBE mind you, so should I reboot the VM?
If you reboot the VM, it will show the error "please start the installation process again" or it will result in the endless loop again
I knew that, I'm skipped OOBE using the registry. Now Windows (really) didn't like that and started Automatic Repair, but I can easily skip that.
After get to the desktop, if you find the VM to slowly, you can try some optimize script on github for Windows ARM. Just search on google :)
Automatic Repair just crashed the entire VM. Now it's time to disable WinRE.
Well, after all that (I even skipped the OOBE), it still got stuck at the "Just a moment..." screen.
oh. now it's this.
Change -device virtio-blk,drive=system
to -device usb-storage,drive=system
That certainly fixed the problem. However, I had to change the boot order. I also tweaked the res a little bit from 800x600 to 1024x768 in the BIOS so it looked more great in there.
And Windows kept booting and hanging at the spinning animation
Spinning? The boot screen with Windows logo?
Yeah. It is hanging there really, but the spinner is still spinning. It's already half an hour.
Have you boot to the desktop yet? (Since you skipped OOBE?
Nope, I had to do a full reinstall (using dism and bcdboot), because the normal way got stuck at the "Just a moment..." waiting screen.
Oh anyways, now it finally booted. QEMU is just so slow...
Be patient! :)
It's so slow!!!!!!!!!! (I reached the desktop but Explorer hasn't even loaded finished)
Buy an ARM-based SBC and run KVM on it (I currently do that) and it is much better
Explorer is literally crashing constantly because of the high CPU load.
Yeah, the installer got hung at the boot logo for a long time. I left it for hours and still nothing. Any ideas?