CloneVDI tool - Discussion & Support

Discussions related to using VirtualBox on Windows hosts.
Cool Javelin
Posts: 7
Joined: 20. Sep 2012, 21:20

Re: CloneVDI tool - Discussion & Support

Post by Cool Javelin »

OMG, this worked great for me.

I needed to change the name of the VDI I was using, then went into the GUI manager of VirttualBox, and when I went to remove the old VDI image, and add the new name (actually the same image with a different name,) VB complained that the UUID already exists, and wouldn't add it.

Apparently, when I remove the VDI image from the GUI, it doesn't remove the UUID in some kind of cache and just thinks there is a problem where none exists. (This is a bug.) I read in a different post where I needed to close the GUI after removing the VDI to clear the UUID in a memory cache. That worked in one instance, but didn't work in this case.

Two options should be added to VB:
#1, allow the disk to be added by name and allow to ignore the UUID already exists issue (I can hear the responses to this one already,) or,
#2, allow the GUI to be able to change the UUID of a disk on the fly, or have a method of changing the UUID of a VDI without having first adding it.

I can't believe I need to use a third party tool to bypass the UUID problem in VirttualBox, and VirtualBox didn't supply a fix for this problem.

I was unable to use the CLI VBoxManage tool for any number of reasons, I tried several times with differing results to simply change the UUID, nothing worked on that front.

I understand the need for UUID's. They are needed when using USB devices and CD's. All CD have the same drive letter, and the only way to identify one is by it's UUID. Also they are good for removable media like when I plug in thumb drives in a different order and Windows assigns a different drive letter to it. UUID's are used to solve this problem. But in the case of disk drives, there needs to be a way to use the name of the disk and not the UUDI. You need both and need the ability to choose.

I simply ran the CloneVDI tool (didn't even have to install it, I love that,) cloned the VDI (and changed the UUID in the process) and mounted the new VDI.

Mark.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

I'm glad you found CloneVDI useful, but it should have been possible to rename a VDI without it.

The important steps are to unmount the drive, unregister the drive, then rename and remount. In detail :-
  1. In File|Virtual Media Manager highlight the drive and select "Release". This unmounts the VDI from all VMs which currently mount it.
  2. In File|Virtual Media Manager highlight the drive and select "Remove". This remove the VDI from the list of registered media.
  3. Shut down VirtualBox entirely (all VMs+the GUI). Wait 30 seconds or check that the background VBoxSVC process has unloaded (this works around the bug you mention whereby VBoxSVC remembers deleted media).
  4. Rename your VDI.
  5. Run VirtualBox and use the VM settings | Storage section to mount your renamed VDI.
bulletxt
Posts: 5
Joined: 31. May 2010, 14:22
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: CloneVDI tool - Discussion & Support

Post by bulletxt »

Hi,
this is what happened to me:
I was taking a snapshot of my Windows7 vm but for some mad situation I pressed CTRL+C while it was doing the snapshot . This literally destroyed everything in VirtualBox, it shutdown the vm, the GUI complained that it lost connection to the hard disk and snapshots ecc (to make it simple, the VM went fuc**** up). I had the wrong idea of deleting the VM from the UI and creating another one always with the same name. This is what happened: the main VDI that was attached to 7 Snapshots has lost connection to them and didn't even say it cant find them, it simply was the VDI and that's it as if the snapshot never existed.

I downloaded CLONEVDI, and as source I select the latest correct Snapshot VDI I made in the same morning. The cloning went and at the end it created a VDI and the magic was that the new VDI was actually the main VDI + latest Snapshot!!

My question is: how is this possible? How did CLONEVDI get the Snapshot I selected and went back to the main VDI (which was of course in an upper folder) and create a final correct VDI ?

Anyways CLONEVDI saved my life.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

When you lose a VM that uses a lot of snapshots the main thing you lose is all the control information that says how the snapshots fit together: and it isn't just the disk contents, the snapshot info also includes e.g. the VM settings in use when the snapshot was taken, and a VM can have multiple disks.

CloneVDI doesn't care about the VM settings, it only cares about the contents of one disk, so it's a simpler problem. If it works then it's able to piece together the chain of links from the base VDI to the selected snapshot, which it's then able to treat as a single image to clone.

Using snapshots leaves you just incredibly vulnerable to mishaps like that. In the past that mishap would have been fatal, and although these days CloneVDI can sometimes help, IMHO the safest course of action is to avoid snapshots altogether, and just live with the slight inconvenience of making full backups (of the VM folder) every now and then.
bulletxt
Posts: 5
Joined: 31. May 2010, 14:22
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: CloneVDI tool - Discussion & Support

Post by bulletxt »

Thanks for your reply. Just to understand better how snapshots work , this is (was) the scenario:

Master.vdi (in vbox/ ) -> (in vbox/Snapshots/) SnapA.vdi-> SnapB.vdi-> SnapC.vdi -> SnapD.vdi

SnapD was the latest and got corrupted (it's the one that I broke because typed CTRL+C while it was creating the snapshot). What I did with CloneVDI is I selected as source SnapC.vdi and a new destination vdi. CloneVDI did the miracle of creating a new full and complete working VDI that was based on latest SnapC . How is this possible? Did it read SnapC-> SnapB-> SnapA in automatic? Did it also read Master.vdi? And if yes how was that possible if Master.vdi was in the upper folder?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

bulletxt wrote:CloneVDI did the miracle of creating a new full and complete working VDI that was based on latest SnapC . How is this possible? Did it read SnapC-> SnapB-> SnapA in automatic?
Yes it did. It looks at all the VDI files in the source folder and tries to piece the fragments together. Typically, only the base VDI will be missing from the chain.
bulletxt wrote:Did it also read Master.vdi? And if yes how was that possible if Master.vdi was in the upper folder?
Yes it did. If the source folder is called "Snapshots" then CloneVDI automatically looks in the parent folder because it expects to find the base VDI there.

This only worked because you used the default folder structure. If you hadn't then CloneVDI would have given an error message, and you would have needed to copy all the VDIs into a single folder yourself.
bulletxt
Posts: 5
Joined: 31. May 2010, 14:22
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: CloneVDI tool - Discussion & Support

Post by bulletxt »

Thanks.... now I understand how things went and why :) I surely owe you one! While I actually had backups, I was frightened at the idea of having to reinstall everything especially because:

1) my customer would have been left without the service for at least 2-3 days
2) I would have had to call the company that provides the software the customer uses because they are the only ones that can install it (a real mess + money... a nightmare)

