VBoxManage createmedium disk creates corrupted disks

Discussions related to using VirtualBox on Windows hosts.

VBoxManage createmedium disk creates corrupted disks

Postby schrotti12 » 13. Jul 2016, 10:21

Hi.
I have just installed version 5.1 of VirtualBox on a Windows 10 Pro x64 Host, updated to the latest version. Extensions are installed.
I use the following script to create a VHD Images for my hosts.
Code: Select all   Expand viewCollapse view
@echo off
set PATH=%PATH%;C:\Program Files\Oracle\VirtualBox
mkdir "%USERPROFILE%\MyVdisks"
VBoxManage createmedium disk --filename "%USERPROFILE%\MyVdisks\disk1.vhd" --size 8192 --format vhd --variant fixed

This creates the VHD file but as soon as I want to mount the disk into explorer using the following script it fails.
Code: Select all   Expand viewCollapse view
C:\Windows\system32>diskpart
Microsoft DiskPart version 10.0.10586
Copyright (C) 1999-2013 Microsoft Corporation.
On computer: S10
DISKPART> select vdisk file="C:\<actual path to vdisk>\disk1.vhd"
DiskPart has encountered an error: The file or directory is corrupted and unreadable.
See the System Event Log for more information.
There is no virtual disk selected.
DISKPART>

And, if i want to add the vdisk in VirtualBox Manager to a virtual machine the message is as follows:
Code: Select all   Expand viewCollapse view
Could not get the storage format of the medium 'C:\Users\ago\MyVdisks\disk1.vhd' (VERR_NOT_SUPPORTED).
Result Code:
VBOX_E_IPRT_ERROR (0x80BB0005)
Component:
MediumWrap
Interface:
IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}
Callee:
IVirtualBox {0169423f-46b4-cde9-91af-1e9d5b6cd945}
Callee RC:
VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

If I add the disk on commandline via
Code: Select all   Expand viewCollapse view
VBoxManage storageattach "Windows 10" --storagectl "SATA" --port 0 --device 0 --type hdd --medium "%USERPROFILE%\MyVdisks\disk1.vhd"

it shows up in the storage manager but as dynamicaly rezisable disk and with errors...
What can I do?
schrotti12
 
Posts: 6
Joined: 13. Jul 2016, 10:12

Re: VBoxManage createmedium disk creates corrupted disks

Postby socratis » 13. Jul 2016, 11:05

I can verify the erroneous behavior on my OSX 10.9.5 host. It seems like a bug with the fixed variant VHD. With the "fixed" variant, I get:
SGK-MBP2300:~ socratis$ VBoxManage createmedium --filename lala.vhd --size 8 --format vhd --variant fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: a1769818-5f42-4843-9eef-7efe6e2432dd
SGK-MBP2300:~ socratis$ VBoxManage showmediuminfo lala.vhd
VBoxManage: error: Could not get the storage format of the medium '/Users/socratis/lala.vhd' (VERR_NOT_SUPPORTED)
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component MediumWrap, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp

But with the "standard" variant I get:
SGK-MBP2300:~ socratis$ VBoxManage createmedium --filename lala.vhd --size 8 --format vhd --variant standard
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 67db3a33-d63d-4efc-8799-927b06226772
SGK-MBP2300:~ socratis$ VBoxManage showmediuminfo lala.vhd
UUID: 67db3a33-d63d-4efc-8799-927b06226772
Parent UUID: base
State: created
Type: normal (base)
Location: /Users/socratis/lala.vhd
Storage format: vhd
Format variant: dynamic default
Capacity: 8 MBytes
Size on disk: 0 MBytes
Encryption: disabled


This does not happen with other formats, like VDI and VMDK, fixed or standard. It also does not happen with 5.0.24. You should head to the Bugtracker and either search for an appropriate bug (where you'll attach your logs and other vital information), or open a new bug report.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
socratis
Site Moderator
 
Posts: 27690
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: VBoxManage createmedium disk creates corrupted disks

Postby schrotti12 » 13. Jul 2016, 11:28

Thanks for verifying! Ticket submitted under "virtual disks". Sorry, I'm new here and can't post URLS by now :-)
I have scripts for process automation and I ran them on the new version. This way I found out pretty quick about the bug. Thanks for support and I hope the issue is resolved soon. In the meantime I'll use diskpart to create VHD files.
schrotti12
 
Posts: 6
Joined: 13. Jul 2016, 10:12

Re: VBoxManage createmedium disk creates corrupted disks

Postby socratis » 13. Jul 2016, 11:40

For reference: https://www.virtualbox.org/ticket/15601
I added my .02€ as well.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
socratis
Site Moderator
 
Posts: 27690
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: No registered users and 9 guests