Laptop Acer Aspire A315 with i5 2.4 GHz, 16 Gb RAM and NVMe drive.
Using QEMU 7.1
Trying to install Win11 VM from scratch.
First create virtual disk:
qemu-img create -f qcow2 -o extended_l2=on,cluster_size=128k virtuals/win11.qcow2 64.8G
Then run VM like this:
qemu-system-x86_64 \
-name "Win11" \
-machine type=pc-q35-7.1,accel=kvm \
-cpu host,hv_passthrough \
-smp 8,sockets=1,cores=4,threads=2 \
-m 8G \
-drive if=pflash,format=raw,readonly=on,file=/usr/share/qemu/ovmf-x86_64-ms-4m-code.bin \
-drive if=pflash,format=raw,file=virtuals/ovmf-x86_64-ms-4m-vars.bin \
-boot menu=on \
-netdev tap,br=br0,helper=/usr/lib/qemu-bridge-helper,vhost=on,id=n1 -device virtio-net-pci,netdev=n1,mac=52:54:00:12:34:56 \
-rtc base=localtime \
-vga qxl -device virtio-serial-pci -spice unix=on,addr=virtuals/vm_spice.socket,disable-ticketing=on -chardev spicevmc,id=spicechannel0,name=vdagent -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
-display spice-app \
-audiodev spice,id=xyz -device ich9-intel-hda -device hda-output,audiodev=xyz \
-device virtio-balloon-pci \
-device qemu-xhci,id=xhci1 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 \
-monitor stdio \
-drive file=virtuals/win11.qcow2,index=0,media=disk,format=qcow2,discard=unmap,id=disk1,if=none -device virtio-blk-pci,drive=disk1,physical_block_size=4096,logical_block_size=4096,bootindex=1 \
-drive file=virtuals/Win11_23H2_Spanish_x64v2.iso,index=1,media=cdrom,id=iso1,if=none -device ide-cd,drive=iso1,bootindex=2 \
-drive file=virtuals/virtio-win-0.1.240.iso,index=2,media=cdrom
-chardev socket,id=chrtpm,path=virtuals/tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
The Win11 ISO did boot, and even allowed to format and write to the detected virtio disk after loading the corresponding virtio drivers, then proceeded to install.
But when rebooting, the virtio disk is not recognized at all; instead tries to boot from Win11 ISO again, since it’s the only thing it finds bootable.
Tried entering the UEFI setup with Esc key, and after a device discarding process, I saw that CDVD drives are correctly recognized, but the virtio disk is just merely “UEFI Misc Device” instead of “UEFI QEMU disk”.
I tried every firmware available at /usr/share/qemu/ovmf*, and all give the same result.
However, my old win11.qcow2 disk file, which was created back on Leap 15.4 with QEMU 6.2, is indeed recognized and boots! Albeit after updating to Win11 23h2 every single windows cumulative update makes the vm BSOD, which is why I tried reinstalling.
What’s happening? Can someone help please?
Thanks.