What I learned with this experience:
0) Do more backups than your mind can imagine
1) Avoid Snapshots
2) If you really have to do snapshots, do at least one a day
3) have a copy of CloneVDI in your pocket

Do you want to know also a funny thing? The host was Linux (ubuntu 10.04 64-bit) so I had to install wine... it seems your software just ran perfectly with it even though version was quite old wine 1.2......

Thanks again.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

bulletxt wrote:2) If you really have to do snapshots, do at least one a day
I must object to that one. Snapshots must absolutely never be confused with backups. Snapshots might be good for recovering a past state of the guest, however they are useless for recovering a past working state of the host, which is the purpose of a backup.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

[off topic chatter deleted. If it isn't about CloneVDI then please don't post here].
bulletxt
Posts: 5
Joined: 31. May 2010, 14:22
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: CloneVDI tool - Discussion & Support

Post by bulletxt »

mpack wrote:
bulletxt wrote:2) If you really have to do snapshots, do at least one a day
I must object to that one. Snapshots must absolutely never be confused with backups. Snapshots might be good for recovering a past state of the guest, however they are useless for recovering a past working state of the host, which is the purpose of a backup.
Just to know (based on your experience... hopefully I'm not going offtopic), considering I do a backup once a day at around 22:00PM, if I also do one snapshot a day at around 4:am keeping a maximum of 31 snapshot (1 month)..... isn't this a good idea? It's faster to restore the snapshot than a backup...

Or do you really suggest to totally avoid snapshots? If yes, why?

Thanks for ideas
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

Yes, I suggest that you completely avoid the use of snapshots. This thread is not an appropriate place for a discussion of why, but if you want to know then I will simply point you in the direction of Google, with search terms "snapshot problem site:forums.virtualbox.org".
STOPS
Posts: 7
Joined: 6. Jul 2013, 16:16

Re: CloneVDI tool - Discussion & Support

Post by STOPS »

As shown in the releasenotes.txt file creating a vdi file from my C: boot partition (via \\.\PhysicalDrive0) failed because CloneVDI wants to have free target space for the entire disk drive 0 capacity and not only those from the C: parttion.

Something like \\.\PhysicalDrive0\Partition0, "\\.\PhysicalDrive\Partition 0" also failed.

So how can I create a vdi file from the first partition?
STOPS
Posts: 7
Joined: 6. Jul 2013, 16:16

Re: CloneVDI tool - Discussion & Support

Post by STOPS »

Oh, I'm afraid my last question "So how can I create a vdi file from the first partition?" should be changed to "Can I create a vdi file from the first partition of my HDD at all?" and the answer would be 'no' - that's correct?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

CloneVDI clones disk images, a partition image is not a disk image. In a few simple cases (e.g. XP partition) CloneVDI can fake/anticipate the missing boot sectors etc if you only have the main partition, but generally it's better to clone the entire disk image.

When cloning a physical disk, turn on compact mode as that will minimize the size of the clone. Also of course you'll need another drive to receive the clone. Typically this would be a network or USB drive. If it's a USB drive then remember to format it with NTFS or anything else that doesn't have the 4GB file size limit (also watch out: NTFS external drives on Windows must be properly ejected before you unplug them).
rousseauhk
Posts: 45
Joined: 8. Apr 2013, 09:16
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu Server
Contact:

Re: CloneVDI tool - Discussion & Support

Post by rousseauhk »

OK I feel dumb because I've been playing around with VBox for about 6 months already and didn't even come across this tool. Shouldn't we try to get it packaged into the main release? It works great.

thx
Steve
Post Reply