6.2.0 Beta 19 cannot get restored VM to Boot


Recommended Posts

This morning my Windows 10 VM would only run for a few seconds before booting up, so I removed the SSD to another PC to update firmware and test. Everything looked good so I put it back in the server and decided to restore a backup just to be safe.

 

I removed the VM and it's vdisk and started over with the windows 10 template. I booted up with the restore media and was able to successfully restore, but on reboot Ithe VM comes up to a bios screen and then a Shell> prompt.

 

It seems to me like for whatever reason the VM bios is not recognizing the SSD (mounted with unassigned devices) and won't boot to it. Below is my XML file:

 

<domain type='kvm'>
  <name>Aryll</name>
  <uuid>7c5f5f8b-0547-ce30-cb44-5a8f625da249</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>20971520</memory>
  <currentMemory unit='KiB'>20971520</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='4'/>
    <vcpupin vcpu='1' cpuset='5'/>
    <vcpupin vcpu='2' cpuset='6'/>
    <vcpupin vcpu='3' cpuset='7'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/7c5f5f8b-0547-ce30-cb44-5a8f625da249_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor id='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='2' threads='2'/>
  </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/disks/ssd2/Aryll/vdisk1.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/tmp/VM Installation Media/Rescue.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/tmp/VM Installation Media/virtio-win-0.1.112-1.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='0x03' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:bc:4e:96'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <source mode='connect'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x14' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

I have no idea how to troubleshoot at this point can anyone see anything amiss in the XML?

 

I have noticed that when I edit the VM, the Primary vDisk location is always set to none, but the XML has the correct path. The bios is also set to OVMF, and cannot be changed, I don't think that's what I was using with my old VM, the boot screen looks different to me.

Link to comment

At the shell prompt, try entering:

 

fs0:  (if that doesn't work, try fs1:)

cd efi

cd boot

bootx64

 

I'm going off of memory, so the above might not be 100% correct.  There's a few posts about that issue elsewhere on the forum with the correct commands if the above aren't correct.

 

If your VM still doesn't boot, try building one with SeaBIOS instead and seeing if that one will boot.

 

There is a known issue with the path to the .vdisk getting lost when you edit the VM.  Just make a habit of flipping it from none to custom and ensuring the file path is correct every time you edit the VM until the issue is resolved.

Link to comment

OK, the SeaBIOS switch worked, I think that's what the original VM was set to. Can it not be switched once a VM is created?

 

I tried the commands while it was still on OVMF and it fs0 was the OS install media and the was no fs1.

 

I'm happy to have my VM back up and running, but is this the expected behavior?

Link to comment

OK, the SeaBIOS switch worked, I think that's what the original VM was set to. Can it not be switched once a VM is created?

No.  If you want to switch types you have to rebuild the VM from scratch.

 

I'm happy to have my VM back up and running, but is this the expected behavior?

if you switched types then yes this is expected behaviour.
Link to comment

OK, the SeaBIOS switch worked, I think that's what the original VM was set to. Can it not be switched once a VM is created?

No.  If you want to switch types you have to rebuild the VM from scratch.

 

I'm happy to have my VM back up and running, but is this the expected behavior?

if you switched types then yes this is expected behaviour.

Not enterely true, you can convert BIOS (SeaBIOS) to UEFI (OVMF).

I did it 3 years ago on a physikal machine (Win8 i think, maybe Win7) and last week on unRAID with a Win10 VM.

 

1) I copied the vDisk of my VM. (as an insurence if anything went wrong)

2) created a new VM (same specs, just OVFM) and attached the copied vDisk.

3) booted a gParted .iso and converted the disk from MBR to GPT (see comment from "Lars Johan Olof Lidström")

4) mounted virtio driver .iso and booted with the Windows .iso

5) start setup and follow it until the driver installation, just choose the storage driver, so that the disk is found.

6) cancel setup and go to recovery mode. Choose cmd/cli to use diskpart.

7) followed THIS GUIDE to create a working GPT/EFI Boot environment. Reboot and you are done.

 

*) I changed the MAC-addres to that of the original VM, but thats optional and only neccesary if the mac is uses somewhere in your vm/network

*) 32bit Windows may not work at all with EFI/OVMW.

*) In my case, I never had do re-activate my Windows license, but I can't guarantee it.

 

A lot of steps and some knowledge about the involved tools would be recommended. Which is why the usual answer is "No, do a fresh install" and probably why you can't switch this option in unRaid on an existing VM.

 

So depending on your installation, a fresh start may be simpler/faster, but its a good learning experience :)

And if you do it on a copy of your disk, with a new VM, worst case is you waste a lot of time :)

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.