Page 1 of 1
Import VMs from Backup Folders…
Posted: 27. Mar 2022, 21:49
by smartysmart34
Hello all.
I had a laptop with zwo Vms on it using various snapshots. While I backed up the.VirtualBox folder and the folder containing the vdi files and snapshot directories, i did not export the appliances as part of thebackup.
That notebook broke down and i +got a new one. I also switched the user name for-a couple of räsonieren.
Is there a way to copy back the.VirtualBox folder and the vdi folder and use the vms again?
I first just copied the folder containing the vdi and snapshot files. I had to add the vms. But virtualbox does not seem to recognize the snapshots.
Then i restored the virtualbox folder. But then virtualbox does not even recognice the machines/disks because the configuration references the old user name. Which file contains the vm configuration including the path to the vdi files?
Kind regstes
Martin
Re: Import VMs from Backup Folders…
Posted: 28. Mar 2022, 11:28
by mpack
Simply copying the VM folders (not the .VirtualBox folder, which contains nothing important) is the preferred way to make backups. Export/Import is only used when exporting/importing to another VM platform such as VMWare.
To restore the VMs you basically just move them in the opposite direction.
Howto: Move a VM.
Re: Import VMs from Backup Folders…
Posted: 28. Mar 2022, 12:30
by smartysmart34
Thank you mpack for your reply.
Initially I only moved the VM-Folder to where it should be and to where the GUI client pointed in the settings (VM Path).
Unfortunately the GUI did not show any of these VMs when starting up. So I selected "Add" / "Hinzufügen" and navigated toe the VM files. The VMs then showed up in the GUI.
I also saw the Snapshots in the respective view (Snapshot Tree) BUT I am not able to revert to such a snapshop. It seems as if the system forgot about where the snapshot files are? That's why I still think something went wrong. Or could that just be an authorization issue on file level? I am not sure...
Kind regards,
Martin
P.S.: As mentioned earlier, it is now a directory under a different user name So i was thinking the VM files might still refer to the snapshots under the outdated user-path?
Re: Import VMs from Backup Folders…
Posted: 28. Mar 2022, 15:12
by mpack
Provided you backed up the entire VM folder (which is how I read your first post) and did not pick and choose the files you intended to keep then restoring then registering the same VM folder restores the full function of the VM.
If you did not backup or restore the entire VM folder then of course the VM may not work. The VM will definitely not work if you left out the snapshot VDI files. Experienced users avoid snapshots so backing up the related files is not an issue which can arise.
Re: Import VMs from Backup Folders…
Posted: 29. Mar 2022, 05:03
by smartysmart34
I just did the test:
I created a local user with the same name as the previous user from the old laptop. Moved the directory with the VMs over and all works fine. The VMs show up and the snapshots are available AND could also be reverted to.
So from what I can see I can confirm: Copying back the VM-Folder ONLY REALLY works, if the user name (and therefore the paths) are identical.
What is even more frustrating:
With the set of working VMs I now tried exporting Appliances. Result: The VMs can be imported under the new user, BUT: The snapshots are then gone completely and the system (in that case a Linux VM) is non-bootable because it seems to be waiting for a certain partition (UUID).
Is it really so hard to move an entire VM including Snapshots from one system/User to another System/User?
Regards,
Martin
Re: Import VMs from Backup Folders…
Posted: 29. Mar 2022, 10:40
by mpack
smartysmart34 wrote:
Is it really so hard to move an entire VM including Snapshots from one system/User to another System/User?
Nope, it really isn't. I keep saying that it really isn't. I have no idea what you have done, but if you created the VM using the standard folder structure then moving it is really easy. There is no dependance on absolute paths unless you created them that way.
There is no hidden magic here, the file paths are given in plain text in the .vbox file. It is trivially easy to check if you have all the referenced files and if they are in their expected locations.