VBoxManage clonehd fails

Discussions related to using VirtualBox on Windows hosts.
Post Reply
JustSomeUser
Posts: 10
Joined: 8. Feb 2009, 21:07

VBoxManage clonehd fails

Post by JustSomeUser »

Code: Select all

C:\Program Files\Sun\xVM VirtualBox>VBoxManage clonehd K:\tmp\000.vhd K:\tmp\001
.vhd
VirtualBox Command Line Management Interface Version 2.2.0
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...FAILED
Error: failed to clone hard disk. Error message: Could not create the clone hard
 disk 'K:\tmp\001.vhd' (VERR_INVALID_PARAMETER)

Code: Select all

C:\Program Files\Sun\xVM VirtualBox>VBoxManage clonehd K:\tmp\000.vhd K:\tmp\001
.vdi --format vdi
VirtualBox Command Line Management Interface Version 2.2.0
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...FAILED
Error: failed to clone hard disk. Error message: Could not create the clone hard
 disk 'K:\tmp\001.vdi' (VERR_INVALID_PARAMETER)
Why can't I clone a VHD file with VBoxManage?
I'm running XP64 SP2.
Truly, if there is evil in this world, it lies within the heart of mankind.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: VBoxManage clonehd fails

Post by Sasquatch »

INVALID_PARAMETER means that you forgot a parameter. As it's clonehd and no longer clonevdi, you have to state which format the destination will be. It's in the manual, Chapter 8, VBoxManage reference, and as the help output if you just run VBoxManage. Either end it with, or put between the file names, --format VDI.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
JustSomeUser
Posts: 10
Joined: 8. Feb 2009, 21:07

Re: VBoxManage clonehd fails

Post by JustSomeUser »

Code: Select all

C:\Program Files\Sun\xVM VirtualBox>VBoxManage.exe clonehd --format VDI K:\tmp\0
00.vhd K:\tmp\000.vdi
VirtualBox Command Line Management Interface Version 2.2.0
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...FAILED
Error: failed to clone hard disk. Error message: Could not create the clone hard
 disk 'K:\tmp\000.vdi' (VERR_INVALID_PARAMETER)
It does not matter where I put --format VDI it just won't work and I also had a look at 8.16 of the manual.
Truly, if there is evil in this world, it lies within the heart of mankind.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: VBoxManage clonehd fails

Post by vbox4me2 »

Can you actually write to K: ? Try -format (1 dash).
JustSomeUser
Posts: 10
Joined: 8. Feb 2009, 21:07

Re: VBoxManage clonehd fails

Post by JustSomeUser »

Code: Select all

C:\Program Files\Sun\xVM VirtualBox>VBoxManage.exe clonehd --format vdi K:\tmp\R
eactOS-0.3.8-VMware\ReactOS.vmdk K:\tmp\ReactOS-0.3.8-VMware\ReactOS.vdi
VirtualBox Command Line Management Interface Version 2.2.0
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'vdi'. UUID: 406119f0-4cf0-4a9d-9c1d-b4274a743
926
I have tried to clone a vmware ReactOS HDD with no problems but the VHD files just won't convert
adding them to VBox and booting is no problem.
Truly, if there is evil in this world, it lies within the heart of mankind.
JustSomeUser
Posts: 10
Joined: 8. Feb 2009, 21:07

Re: VBoxManage clonehd fails

Post by JustSomeUser »

I have now cloned the VHDs with a linux live cd and dd but I still don't know why it was not possible to clone them with VBoxManage although VBox could boot them.
This can be easily reproduced just create a new dynamic VHD with VirtualPc 2007 (or try this one new_vhd.zip (<1kb)) and try to clone it with VBoxManage then you will get the same error as I got. I have tested it on XP64 and ubuntu 8.10 x64.
Truly, if there is evil in this world, it lies within the heart of mankind.
gcstang
Posts: 28
Joined: 17. Jan 2008, 15:11

Re: VBoxManage clonehd fails

Post by gcstang »

Looks like with 3.1 this is failing again?

Commandline:
VBoxManage.exe clonehd -format vdi D:\VirtualMachines\Fedora12_x64\Fedora12x64.vmdk D:\VirtualMachines\Fedora12_x64\Fedora12x64New.vdi
I get this error:

Syntax error: Mandatory output file parameter missing
'D:\VirtualMachines\Fedora12_x64\Fedora12x64New.vdi' is not recognized as an internal or external command, operable program or batch file.

Windows 7 Pro 64bit
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: VBoxManage clonehd fails

Post by MarkCranness »

Paste your command into notepad and make sure there is no newline between the vmdk and the vdi parameters.
Because of how you are creating the command, it has been split into two separate commands:
Command 1:
VBoxManage.exe clonehd -format vdi D:\VirtualMachines\Fedora12_x64\Fedora12x64.vmdk

Command 2:
D:\VirtualMachines\Fedora12_x64\Fedora12x64New.vdi

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

Re: VBoxManage clonehd fails

Post by mpack »

Also, there should be two minus signs in front of the format argument, i.e. "--format". Oh, and put the word "VDI" in upper case. I've not checked that the latter is required, but it's best to do exactly what the user manual tells you.
gcstang
Posts: 28
Joined: 17. Jan 2008, 15:11

Re: VBoxManage clonehd fails

Post by gcstang »

Not sure how you got it in two sep lines, I am editing it in Notepad and it's all on one line.

(I've been using Notepad the whole time to modify this bat file I created and I've also tried pasting the command to the command line to run it directly)

I've also tried with --format vs. -format
and vdi vs. VDI
I get the same error no matter what I've tried.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VBoxManage clonehd fails

Post by mpack »

Incidentally, the message "xxx is not recognized as an internal or external command, operable program or batch file" is an error message from the command prompt, not VirtualBox, and could only happen if you typed the unrecognized command "xxx" at the command prompt. In your case "xxx" was the destination filename, hence Mark's (IMHO completely correct) assumption that you must have typed this on a separate line. Notice you actually got two errors, one from VBox complaining that the output filename was missing, the second from the command prompt complaining that <output filename> is not a recognized command.

Your original error message (invalid parameter) comes from VBoxManage, and is due to the missing "--format VDI" argument.

If you still can't get this right then please show us your command again.
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: VBoxManage clonehd fails

Post by MarkCranness »

VirtualBox may need the parameters in same order as the manual says, so try:
VBoxManage.exe clonehd D:\VirtualMachines\Fedora12_x64\Fedora12x64.vmdk D:\VirtualMachines\Fedora12_x64\Fedora12x64New.vdi --format VDI
gcstang wrote:I am editing it in Notepad and it's all on one line.
I should have remembered: Sometimes I've had notepad insert newlines at the Word Wrap point, and turn one line into two. I tried just now and couldn't reproduce it, but it has happened to me.
wwilliam
Posts: 1
Joined: 13. Jun 2010, 07:45
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP

Re: VBoxManage clonehd fails

Post by wwilliam »

Your source virtual disk is damaged. This happened with me and I solve choosing another source disk to clone. Dont use clodevdi, you may use clonehd in vboxmanage
I'm posting this only for future references.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VBoxManage clonehd fails

Post by mpack »

wwilliam wrote:Your source virtual disk is damaged
No, that was not his problem. That produces a very different error message.
Post Reply