Page 1 of 1

Copy VM

Posted: 30. Oct 2010, 13:43
by Thomasio
I believe I made a mistake.
I´ve reinstalled my host machine (Win7 Ultimate 64 bit) and´before that I´ve made a backup of my VM´s.
I didn´t see the export option within VB, so I simply copied the entire content of the VM´s and HDD´s folder.
Now I´ve reinstalled VB, but there is no option like "File - Open", only "Import", but that one doesn´t recognize the copy of my VM´s.
Now I believe, I will have to recreate the VM´s (hopefully I remember all the settings) and then I should be able to connect the corresponding HDD.vdi, but before I go through all that, let me ask:

Is there a way to get my backups back into VB without recreating all VM´s?

Re: Copy VM

Posted: 30. Oct 2010, 13:52
by mpack
If you are saying that you backed up the entire contents of your old .VirtualBox folder then you should be able to just restore that folder and everything should be fine - it is important that your backup included the VirtualBox.xml file as this contains the list of working VMs and media.

Otherwise you can create new VMs, choosing "Use existing..." when it comes to the hard disk creation step. This is easy provided you didn't use snapshots in the old VM. Make sure to make the settings of the new VM as close as possible to the old VM, particularly as regards exact disk controller type, IO APIC setting and MAC address. Old the old VM xml file loaded into a text editor for reference.

Re: Copy VM

Posted: 31. Oct 2010, 00:55
by Thomasio
I should be able to create new VM´s with same settings, at least for most of them, use existing HDD is easy as well, it´s just a lot of work, so I would really apreciate if I could somehow "restore" the VM´s folder.
I copied the entire content of that folder back into its place, it´s in the precise same place as it was before, but I can´t see, where or how I could "restore" it, so VB recognizes the VM´s?

Re: Copy VM

Posted: 31. Oct 2010, 07:42
by FrodoHobbits
Use Virtual Media Manager to add your VM images and then create new Virtual Machines and select "Use existing hard disk" and select your VM from the drop down.
I think this is what you are asking for help on.
Read the manual.

Re: Copy VM

Posted: 31. Oct 2010, 11:48
by mpack
Thomasio wrote:I copied the entire content of that folder back into its place, it´s in the precise same place as it was before, but I can´t see, where or how I could "restore" it, so VB recognizes the VM´s?
You should be asking yourself how VirtualBox's memory works. How does it know which VMs have been registered? Where is this information stored? The answer is that this information is stored in that folder you mention - which means that if you don't see your VMs when you run the GUI then, despite what you have said, you cannot have restored that folder exactly. In my last message I specifically drew your attention to the importance of restoring the VirtualBox.xml file.

And for completeness: VirtualBox has no "import" feature for VMs, other than the OVF import/export thing that you already know about.

Oh - and just in case there's a misunderstanding: restoring a VMs folder does nothing. You have to restore the entire .VirtualBox folder tree, because it's the VirtualBox.xml file at the top of the tree which references the VM and its folder. VMs cannot easily be restored in "piecemeal" fashion.

Re: Copy VM

Posted: 31. Oct 2010, 18:53
by Thomasio
Thanks for the answers, I believe I got it straight now.

My big mistake was to change the VM´s folder.
I didn´t know that VB still stores the VirtualBox.xml in a subfolder of c:\Users, while it saves all the VM.xml in the new folder.
Next time I will know.