Error converting vdi to .vhd VBOX_E_FILE_ERROR VERR_INVALID_PARAMETER

Discussions related to using VirtualBox on Windows hosts.
Post Reply
haughki
Posts: 5
Joined: 26. Sep 2017, 04:08

Error converting vdi to .vhd VBOX_E_FILE_ERROR VERR_INVALID_PARAMETER

Post by haughki »

VirtualBox Version 6.1.12 r139181 (Qt5.6.2)
Win 10 Pro Version 10.0.19041 Build 19041

I've tried this using VBoxManage and also from the GUI -- same errors each time. Seems to 'get through' the conversion, only to fail at the end.

PS C:\Program Files\Oracle\VirtualBox> .\VBoxManage.exe clonehd --format vhd "D:\Vms\ubuntu-desktop-amd64_2020_Export Clone\Snapshots\{32de8672-d25e-4d42-9b90-03f089034112}.vdi" "C:\temp\ubunt-desktop-amd64-disk001.vhd"
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Failed to clone medium
VBoxManage.exe: error: Could not create the clone medium 'C:\temp\ubunt-desktop-amd64-disk001.vhd' (VERR_INVALID_PARAMETER)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCloneMedium(struct HandlerArg *)" at line 1071 of file VBoxManageDisk.cpp

From GUI
https://imgur.com/a/fLYv7nv
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Error converting vdi to .vhd VBOX_E_FILE_ERROR VERR_INVALID_PARAMETER

Post by scottgus1 »

Try putting "--format vhd" after the source and destination file names.

Try "--format VHD" vboxmanage commands might be case-sensitive.

Try not having the destination path in "temp".

Websearch:

Could not create the clone medium (VERR_INVALID_PARAMETER)

for other ideas.
haughki
Posts: 5
Joined: 26. Sep 2017, 04:08

Re: Error converting vdi to .vhd VBOX_E_FILE_ERROR VERR_INVALID_PARAMETER

Post by haughki »

Thanks. Tried your specific suggests with no luck (this through 'clonemedium' -- apparently just a wrapper for clonehd: https://www.virtualbox.org/manual/ch08. ... lonemedium):

Code: Select all

.\VBoxManage.exe clonemedium "D:\Vms\ubuntu-desktop-amd64_2020_Export Clone\Snapshots\{32de8672-d25e-4d42-9b90-03f089034112}.vdi" "D:\Vms\ubuntuhyperv.vhd" --format VHD
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Failed to clone medium
VBoxManage.exe: error: Could not create the clone medium 'D:\Vms\ubuntuhyperv.vhd' (VERR_INVALID_PARAMETER)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCloneMedium(struct HandlerArg *)" at line 1071 of file VBoxManageDisk.cpp
Note that I also tried via the GUI, with the same results: https://imgur.com/a/fLYv7nv

Digging some more, I think I may have some disk errors in the VM disk -- it boots just fine, but fsck -nf says:

Code: Select all

sudo fsck -nf /dev/sda1
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
Warning!  /dev/sda1 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found.  Fix? no

Inode 3016423 was part of the orphaned inode list.  IGNORED.
Inode 3019021 was part of the orphaned inode list.  IGNORED.
Inode 3019075 was part of the orphaned inode list.  IGNORED.
Inode 3019712 was part of the orphaned inode list.  IGNORED.
Inode 3020438 was part of the orphaned inode list.  IGNORED.
Deleted inode 3278158 has zero dtime.  Fix? no

Inode 7602422 was part of the orphaned inode list.  IGNORED.
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -497984 -522752 -(13020677--13020689) -(15286795--15286818) -(17948721--17948728)
Fix? no

Free blocks count wrong (27582309, counted=27582234).
Fix? no

Inode bitmap differences:  -3016423 -3019021 -3019075 -3019712 -3020438 -3278158 -7602422
Fix? no

Free inodes count wrong (8678412, counted=8678366).
Fix? no


/dev/sda1: ********** WARNING: Filesystem still has errors **********

/dev/sda1: 553972/9232384 files (0.3% non-contiguous), 9340571/36922880 blocks
I tried to fsck from recovery mode, but apparently that doesn't work in Ubuntu > 18.04 (https://askubuntu.com/questions/1090066 ... ounted-r-w).

Note: I don't quite understand what the difference is between the .vdi file (a Windows file) and the Ubuntu hd (/dev/sda1). I followed these instructions (https://ohnorandom.com/197-repair-corru ... checkdisk/) to try to "Repair corrupted VirtualBox VDI file using Checkdisk": this process reported no errors, but fsck -nf still does.

To run fsck on /dev/sda1, it looks, apparently, like I would need to try to boot the _VM_ from USB (or something...)? Seems bizarre, but apparently doable: https://www.howtogeek.com/187721/how-to ... irtualbox/

But, this sounds iffy and time consuming, so I'm hoping someone here has a better idea.

I also tried exporting the VBox VM to OVA (OVF v1), importing to VMware, and converting the VMware VMDK to VHD with the Microsoft Virtual Machine Converter (via CLI). This also failed with an obscure error (The entry "" is not a supported disk database entry for the descriptor.).

Just to be clear: the VirtualBox Ubuntu VM is otherwise fine and functional -- I use it all the time without any problems.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Error converting vdi to .vhd VBOX_E_FILE_ERROR VERR_INVALID_PARAMETER

Post by scottgus1 »

Try running the file through Mpack's CloneVDI. It will make a cloned VDI file. If CloneVDI can clone the original, then you can try making a VHD out of the clone. If CloneVDI fails, the original file is toast. The only option I would see you having then is to try an in-the-guest disk image to another attached VHD file.
haughki
Posts: 5
Joined: 26. Sep 2017, 04:08

Re: Error converting vdi to .vhd VBOX_E_FILE_ERROR VERR_INVALID_PARAMETER

Post by haughki »

Using Mpack's CloneVDI worked like a charm. Many thanks for your help, scottgus1!
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Error converting vdi to .vhd VBOX_E_FILE_ERROR VERR_INVALID_PARAMETER

Post by scottgus1 »

Great! Glad you're up and running.
Post Reply