Return to Level1Techs.com

Can't get Windows 10 working in KVM on Arch Linux

helpdesk
#1

This is my first time installing a VM in Linux, so its possible that its just something simple.

After installing Windows 10 in a VM it normally reboots, and then it gets stuck for 30-60 mins on “Getting ready”, after that it reboots again, then it gets stuck at this screen:


after about 10-20 mins it reboots and just shows this:

I can click on “Next” all I want, it just does the same thing over and over again.

My Host:

  • MSI B350M Mortar
  • Ryzen 7 1700X
  • Nvidia GT 1030 (For Host)
  • Nvidia GTX 1080 (For Guest)
  • 16 GB RAM

My Guest:

  • 8 Cores
  • 8GB RAM

I’ve already tried:

  • passing through a real drive, instead of a virtual one
  • installing Windows with the GPU passed through

Here is the xml dump:

<domain type='qemu'>
  <name>win10</name>
  <uuid>294c7c29-687f-4aba-87f0-c09473722095</uuid>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-3.0'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/ovmf/x64/OVMF_CODE.fd</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
    </hyperv>
    <vmport state='off'/>
  </features>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
 <devices>
   <emulator>/usr/bin/qemu-system-x86_64</emulator>
   <disk type='file' device='disk'>
     <driver name='qemu' type='qcow2'/>
     <source file='/var/lib/libvirt/images/win10.qcow2'/>
     <target dev='hda' bus='ide'/>
     <address type='drive' controller='0' bus='0' target='0' unit='0'/>
   </disk>
   <disk type='file' device='cdrom'>
     <driver name='qemu' type='raw'/>
     <target dev='hdb' bus='ide'/>
     <readonly/>
     <address type='drive' controller='0' bus='0' target='0' unit='1'/>
   </disk>
   <controller type='usb' index='0' model='ich9-ehci1'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
   </controller>
   <controller type='usb' index='0' model='ich9-uhci1'>
     <master startport='0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
   </controller>
   <controller type='usb' index='0' model='ich9-uhci2'>
     <master startport='2'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
   </controller>
   <controller type='usb' index='0' model='ich9-uhci3'>
     <master startport='4'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
   </controller>
   <controller type='pci' index='0' model='pci-root'/>
   <controller type='ide' index='0'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
   </controller>
   <controller type='virtio-serial' index='0'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
   </controller>
   <interface type='network'>
     <mac address='52:54:00:2e:c8:e1'/>
     <source network='default'/>
     <model type='rtl8139'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
   </interface>
   <serial type='pty'>
     <target type='isa-serial' port='0'>
       <model name='isa-serial'/>
     </target>
   </serial>
   <console type='pty'>
     <target type='serial' port='0'/>
   </console>
   <channel type='spicevmc'>
     <target type='virtio' name='com.redhat.spice.0'/>
     <address type='virtio-serial' controller='0' bus='0' port='1'/>
   </channel>
   <input type='tablet' bus='usb'>
     <address type='usb' bus='0' port='1'/>
   </input>
   <input type='mouse' bus='ps2'/>
   <input type='keyboard' bus='ps2'/>
   <graphics type='spice' autoport='yes'>
     <listen type='address'/>
     <image compression='off'/>
   </graphics>
   <sound model='ich6'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
   </sound>
   <video>
     <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
   </video>
   <redirdev bus='usb' type='spicevmc'>
     <address type='usb' bus='0' port='2'/>
   </redirdev>
   <redirdev bus='usb' type='spicevmc'>
     <address type='usb' bus='0' port='3'/>
   </redirdev>
   <memballoon model='virtio'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
   </memballoon>
 </devices>
0 Likes

#2

Windows 10 1803 has had some issues in kmv, especially on amd cpus.
This thread might help-

It’s main suggestions are not to use host-passthrough on the CPU and to use options kvm ignore_msrs=1 in modprobe.d

1 Like

#4

Shouldn’t your emulator be qemu-kvm:

<devices>
 <emulator>/usr/bin/qemu-kvm</emulator>

Shouldnt video be virtio with acceleration(with opengl disabled):

<video>
    <model type='virtio' heads='1' primary='yes'>       
      <acceleration accel3d='yes'/>
0 Likes

#5

I just had to set my CPU to core2 to get windows 10 1803 to install in KVM on my 2700x.

0 Likes

#6

Okay, now I’ve tried to use “options kvm ignore_msrs=1” in modprobe.d, I changed the video to virtio with accelleration, and I set the CPU to core2duo. And I actually got further!
First it stuck about 10 mins at this:


and after that I get this screen:

I can’t set the emulator to qemu-kvm, it doesn’t exist, only “qemu-system-x86_64”.

0 Likes

#7

they you are not running pure KVM virtualization. If you have installed everything correctly and its still not “QEMU/KVM” I m 1000% sure you didn’t enable virtualization in bios. FOR AMD, (in uefi) its under CSM, Enable that and IOMMU too.

Also why are you setting it “core2duo” when you have Ryzen 7. Yes, i know “zen” is not on the list there. Try “hypervisor default” ? worked for me. Try tweaking things.

0 Likes

#8

I think its a bug with windows 10 build 1803, or the way that KVM/QEMU works with that particular build.

It’s a problem specific to 1803, if you leave it set to “copy host cpu configuration” the installer craps out with the (typical, totally craptastic) “something went wrong” error.

Sandybridge also works, which is what i have my VM set to now.

Other wIndows builds leaving at default the cpu shows up as epyc within the guest but this doesn’t work with 1803.

0 Likes

#9

Alright, I have set it to “Hypervisor Default”, and it gets just as far as before. I set it to core2duo, because @thro suggested it.

I was pretty sure I enabled it, but I double checked:


This should be okay, right? I don’t have something called “CSM”, but under “SVM Mode” it says, that SVM is for virtualization.

Do you have a link on how to install everything correctly? I just installed https://www.archlinux.org/packages/extra/x86_64/qemu/

0 Likes

#10

I tried setting the CPU to “EPYC” and then it worked, but only for one boot, next reboot it wasn’t working again.

0 Likes

#11

I got it working again, I first set the CPU to “kvm64” then to “qemu64” and then back to “EPYC” and now it starts for some reason…

1 Like

#12

Oh my god… the installed version was corrupted or something, no Network driver, no Internet Explorer / Edge, no default Wallpaper and my Username was “defaultuser0”. I just installed Windows again, and it’s back to the “OOBEWELCOME” error.

0 Likes