Imaging a drive with VBox on it

Discussions related to using VirtualBox on Windows hosts.
Post Reply
bgoodman4
Posts: 24
Joined: 10. Jun 2020, 08:03

Imaging a drive with VBox on it

Post by bgoodman4 »

I am new to VMs and was wondering if I were to image my PC (using Macrium Reflect 7) which is host to a Win 7 virtual machine and then revert the drive to an earlier date would the VM still function (I expect it will but would rather know in advance of having this occur). I do not expect the data in the VM to be the latest version but am hoping that that the VM will not be broken requiring the creation of a new VM. I do regularly export appliance and know that I can recover the VM by importing the appliance.

Thank you in advance.

PS: of course the drive is imaged when the VM and VBox are off-line.
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Imaging a drive with VBox on it

Post by BillG »

If you restored and image of the host OS, both the Virtualbox program and the vms would, just like everything else on the drive, revert to exactly as they were on the date you took the image backup. The only exception would be if you stored the virtual hard drive on a disk drive which was not included in the image backup.

The simplest way to backup a vm is to copy the entire folder for that vm from Users\yourusername\VIrtualBox VMs to some other location. You then have all you need to reproduce the vm. If the vm is somehow damaged or some part missing, you can simply copy the folder back into that location and re-register it (after deleting the faulty or incomplete one).
Bill
bgoodman4
Posts: 24
Joined: 10. Jun 2020, 08:03

Re: Imaging a drive with VBox on it

Post by bgoodman4 »

Thank you Bill for your reply, just one more question,,,,,,when you say "re-register it" are you referring to re-registering Microsoft or VBox or something else?

Probably a dumb question but I want to be sure I understand.
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Imaging a drive with VBox on it

Post by BillG »

Re-register the vm with VirtualBox. When you remove a vm, it removes it from the list of vms and removes the .vdi file from the media manager list. After you restore the vm folder to the Virtualbox VMs folder, you need to re-register that vm. The simplest way to do that is to double-click the .vbox entry. That will restore the vm to the list of vms in the VirtualBox Manager window.
Bill
Rootman
Posts: 251
Joined: 1. Oct 2012, 18:29

Re: Imaging a drive with VBox on it

Post by Rootman »

I have done exactly what you say here. I use Macrium Reflect and have had to restore my OS drive more than a few times.

It has never affected the Virtualbox guests that I have. I DO keep my guests on a separate drive though, I don't want them on the OS partition so that the huge size is not added to the Weekly Full Macrium Backup. When I restore the OS guests work fine as long as they were there when the image I restore from had them. If they happen to NOT have been on that image you simply do as BillG suggests, add them back.

And YES, if they are on the OS drive and part of the OS restore then the guests will be at whatever state they were when that backup was made - one additional reason to move them to a different drive /partition.

Macrium has saved my hiney more than once. Great product.
bgoodman4
Posts: 24
Joined: 10. Jun 2020, 08:03

Re: Imaging a drive with VBox on it

Post by bgoodman4 »

BillG wrote:Re-register the vm with VirtualBox. When you remove a vm, it removes it from the list of vms and removes the .vdi file from the media manager list. After you restore the vm folder to the Virtualbox VMs folder, you need to re-register that vm. The simplest way to do that is to double-click the .vbox entry. That will restore the vm to the list of vms in the VirtualBox Manager window.
I am confused. I am not, to my knowledge, removing a VM, I am imaging a complete drive that includes all files that exist on that drive, including all VBox files. So when I restore the drive from the image would not all those files and their associations be there?
bgoodman4
Posts: 24
Joined: 10. Jun 2020, 08:03

Re: Imaging a drive with VBox on it

Post by bgoodman4 »

Rootman wrote:I have done exactly what you say here. I use Macrium Reflect and have had to restore my OS drive more than a few times.

It has never affected the Virtualbox guests that I have. I DO keep my guests on a separate drive though, I don't want them on the OS partition so that the huge size is not added to the Weekly Full Macrium Backup. When I restore the OS guests work fine as long as they were there when the image I restore from had them. If they happen to NOT have been on that image you simply do as BillG suggests, add them back.

And YES, if they are on the OS drive and part of the OS restore then the guests will be at whatever state they were when that backup was made - one additional reason to move them to a different drive /partition.

Macrium has saved my hiney more than once. Great product.
Thank you for your reply. How do you keep your guests on a separate drive? I export the application to a separate drive so I can import them back to the PCs drive if nec but it sounds like you are doing something else.
Rootman
Posts: 251
Joined: 1. Oct 2012, 18:29

Re: Imaging a drive with VBox on it

Post by Rootman »

Create the partition or add the disk to the host, I'll leave the details how to you, this is a Windows function not VBox's. Create a subdir on the new drive named something like Virtual_Machines or whatever you like.

Move the VM guests to it by RIGHT clicking each VM in the VBox manager GUI and choosing MOVE and select the directory you just created on the new drive.

After you are done change the DEFAULT MACHINE FOLDER for VBox by clicking FILE -> PREFERENCES in the VBox manager GUI and change the "Default Machine Folder" to point to this new directory on the new drive. This will make VBox create any NEW VMs you create on that drive.

All of this is not strictly necessary. It MAY increase performance a tad if the second drive is another physical drive and an SSD as it won't be competing with the OS to write to the dick.

I put my VMs there it to limit the amount of data on my OS drive. I do the same for all my other personal data, I save it to this second drive. I occasionally install programs to the second drive as well, especially if they are large ones. This way my OS drive is smaller and can be backed up or restored by Macrium in less than 10 minutes and the stored backup files (which I also keep on this second drive) are smaller. I use an app named SyncBack Pro to copy all the data on the second drive to USB drives once a week (or more), including the Macrium Backups as backup copies of all the data including my VMs.
bgoodman4
Posts: 24
Joined: 10. Jun 2020, 08:03

Re: Imaging a drive with VBox on it

Post by bgoodman4 »

Thank you very much rootman for the detailed instructions. I only have 1 VM and it is only to run a Win 7 version of Win. I am doing this so I can run Lotus 123 a program that cannot be run on Win 10. The VM is rather small, under 40 gig so it does not impact much on the Macrium 7 images, especially since i am using a grandfather, father, son, schedule. I know its this size because I had initially tried to set up the VM using VBox portable. The set up was on a thumb drive. It worked with my old Win 7 PC but when I got my new Win 10 PC it would not load. I gave up and did a normal set up of VBox on the new PC.

Again thank you for the information you provided, much appreciated. I will keep it in mind if I find my M7 images are getting too large.
bgoodman4
Posts: 24
Joined: 10. Jun 2020, 08:03

Re: Imaging a drive with VBox on it

Post by bgoodman4 »

bgoodman4 wrote:
bgoodman4 wrote:
BillG wrote:Re-register the vm with VirtualBox. When you remove a vm, it removes it from the list of vms and removes the .vdi file from the media manager list. After you restore the vm folder to the Virtualbox VMs folder, you need to re-register that vm. The simplest way to do that is to double-click the .vbox entry. That will restore the vm to the list of vms in the VirtualBox Manager window.
I am confused. I am not, to my knowledge, removing a VM, I am imaging a complete drive that includes all files that exist on that drive, including all VBox files. So when I restore the drive from the image would not all those files and their associations be there?
Well, I finally decided to try it myself and all went smoothly. The virtual machine ran perfectly after the roll back using Macrium 7. Thanks to those who commented.
Post Reply