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.

What backup scripts or services are folks using for their VMs?

Featured Replies

Due to a recent snafu of a VM w/ W10, I have determined that I need to start performing daily backups of my vdisk1.img file to another drive. So, the question is....what are others doing? What script or services are people using?

I use Acronis from within my VM to backup to a network location.  Then I just load an Acronis recovery CD in the VM and restore from the image I created.  I'm using Windows 7 but it should work with Windows 10 as long as it is a compatible version of Acronis.

Due to a recent snafu of a VM w/ W10, I have determined that I need to start performing daily backups of my vdisk1.img file to another drive. So, the question is....what are others doing? What script or services are people using?

 

Well there are two methods I guess. You can either backup the VM OS like it was any other computer or you can backup the vdisk1.img itself. Either way I think the standard tools are still applicable.

 

http://lime-technology.com/forum/index.php?topic=47651.msg456651#msg456651

 

I prefer backing up the VM at KVM File level then you don't have to try and "restore" an OS from within a VM, which can be tricky.

 

Referencing the above link though, I for instance have skipped between two methods. Managed from a Windows machine had SyncBack backup the KVM disk VM Files, meaning I can easily restore the VM within unRAID. You could use Rsync for this within unRAID OR Crashplan Docker etc etc

  • Author

I don't quite understand why you would need to backup anything but the vdisk1.img file. It seems to me that the W10.iso file and the virtio-win.iso drivers file never change. Isn't the vdisk1.img the only file that holds any changed data like installed apps, W10 registry, etc.? Seems like recovery would be just as simple as replacing the corrupted vdisk1.img file with the backup copy from the day before. Or, am I missing something?

I don't quite understand why you would need to backup anything but the vdisk1.img file. It seems to me that the W10.iso file and the virtio-win.iso drivers file never change. Isn't the vdisk1.img the only file that holds any changed data like installed apps, W10 registry, etc.? Seems like recovery would be just as simple as replacing the corrupted vdisk1.img file with the backup copy from the day before. Or, am I missing something?

 

Perhaps you're right. I tend to backup everything. Overkill.

I don't quite understand why you would need to backup anything but the vdisk1.img file. It seems to me that the W10.iso file and the virtio-win.iso drivers file never change. Isn't the vdisk1.img the only file that holds any changed data like installed apps, W10 registry, etc.? Seems like recovery would be just as simple as replacing the corrupted vdisk1.img file with the backup copy from the day before. Or, am I missing something?

 

If you use a "live" imaging program you can backup from within the VM while it's running.    If you want to simply backup the vdisk1.img file the VM has to be shut down while you copy the file.  As long as you do that, then you're correct -- you can simply copy the virtual disk file back to "restore" it.    Which is more convenient depends on your usage pattern for the VM.

 

I don't quite understand why you would need to backup anything but the vdisk1.img file. It seems to me that the W10.iso file and the virtio-win.iso drivers file never change. Isn't the vdisk1.img the only file that holds any changed data like installed apps, W10 registry, etc.? Seems like recovery would be just as simple as replacing the corrupted vdisk1.img file with the backup copy from the day before. Or, am I missing something?

 

If you use a "live" imaging program you can backup from within the VM while it's running.    If you want to simply backup the vdisk1.img file the VM has to be shut down while you copy the file.  As long as you do that, then you're correct -- you can simply copy the virtual disk file back to "restore" it.    Which is more convenient depends on your usage pattern for the VM.

That is why I use Acronis from within the VM.  My VMs are recording servers and doing it this way I can make an image backup while it is busy recording something.  The only time I have to shutdown the VM is if I want to restore it completely - like the VM was a bare metal restore.

If you want to simply backup the vdisk1.img file the VM has to be shut down while you copy the file.  As long as you do that, then you're correct -- you can simply copy the virtual disk file back to "restore" it.

 

Is there a way to shut down / restart a [Win7] VM with a script like you can a docker container? That would allow us to back up the vdisk using cron.  I use Acronis, too, but I'm a belts-and-suspenders guy like danioj.

Is there a way to shut down / restart a [Win7] VM with a script like you can a docker container?

Sure. Google virsh command options.

If you want to simply backup the vdisk1.img file the VM has to be shut down while you copy the file.  As long as you do that, then you're correct -- you can simply copy the virtual disk file back to "restore" it.

 

Is there a way to shut down / restart a [Win7] VM with a script like you can a docker container? That would allow us to back up the vdisk using cron.  I use Acronis, too, but I'm a belts-and-suspenders guy like danioj.

 

I will use my ubuntu virtual machine running on my server in these examples.

 

First list virtual machines that are running, type the following command:

 

root@main:~# virsh list

 

You will get an output similar to my output:

 

root@main:~# virsh list
Id    Name                           State
----------------------------------------------------
1     ubuntu-vm-main                 running
2     windows-vm-main                running

 

clean shutdown a guest virtual machine, type one of the following commands:

 

root@main:~# virsh shutdown ubuntu-vm-main
root@main:~# virsh 1

 

You will get an output similar to my output:

 

root@main:~# virsh shutdown ubuntu-vm-main
Domain ubuntu-vm-main is being shutdown

root@main:~# 

 

OR

 

restart a guest virtual machine, type one of the following commands:

 

virsh reboot ubuntu-vm-main
virsh reboot 1

 

You will get an output similar to my output:

 

root@main:~# virsh reboot ubuntu-vm-main 
Domain ubuntu-vm-main is being rebooted

root@main:~# 

 

OR

 

force shutdown a guest, type one of the following commands:

 

virsh destroy ubuntu-vm-main
virsh destroy 1

 

You will get an output similar to my output:

 

root@main:~# virsh destroy ubuntu-vm-main
Domain ubuntu-vm-main destroyed

root@main:~# 

 

Hope this helps.

Thanks, guys! Just what I was looking for.

I'm using Macrium Reflect free from within my windows 10 VM, it has worked great for multiple restores. I do wish unraid had a built in method of backing up the .img file, maybe that will be added sometime?

Nice post Daniel => those commands provide everything that would be needed to create a simple script to backup a VM.

 

e.g. (a) shut it down;  (b) copy the virtual disk; and © restart the VM

 

 

One question:  What happens if you invoke the shutdown command and the VM isn't currently running?  [i.e. would this cause a script that started with that command to fail?]

 

 

Nice post Daniel => those commands provide everything that would be needed to create a simple script to backup a VM.

 

e.g. (a) shut it down;  (b) copy the virtual disk; and © restart the VM

 

 

One question:  What happens if you invoke the shutdown command and the VM isn't currently running?  [i.e. would this cause a script that started with that command to fail?]

 

It throws an error. I destroyed a Virtual Machine on my server and then tried to shut it down.

 

This is an example of the output:

 

root@main:~# virsh destroy ubuntu-vm-main
Domain ubuntu-vm-main destroyed

root@main:~# virsh shutdown ubuntu-vm-main
error: Failed to shutdown domain ubuntu-vm-main
error: Requested operation is not valid: domain is not running

root@main:~# 

 

You inspired me to do something  8):

 

http://lime-technology.com/forum/index.php?topic=47986

Archived

This topic is now archived and is closed to further replies.

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.