CloneVDI tool - Discussion & Support

Discussions related to using VirtualBox on Windows hosts.
Post Reply
GaryPod
Posts: 6
Joined: 22. Oct 2009, 16:28
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Windows, Linux + anything else that'll run :)
Location: Nottingham, UK

Re: CloneVDI tool - Discussion & Support

Post by GaryPod »

Hi all,

Downloaded CloneVDI a short while ago and have a problem. I've saerched google + these forums but can't find an answer.

I have a virtualbox guest using a VMDK as its hard drive and it works fine. I want to copy the VMDK file and use as the drive for another guest system however when I point CloneVDI at the VMDK file used by my current guest OS CloneVDI says source doesn't exist... am I trying to use cloneVDI for something it can't do?? or, more likely, am I being stupid?! Reason for wanting to use CloneVDI is that otherwise I get the duplicate UUID error msg in virtualBox.

Cheers
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: CloneVDI tool - Discussion & Support

Post by Perryg »

Have you downloaded the latest version? VMDK was not in the earlier versions.
GaryPod
Posts: 6
Joined: 22. Oct 2009, 16:28
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Windows, Linux + anything else that'll run :)
Location: Nottingham, UK

Re: CloneVDI tool - Discussion & Support

Post by GaryPod »

Hi Perryg + thanks for the quick response :)

I have version 1.4 which I think is the most recent???
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: CloneVDI tool - Discussion & Support

Post by Perryg »

1.4 should be the one. I have cloned a VMDK myself and it worked fine. It saves it in the VDI format though.
You may need to wait for mpack to reply so you and he can see what is going on.
GaryPod
Posts: 6
Joined: 22. Oct 2009, 16:28
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Windows, Linux + anything else that'll run :)
Location: Nottingham, UK

Re: CloneVDI tool - Discussion & Support

Post by GaryPod »

Ok cheers anyway :D
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 »

GaryPod wrote:when I point CloneVDI at the VMDK file used by my current guest OS CloneVDI says source doesn't exist
Two possibilities I can think of.

(1) I recently discovered that if the source file is marked read-only then CloneVDI says "File does not exist" when you try to open it. My tool asks for read/write access to the source file even though it doesn't really intend to modify it - the idea was to ensure exclusive access but I now feel that idea was wrong headed and I intend to change that behaviour for the next release. ... However, I'm not sure why you would have write-protected a VMDK that doesn't have any snapshots depending on it.

(2) The most obvious reason: the file really does not exist! To explain just in case you don't already know: VMDK is not necessarily a single monolithic file like VDI always is and VHD usually is. Instead a VMDK usually consists of a small descriptor file - which has the VMDK extension even though it's actually a text file - and that text file in turn references one or more large binary files called extents. These extent files also have the VMDK extension and carry the actual image data. VMDK does allow the descriptor text to be embedded in the first extent (dynamic extents only), so if all you have is a single huge file then it's possible this is a valid VMDK. If all you have is a small descriptor file and nothing else then you most likely are missing one or several extent files - and this is what the error message will be referring to.
GaryPod
Posts: 6
Joined: 22. Oct 2009, 16:28
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Windows, Linux + anything else that'll run :)
Location: Nottingham, UK

Re: CloneVDI tool - Discussion & Support

Post by GaryPod »

Hi mPack,

Thanks for the reply, I've checked the file and it isn't read only... it's 6.7gb in size and has a virtualbox virtual PC running Windows from it (not when I try to clone it though :wink: )so I'm guessing the file must exist... i've attached a screen print of CloneVDI, the 'browse for source' dialoge box and a right click of the file in question showing no read only (the file is PCID01.vmdk.

Any ideas?
Attachments
CloneVDI.JPG
CloneVDI.JPG (105.42 KiB) Viewed 10879 times
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: CloneVDI tool - Discussion & Support

Post by vbox4me2 »

Rename the folder without the + sign, maybe even spaces might be a problem.
GaryPod
Posts: 6
Joined: 22. Oct 2009, 16:28
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Windows, Linux + anything else that'll run :)
Location: Nottingham, UK

Re: CloneVDI tool - Discussion & Support

Post by GaryPod »

Thanks for the idea vbox4me2 - Tried moving the VMDK file to the root of Y:\ so no spaces or symbols in the path but still the same problem :cry: btw not sure if it matters but for info Y:\ is a local drive.
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 see two VMDKs in your source folder. What is the other one?

Also, have you renamed the VMDK file? Please understand that that small descriptor file always exists, and the file which contains the descriptor is the one you need to select in CloneVDI. If you cannot see a small VMDK (i.e. if that other file isn't it) then the descriptor is most likely embedded in the extent file. Either way, that descriptor is at the root of everything and includes a list of the extent files by filename that make up the complete VMDK, in order. The listing may reference an extent by an absolute or relative path, but usually the latter.

The short version: you have an extent file there. Renaming a VDMK extent file is not recommended. If you already renamed it then rename it back. If you want to rename the clone then tell CloneVDI to do it.
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: CloneVDI tool - Discussion & Support

Post by MarkCranness »

mpack wrote:My tool asks for read/write access to the source file even though it doesn't really intend to modify it - the idea was to ensure exclusive access ...
Set the dwShareMode parameter of CreateFile() to FILE_SHARE_READ, or just leave it at zero. CreateFile() ensures exclusive access, unless the dwShareMode parameter explicitely grants other processes more rights.
GaryPod
Posts: 6
Joined: 22. Oct 2009, 16:28
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Windows, Linux + anything else that'll run :)
Location: Nottingham, UK

Re: CloneVDI tool - Discussion & Support

Post by GaryPod »

Turns out the VMDK file had been renamed (unknown to me last night). Renamed and it now works fine. Thanks for the all of the replies and apologies for the mistake.

Btw, awesome tool :D
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 »

MarkCranness wrote:Set the dwShareMode parameter of CreateFile() to FILE_SHARE_READ, or just leave it at zero.
I'm aware of that, but thank you. My problem was that I don't call CreateFile() directly, instead I had a simplified wrapper that doesn't expose dwShareMode.
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 »

GaryPod wrote:Renamed and it now works fine.
Glad you got it working. :-)
michaeld_bqe
Posts: 11
Joined: 21. Oct 2009, 23:14
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP, BackTRack 4, Win 7

Re: CloneVDI tool - Discussion & Support

Post by michaeld_bqe »

I Must say, Great Job my friend. There is one thing I was really hoping to have from this tool and that is CMD ability. Something along the lines of:

clonevdi.exe /orig "C:\Blah.vdi" /dest "C:\blahCopy.vdi" /uuid Y (keep uuid)

Although this would require some documentation and depending on the language you are writing this in I would be more than happy to help you receive these command line arguments and call the methods that you are calling to perform these functions.

But other than that as stand alone app you have received 5 * from me. The new 1.3 Release with VMDK file will be tested tonight. I have been looking for a decent solution although there were ways to do it via linix command lines etc. I didn't really feel like going through all that hassle and conversion process. I mean windows gives us the ability to write all the way down at 8k why not take advantage of it? :p But again amazing job. Please if you can let me know (personal message or reply) if you plan on adding command line arguments.

-Mike D
Post Reply