Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Tutorial for restoring VMs?

Featured Replies

Is there a simple or step by step tutorial for backing up and restoring VMs?  I used the plugin to backup some drives but cannot find an understandable procedure on how to restore them.  The spaceinvader video is 6 years old and the Vm Backup support thread link for restoring doesnt make sense. 

Do you have a libvirt.img backup or just the vdisks?

  • Author

I used the backup script so I have the .fd, the .xml, and the img for each machine

  • Author

I tried moving them to various places but the gui doesnt seem to have an 'open' vm prompt, it only lets you create one.  Thanks again

You can create a new VM and copy/paste the XML, not sure about the .fd, you might try asking in the plugin support thread, I recommend backing up libvirt.img instead, with that and the vdisks you have everything you need.

there are 2 fd file, one is the ovmf bios, which can be created new, they all are the same. The other is the var fd which contains the efi variables, you can use the backup (by pointing in the xml to the backup vars fd file) if you want to backup the efi variables or you can use a new one, in this case it's like as you do a nvram reset.

  • Author

First, thank you both for replying.  But I literally dont understand.  I think I can copy the xml data to the new one and will try.  I should have said 'for dummies' above lol

Basically copy xml in a text file, copy vdisk.img, copy the ovmf_vars.fd.

Create a new empty vm and do not start it.

Replace the new xml code with the one from the xml backup.

Check the paths in the code of the xml for the vdisk.img and for the ovmf_vars.fd and change them pointing to that of your backup files.

If the vm fails to start because of the uuid, meaning it's duplicated, delete the uuid line in the xml, libvirt will automatically create a new one.

  • 1 year later...

@ghost82 Following on this thread I am now in the process of restoring a VM.  I am running the backup plugin and have some questions before I do this:

 

I notice in the backup directory that I have several copies by date of the img, xml and fd file.  But the newest img file does not have an xml or an fd file associated with it.  Should I revert back to the next newest file set where all three exist?  Or can I use the xml and fd files from an older backup set?

 

My fd file is not named ovmf_vars.fd but 20240206_0300_5ab648ed-0c63-aa51-400c-277ece7bd277_VARS-pure-efi.fd.  I assume that doesn't matter?

 

Looking at the xml I see a few corrections I might need to make:

 

/mnt/user/domains/Outlook/vdisk1.img - the image is currently in a backups folder - so I will move it to the corresponding folder in domains and leave this as is.

 

Should I do anything with the 20240206_0300_5ab648ed-0c63-aa51-400c-277ece7bd277_VARS-pure-efi.fd file that is currently in the backups folder?

 

Thanks!

Hello @The Transplant

I never used the backup plugin, so I'm sorry but I don't know how this plugin works.

Anyway...

18 hours ago, The Transplant said:

But the newest img file does not have an xml or an fd file associated with it

 

An img file is the disk file.

The xml file contains the emulated hardware and layout of the virtual pc.

The edk2 ovmf code fd file is the bios of your virtual pc.

The edk2 ovmf vars fd file is the nvram of your virtual pc.

You need these 4 things to boot a qemu vm.

 

18 hours ago, The Transplant said:

But the newest img file does not have an xml or an fd file associated with it

 

You should be able to boot the img by recreating the other 3 files; you can copy the ovmf code fd file from another vm (it's the bios, the bios is the same for every vm), and you also can use the ovmf vars fd file copied (better) from the same vm (the vars file can contain nvram variables, such as boot order).

As far as the xml you can create a new vm, so to generate a new xml and change the relevant part of this new xml to point to your img disk file, and fd files; if hardware layout is different than the old xml (for example, you add a new usb virtual controller which was not there in the original vm), windows should be smart enough to not hang. Obviously you need to know if your original vm was a uefi or bios vm, q35 or i 440fx, so you can create the new vm accordingly, using ovmf or seabios nad q35 or i440fx virtual chipsets.

 

19 hours ago, The Transplant said:

My fd file is not named ovmf_vars.fd but 20240206_0300_5ab648ed-0c63-aa51-400c-277ece7bd277_VARS-pure-efi.fd.  I assume that doesn't matter?

Correct, it doesn't matter, unraid applies a prefix with the uid of the vm to the filename.

 

19 hours ago, The Transplant said:

/mnt/user/domains/Outlook/vdisk1.img - the image is currently in a backups folder - so I will move it to the corresponding folder in domains and leave this as is.

Either edit the path to point to that of where the img is, or move the img to that path.

 

19 hours ago, The Transplant said:

Should I do anything with the 20240206_0300_5ab648ed-0c63-aa51-400c-277ece7bd277_VARS-pure-efi.fd file that is currently in the backups folder?

This file should contain some nvram variables, but it shouldn't matter, make sure to check the xml to point to this file.

If it doesn't boot you may need to enter the ovmf bios screen (by pressing esc key on vm boot repeatedly) and change the boot order.

Thanks @ghost82 - I did manage to restore the older file and get it running.  But I had made some changes and want to get the newer image restored so will work through your suggestions above.  

 

The backup script I am using just seems to make a copy of the .img, xml, and .fd file.  It did take me a while to realize that it was appending dates to the front of these files - so you could maintain multiple backups.

 

This feels like something that should be native in the GUI for both dockers and VMs.  Since I had not been through a crash like this it took me down for a number of days while I learned how to restore.  A simple create new VM and click on restore and select the backup would have been nice, and from a software standpoint is remarkably simple to add?

 

I appreciate the help!

17 hours ago, The Transplant said:

I did manage to restore the older file and get it running.  But I had made some changes and want to get the newer image restored so will work through your suggestions above

If an older backup works, just replace the img file with the newer one and it should boot.

6 hours ago, ghost82 said:

If an older backup works, just replace the img file with the newer one and it should boot.

Thanks - that did work.  Definitely not an experience I would want to repeat.

 

The reason I had to do this in the first place is because 1 of my 2 cache drives failed.  I replaced it but I am still in the process of moving data off the second cache drive onto the new replacement, and then the plan is to mirror this drive to avoid issues like this.

 

This is another daunting task - nothing seems to work as planned.  If you feel inclined to take a look - here is the link to that thread.  Thanks!

 

 

  • Author

This is something that is simple in most Hypervisors but nearly impossible here.  Not sure that it should be that way. 

I have had relatively limited experience with hypervisors but it seems like a simple backup and restore should not be this difficult.
 

But I am learning that unraid has come a long way but still requires a fairly deep understanding of what is going on behind the scenes to recover from any issues.

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.