You are not logged in.
Pages: 1
Dear Arch Community,
I am running into problems trying to install Windows 10 inside a QEMU VM. Before giving a detailed account of said problems, here the relevant system information:
HP Elite Book 840 G8
11th Gen Intel i5
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 39 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Vendor ID: GenuineIntel
Model name: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
CPU family: 6
Model: 140
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
Stepping: 1
CPU(s) scaling MHz: 19%
CPU max MHz: 4200.0000
CPU min MHz: 400.0000
BogoMIPS: 4840.00
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 invpcid_single cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt flush_l1d arch_capabilities
Virtualization: VT-x
L1d cache: 192 KiB (4 instances)
L1i cache: 128 KiB (4 instances)
L2 cache: 5 MiB (4 instances)
L3 cache: 8 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-7
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
KVM modules loaded
$ lsmod | grep kvm
kvm_intel 389120 4
kvm 1118208 1 kvm_intel
irqbypass 16384 1 kvm
Virtualization enabled in BIOS
Up-to-date generic Arch install with default kernel ($ uname -a Linux hp 5.18.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 25 Jun 2022 20:22:01 +0000 x86_64 GNU/Linux)
I have installed the qemu-desktop package, and created a raw disk image via `qemu-img create -f raw win.raw 40G`. I now seek to boot the official Windows 10 ISO and install the operating system inside a QEMU VM. This leaves me with the following problems:
Starting as simple as possible, running only `qemu-system-x86_64 -cdrom win10.iso -boot order=d -drive file=win.raw,format=raw -m 4G`, appears to boot the system until this blue screen hits. If I add `-enable-kvm` to the QEMU parameters, the boot process hangs indefinitely at the Windows logo.
For comparison, I have observed the exact same behavior (hanging/failing depending on whether KVM is enabled) with a Windows 7 ISO. It is also the same on Virtualbox. The ArchLinux ISO boots flawlessly in QEMU, irrespective of whether KVM is enabled.
My understanding is that the simple boot configuration in the preceding paragraph should suffice to boot Windows 10. If I am wrong, what (least) other parameters should I include? Or what else might cause this behavior?
Many thanks in advance for your help!
Offline
Try 'virt-manager' as a guided gui app to set up Windows with predefined settings. Once it's running you can extract the qemu command line from the logfile.
sys2064
Offline
There should be no reason for the VM to stale using KVM.
Have tried it here and it starts just fine.
I'm not a Win user and don't have a key for it so I don't get any further then the moment I need to input the key...
Try this line with your own paths of course
Haven't done any tweaking .. that's something you need to do yourself;)
qemu-system-x86_64 -boot order=d,menu=on,reboot-timeout=5000 -m size=4096,slots=0,maxmem=4294967296 -k en-us -name Win10_21H2_English_x64.iso,process=Win10_21H2_English_x64.iso_0 -device virtio-scsi-pci,id=scsi0 -device virtio-vga-gl -display sdl,gl=on -audiodev pa,id=snd0 -device ich9-intel-hda -device hda-output,audiodev=snd0 -device virtio-net-pci,romfile=,netdev=net0 -netdev user,id=net0,hostfwd=tcp::60037-:22 -machine type=q35,accel=kvm,usb=on,pcspk-audiodev=snd0 -global ICH9-LPC.disable_s3=1 -enable-kvm -device scsi-cd,bus=scsi0.0,drive=cdrom0 -drive id=cdrom0,if=none,format=raw,media=cdrom,read-only=on,file=Win10_21H2_English_x64.iso -cpu host,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-time -device qemu-xhci -device usb-tablet -drive file=virtio-win-0.1.217.iso,media=cdrom -hdd win10 -serial stdio -no-reboot
You can have a look at the next thread for explanations and clues and there are links you can follow; https://bbs.archlinux.org/viewtopic.php?id=274354
Also download the latest virtio-drivers you need from here: https://fedorapeople.org/groups/virt/vi … -downloads
Offline
I'd recommend to give Quickemu a try.
I have a running Windows 11 installation and it runs very smoothly.
Offline
Let me start by saying I don't want to start a dispute about what anyone should use;)
But using 'quickemu' why? what's the fun in that... none in my opinion.
BTW. The script is using the adguard domain to download image files for Win while you can get them directly from MS!
Really, I wont say don't use 'quickemu' it it's just .. well ...
Fiddling with and tweaking your lines should be something Archers like to do, mostly I think.
How easy is it to just write a nice script to do the job for you, at least you would have learned something from it.
I went ahead and did just that, don't just use it but to give you an impression of what you could do with a simple shell script.
Oh and this is mainly gathered from known sources, not much of my own, so you know!
#!/bin/sh
# change to where the files actually are
w10="$HOME"/archiso/iso-and-img/hd-img/win10
winiso="$HOME"/archiso/iso-and-img/iso-img/Win10_21H2_English_x64.iso
virtio="$HOME"/archiso/iso-and-img/iso-img/virtio-win-0.1.217.iso
dummy="$HOME"/archiso/iso-and-img/qcow-img/dummy
# install windows 10 to a virtual disk file
inst_win() {
qemu-system-x86_64 -enable-kvm \
-machine type=q35 \
-cpu host,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-time \
-device qemu-xhci -device usb-tablet \
-drive file="${w10}",index=0,media=disk,if=virtio \
-drive file="${winiso}",index=2,media=cdrom \
-drive file="${virtio}",index=3,media=cdrom \
-boot menu=on \
-net nic -net user,hostname=windows1064 \
-m 4G \
-monitor stdio \
-name "Windows 10 64 bits"
}
# install virtio driver in safe mode
virtio_win() {
qemu-system-x86_64 -enable-kvm \
-machine type=q35 \
-cpu host,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-time \
-m 4G \
-drive file="${w10}",if=ide \
-drive file="${dummy}",if=virtio \
-cdrom "${virtio}"
}
# use windows 10 installed VM
use_win() {
qemu-system-x86_64 -enable-kvm \
-machine type=q35 \
-cpu host,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-time \
-device qemu-xhci -device usb-tablet \
-drive file="${w10}",index=0,media=disk,if=virtio \
-boot menu=on \
-net nic -net user,hostname=windows1064 \
-m 4G \
-monitor stdio \
-name "Windows 10 64 bits"
}
pass() {
[ "$1" = 'i' ] && inst_win
[ "$1" = 'v' ] && virtio_inst
[ "$1" = 'u' ] && use_win
}
pass "$@"
edit: small change & some;)
Last edited by qinohe (2022-06-29 17:42:56)
Offline
Thanks so much for the many kind answers!
Clearly, the fact that Arch boots and Windows does not, indicates that the problem is because of the latter and not (primarily) because of QEMU.
As much as I would have liked for this to remain a QEMU-only journey (sharing the sentiment of qinohe), the plethora of available command line options means that I have for now taken up Maniaxx's suggestion, and installed virt-manager. Of course, a naive install with virt-manager's default settings failed as described in my first post. However, I have found this tutorial which uses TianoCore UEFI instead of the default SeaBIOS, and now Windows 10 boots and installs properly.
I will later look into extracting the corresponding qemu-system-x86_64 call (that will certainly include other overlooked parameters besides the bios setting).
Offline
...the plethora of available command line options means that I have for now taken up Maniaxx's suggestion, and installed virt-manager. Of course, a naive install with virt-manager's default settings failed as described in my first post. However, I have found this tutorial which uses TianoCore UEFI instead of the default SeaBIOS, and now Windows 10 boots and installs properly.
I don't think there's anything wrong with virt-manager I simply can't work with that 'thing';)
Very nice you managed to install it with TianoCore, I managed to install it perfectly fine but then it went awry somewhere along the way...
Will try it somewhere later (without the video;) and update the script too, which seems to do the job just fine .. for a BIOS system:-)
Offline
I am also running windows VMs under KVM/QEMU with libvirt.
With me, a windows 10 VM hangs at the logo. This is on my laptop, with an 11-th gen i5. Downgrading the kernel to e.g. 5.17.7 solves the problem.
On my other machine, very similarly configured but with an 8-th gen i5, everything is fine.
I have been wondering whether I should report this or just wait for a working kernel, for there should be plenty other people running into this.
Offline
I don't think there's anything wrong with virt-manager I simply can't work with that 'thing';)
I agree - in that I prefer the non-ambiguity of the command line over the comfort of GUI applications.
Regarding this thread: If you are facing issues running Windows VMs on QEMU with a Gen-11 Intel chipset, the current workaround is to select the UEFI boot option in virt-manager (adding the corresponding UEFI paramter to a `qemu` call may not suffice, as virt-manager includes other parameters under the hood.) However, because Windows should boot with SeaBIOS, this does not constitute a proper solution, and I shall refrain from marking the thread as solved.
Offline
Indeed, on my laptop with a gen-11 i5, a new UEFI-based win10 VM works just fine with the current kernel. I am glad I found this thread.
Offline
Sorry for necrobumping this, but for any wanderers the ideal steps are below
1. Create a directory and cd in it
2. Download the windows ISO (I got the Windows 1709 ISO for the best performance and stability)
3. Download the virtio drivers from https://fedorapeople.org/groups/virt/vi … -downloads
4. Create a new image by
qemu-img create -f qcow2 WindowsVM.img 64G
(change the size accordingly) for the storage
5. Launch the vm by the following command of which the parameters should be edited according to your system (if you are not sure, do not change the amount of sockets and threads, cores can be changed):
qemu-system-x86_64 -drive file=WindowsVM.img,format=qcow2,if=virtio -drive file=WindowsXXXXXX.iso,media=cdrom -drive file=virtio-win-X.X.XXX.iso,media=cdrom -boot order=d -device qemu-xhci -device usb-tablet -enable-kvm -machine type=q35 -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_time,hv_vapic,hv_vendor_id=0xDEADBEEFFF -rtc clock=host,base=localtime -m 32G -smp sockets=1,cores=6,threads=1 -vga virtio -display sdl,gl=on -name "Windows 10 1709 64 bit"
(to ensure windows skips the "Sign in with Microsoft" step do not add a network device and bring your main interface down)
6. Continue with the installation procedure
7. Click "Custom: Install windows only"
8. Click Browse > CD Drive with the virtio-win drivers > amd64 > wXX (for windows 10 it would be w10 etc) and OK then Next
9. Continue
10. After the installation shut off the VM, and to run from the disk just remove the virtio drivers and the ISO from the command. Also if the network already is not working you can add
-net nic -net user,hostname=windows
to the arguments. If you want to use VFIO/pass through a single GPU you can try following this guide: https://gitlab.com/YuriAlek/vfio/-/wikis/Use#windows
Last edited by to_you_bannana (2022-10-10 17:46:02)
Offline
Pages: 1