Windows VM continously starts in Auto Repair and won't boot


Recommended Posts

I had to shutdown and replace a failed drive in my machive, however now my Windows 10 VM automatically starts in "Auto Repair" mode and won't fully boot, or give options to boot in safe mode.

 

This is the logs that I have after the latest startup

018-04-06 18:37:17.137+0000: starting up libvirt version: 2.4.0, qemu version: 2.7.1, hostname: Treebeard
LC_ALL=C PATH=/bin:/sbin:/usr/bin:/usr/sbin HOME=/ QEMU_AUDIO_DRV=none /usr/local/sbin/qemu -name 'guest=Windows 10,debug-threads=on' -S -object 'secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-12-Windows 10/master-key.aes' -machine pc-i440fx-2.7,accel=kvm,usb=off,dump-guest-core=off,mem-merge=off -cpu host,hv_time,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_vendor_id=none -drive file=/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd,if=pflash,format=raw,unit=0,readonly=on -drive file=/etc/libvirt/qemu/nvram/5df67131-6ea2-111a-0771-8e6dc459bb66_VARS-pure-efi.fd,if=pflash,format=raw,unit=1 -m 8192 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 5df67131-6ea2-111a-0771-8e6dc459bb66 -no-user-config -nodefaults -chardev 'socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-12-Windows 10/monitor.sock,server,nowait' -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -no-hpet -no-shutdown -boot strict=on -device ich9-usb-ehci1,irive-ide0-0-1,id=ide0-0-1 -netdev tap,fd=24,id=hostnet0,vhost=on,vhostfd=26 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:8a:5b:3e,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev 'socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/domain-12-Windows 10/org.qemu.guest_agent.0,server,nowait' -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -device usb-tablet,id=input0,bus=usb.0,port=1 -vnc 0.0.0.0:0,websocket=5700 -k en-us -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -msg timestamp=on
Domain id=12 is tainted: high-privileges
Domain id=12 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)

And this is the XML for the setup:

 

<domain type='kvm'>
  <name>Windows 10</name>
  <uuid>very unique</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>1</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='1'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/5something_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/Windows 10/vdisk1.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/Windows 10/vdisk2.img'/>
      <target dev='hdd' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/Windows10.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/virtio-win-0.1.141.iso'/>
      <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='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' 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='0x04' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='something'/>
      <source bridge='br1'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.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='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <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>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Everything was working fine until the reboot. Any suggestions would be appreciated.

Link to comment

I had this happen with one of my VM's recently. I had a backup of the vdisk so I was able to copy it over and boot up ok. Other than that, I had no luck getting through the Windows repair cycle. You might just have to start from scratch unless someone else has a solution.

Link to comment
On 4/6/2018 at 11:53 AM, jeffmackinnon said:

Everything was working fine until the reboot. Any suggestions would be appreciated.

In the auto-repair mode do you have an option for a command line? 

If so, a simple thing to try is repairing the file system (which will 10-15% of the time kick you out):

chkdsk /f /x c:

Assuming c: is the correct drive letter for your Windows guest, in this enviroment, might be D: -- a quick DIR to verify it looks like the right volume.  If the check disk found no errors with the file system. Then I would try replacing the Windows boot manager. (from: https://support.microsoft.com/en-us/help/927392/use-bootrec-exe-in-the-windows-re-to-troubleshoot-startup-issues

 

bcdedit /export C:\BCD_Backup
c:
cd boot
attrib bcd -s -h -r
ren c:\boot\bcd bcd.old
bootrec /RebuildBcd

But really, without an error code it's difficult to say, "Doing XYZ will fix your particular error code."  Granted I find the Windows 10 tools to be hit or miss (mostly misses). But based on your original post I'd bet the error is inside your guest-VM, and not something outside with KVM or unRAID.

  • Like 1
Link to comment
15 hours ago, jeffmackinnon said:

Did you ever figure out what happened? And after you had it running again, did it stay stable?

 

No. I figure the vdisk image was corrupt or something. Been stable with the back though. I always backup my vdisk images just in case.

Link to comment
8 hours ago, Jcloud said:

But really, without an error code it's difficult to say, "Doing XYZ will fix your particular error code."  Granted I find the Windows 10 tools to be hit or miss (mostly misses). But based on your original post I'd bet the error is inside your guest-VM, and not something outside with KVM or unRAID.
 

Thanks for your help, I will give those tricks a try.

 

Cheers,
JM

Link to comment
1 hour ago, jeffmackinnon said:

Thanks for your help, I will give those tricks a try.

You're welcome.

 

  I'd be interested in the results, for my own curiosity, working or not. And if you want to post a screen cap of the Windows error I might be able to give a few more suggestions.  Otherwise I would say time to make a another VM and re-install, if you have files inside the VM image file I'd bet the data is still good, so you could keep the image file and mount it as a second drive on the new vm, once you've installed Windows again, and copy file over to new VM (can't drag programs over, but still). 

 

Good luck 

Link to comment
  • 1 year later...

AT LEAST FOR ME FIXED!

The problem I had is that I could not even access to the C : drive and fix the Win10 OS, so what I did and it worked for me it was that:

Steps:

  • Stop the machine
  • Do edit virtual machine and select the "virtio drivers ISO" that you can download from https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html and save
  • Start the virtual Windows machine
  • When the  broken windows show you the Troubleshoot, select "Advanced Options"
  • Now click on "Command Prompt"
  • Now try to go to C :, D :, E: until doing "dir" you find some directories like "viostor" or "w10" in my case was "viostor"
  • do (depending on the virtio drivers ISO you have to find the proper folder but allways something related with the name viostor)
  • cd viostor\w10\amd64
  • then type:
  • drvload viostor.inf
  • Then close the CMD and without restarting click on "Startup Repair" and after getting mad of waiting for 20 mins the windows 10 shines again!!!

Greetings and I hope it will be usefull!!,

David Lyons

 

 

  • Like 1
  • Thanks 4
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.