[Guide] Recover VM from vdisk (after power loss)


zer0ish

Recommended Posts

I'm very new to unraid and figure it would be useful for others to have this information.

If you have ever had an ungraceful shutdown of your unraid server, you’ve most likely booted it back up to see your VM are no longer in the VMS tab.

image.thumb.png.7f748d6752aeea4209e0788a275c1b1b.png

This happened to me yesterday due to a crazy Canadian winter ice storm, and finding information on how to recover this wasn’t clear.

Most post I've read, have replies saying the libvirt.img was corrupted.

 

This could be the case for some people, but not for me and I assume most others. These steps can be taken even after deleted the libvirt.img so long as you have the vdisk available.

 

Here is how I recovered my VM.

Please note this is only tested on a Linux VM since my current unraid server is on a miniPC that isn’t good enough to run VM’s and can’t install a Windows VM.

 

This is just a testing system to play with unraid while I build my power house rig.

 

With that said, lets start.

 

Step 1: Make sure your directory and vdisk is still where it was, and note the name of the folder, for me it was "Kali Linux".

image.png.7680937df035d6996cd4b5b3896f0366.pngimage.png.630103d02f85977111e456a29209bce0.png

 

Step 2: Go to the VMs Tab and click “ADD VM”.

 

 

Step 3: Select what ever the old VM was. In my case, it was Linux.

image.png.89ffaa510f7675254b7bce0cba3d0d94.png


Step 4: Set the “Name” to what ever it was before and it should auto set the “Primary vDisk Location” to what you had in Step 1.
Wrong name shows this:
image.png.d9fa71b9c2003b90ab54caccdd801940.pngimage.png.67a78042a4bea5765beb24e9740fbdfb.png

 

Correct Original Name shows this:
image.png.ccca267bacdd4a29adc4475a35fe7556.pngimage.png.fb6016d32f49e32b0722034801adce89.png

 

Step 4.1: Set your “Initial” and “Max” Memory and anything else as close to what you had it before.

This part is less important and can be changed later for most options.

You do not need to select an “OS Install ISO”. Leave it alone.

 

Step 5: Once all is what it needs to be, Click “Create”.

image.png.46365532222e1a57e035d116a1c4f046.png

 

Step 6: When the VM starts in noVNC, you will have this Shell screen.
image.thumb.png.95163e051be9b3995354923f7e1bc56d.png

 

Step 7: Type "Exit" in the Shell prompt. And you will be greeted by the BIOS screen.

image.thumb.png.721095cfe896dba3363b0f8b942b52dc.png

 

Step 8: Go to Boot Maintenance Manager.

image.thumb.png.570e38ad1e94e81478eb727622806bb6.png

 

Step 9: Boot Options.

image.png.775c2547079fdd862d52aa186ca4bf31.png

 

Step 10: Add Boot Option.

image.png.9793b7f169d2903a872534184ccdef30.png

 

Step 11: Select the NO VOLUME LABEL.

image.thumb.png.071e6d29d535c0192e120638e04ea3ac.png

 

Step 12: Select <EFI>.

image.png.f3aeee953b4f911a5de6da4aa9e0e9a3.png

 

Step 13: Select your directory. In my case it was called Kali.

image.png.e7e31f7a9b4cc3a514395ade8172fe63.png

 

Step 14: Select grubx64.efi.

image.png.e577a23ac4261dcb4d78eb69fb1bd805.png

 

Step 15: Go to “Input the description” and hit Enter. Type in something, I typed Kali Linux. This is what will be used in the Boot options. This is important, do not forget to name it.

image.thumb.png.89260fd132e3ee8617fc8c7de72ef072.png

 

Step 16: Select “Commit Changes and Exit”.
image.png.09b1b97ddf3a6ac7e29ad516cdb53335.png

 

Step 17: Go to “Change Boot Order” then select the boot devices and tap enter.

I want my new device booting first, so I will highlight my device, tap the + button to move Kali Linux(The name we used in step 15) to the top, then hit enter.

image.thumb.png.c7b9051bddebec81119c3ff1fbf5a406.png

 

Now we have a new boot order for this VM.
image.thumb.png.464b08cf4ea63f5f2e4e25bb0661d469.png

 

Step 18: Select “Commit Changes and Exit”

image.thumb.png.0c79b9e994c387fb8d02a17fc6c84390.png

 

Head back to the main BIOS screen and select Boot Manager.
You should now see your new boot device at the top of the list.

image.png.7cff25ecaaa7fe33d127e27d66f60ea2.png

 

Go back to main BIOS screen again and select Continue.

You will be sent to the proper recovered VM.

image.png.abf258173884490d5bc740970f212ad6.png

 

 

Enjoy your recovered VM.

 

 

 

Edited by zer0ish
  • Like 1
Link to comment
  • zer0ish changed the title to [Guide] Recover VM from vdisk (after power loss)

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.