Page 1 of 2

Vboxmanage Modifyhd error

Posted: 8. Dec 2012, 08:34
by Haggis
Trying to increase the size of my VHD - dynamic and only has the "Current State" snapshot. I execute the following command:

vboxmanage modifyhd Siggah.vhd --resize 307200

The following error is generated...

VBoxManage: error: Cannot register the hard disk '/Users/Colin/VirtualBox VMs/SIGGAH.vhd' {763b5d50-c9e9-43aa-bfdb-6f13d59dec3a} because a hard disk '/Users/Colin/VirtualBox VMs/SIGGAH.VHD' with UUID {763b5d50-c9e9-43aa-bfdb-6f13d59dec3a} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 220 of file VBoxManageDisk.cpp

If I try the UID (as suggested elsewhere on the forum).

$ vboxmanage modifyhd 763b5d50-c9e9-43aa-bfdb-6f13d59dec3a --resize 307200
VBoxManage: error: The given path '763b5d50-c9e9-43aa-bfdb-6f13d59dec3a' is not fully qualified
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Medium, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 220 of file VBoxManageDisk.cpp

Host is OS X 10.8.2
Guest is Win7 - latest patches
VirtualBox is 4.2.4

VBOX log file for this VM is attached.

I am sure it is something stupid that I am or am not doing. However, another set of eyes always helps :D

Regards
Colin

Re: Vboxmanage Modifyhd error

Posted: 8. Dec 2012, 09:25
by mpack
How did you create this VM? I ask because I notice that the VHD is located outside of your "Win7 test" VM folder. The "already registered" error could be because you have a clone of this disk registered as part of a VM.

You mention snapshots: your choice of wording makes it unclear whether you've in fact used them. To be clear: you cannot resize a VM which uses snapshots, it doesn't matter how few snapshots you've taken. If you've clicked the snapshot button once, that's it. You need to get rid of them entirely (e.g. by cloning the VM and telling it to make a full clone of the current state).

Re: Vboxmanage Modifyhd error

Posted: 9. Dec 2012, 01:48
by Haggis
Hi mpack,

Thanks for the response.

VM was created using Disk2VHD (Sysinternals Tool). Then created a VM and chose option to use exisitng virtual hard drive file.

For the snapshots, I have not specifically created one, and when I look under the snapshot option, there are no snapshots - apart from a line (i believe to be a default) current state.

I did make a clone of the machine while troubleshooting another issue. I have since removed the cloned VM, but error still happens. I ran this command
vboxmanage list --long hdds

So I am a wondering might else might be causing this issue.

UUID: 763b5d50-c9e9-43aa-bfdb-6f13d59dec3a
Parent UUID: base
Format: VHD
Location: /Users/Colin/VirtualBox VMs/SIGGAH.VHD
State: created
Type: normal
Usage: Win7 Test (UUID: 895dba00-d557-479e-a0d1-5b406e754bd4)

UUID: 2313af1f-9720-48b4-91fb-e9eff9b6cad5
Parent UUID: base
Format: VDI
Location: /Users/Colin/VirtualBox VMs/Win7 Test/SiggahVirtualDisk1.vdi
State: created
Type: normal
Usage: Win7 Test (UUID: 895dba00-d557-479e-a0d1-5b406e754bd4)

Re: Vboxmanage Modifyhd error

Posted: 9. Dec 2012, 02:07
by Perryg
I would use the absolute path or be sure you are in the folder that has the actual *.VDI/VHD, and make sure that everything VirtualBox is off.
Oh and the guest must not be in a saved state.

Re: Vboxmanage Modifyhd error

Posted: 9. Dec 2012, 02:20
by Haggis
Hi Perryg,

Thanks. No luck, same error message.

Any other suggestions?

Regards
Colin

Re: Vboxmanage Modifyhd error

Posted: 9. Dec 2012, 02:27
by Perryg
Post the exact command you just tried. Don't use the UUID.

Re: Vboxmanage Modifyhd error

Posted: 9. Dec 2012, 03:32
by Haggis
I used: vboxmanage modifyhd "/Users/Colin/VirtualBox VMs/Siggah.vhd" --resize 30720

In the directory where siggha.vhd is located.

I also executed the same command in the Win7 Test directory that was created during the VM creation step.

Re: Vboxmanage Modifyhd error

Posted: 9. Dec 2012, 05:11
by Perryg
Post the guests *.vbox file (located in the same folder as the *.vdi/vhd) and the VirtualBox.xml file (as an attachment)
You may need to show hidden files to see the folder that the VirtualBox.xml file is located is (normally in the user space). Also compress them to be able to post them as attachments.

Re: Vboxmanage Modifyhd error

Posted: 9. Dec 2012, 05:37
by Haggis
See attached zip.

The only difference, as noted by mpack in an earlier post, is that the vhd file is located in the directory above where the .vbox file is located...

Thanks for looking into this.

Colin

Re: Vboxmanage Modifyhd error

Posted: 9. Dec 2012, 12:15
by mpack
It's possible that VirtualBox is being confused by the fact that the VHD file is stored inside the VM folder area, but not in the correct VM folder.

For that reason I've attached a modified version of your "Win7 Test.vbox" file. Use this to overwrite your existing .vbox file (VBox itself must be shut down at the time of course). Then, important, move that .VHD into the VM folder, before you run VBox and attempt to run the VM. Once everything is tested and working you can try the resize command again.

Personally, I would convert that VHD to VDI format before I did anything else to it.

Re: Vboxmanage Modifyhd error

Posted: 10. Dec 2012, 11:45
by Haggis
Hi mpack,

Downloaded the modified VBOX file, moved SIGGAH.VHD into the Win7 Test directory. Launched it successfully. No errors/issues.

Shut Virtualbox down completely (no GUI) and then ran the same command: vboxmanage modifyhd "/Users/Colin/VirtualBox VMs/Win7 Test/Siggah.vhd" --resize 30720

Same error:
VBoxManage: error: Cannot register the hard disk '/Users/Colin/VirtualBox VMs/Win7 Test/Siggah.vhd' {763b5d50-c9e9-43aa-bfdb-6f13d59dec3a} because a hard disk '/Users/Colin/VirtualBox VMs/Win7 Test/SIGGAH.VHD' with UUID {763b5d50-c9e9-43aa-bfdb-6f13d59dec3a} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 220 of file VBoxManageDisk.cpp

So converted to VDI! :D and it comes up with no issues.

So I have tried the --resize and get the following. I remember seeing similar threads on the forum before, but don't have the time at the moment to search for it and try those solutions.

Command:
vboxmanage modifyhd siggah.vdi --resize 30720

0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!

Thanks for your help and input so far. Though I would be curious to know what is causing the error with the vhd format...

Regards
Colin

Re: Vboxmanage Modifyhd error

Posted: 10. Dec 2012, 12:12
by mpack
Please show the results of "VBoxManage showhdinfo siggah.vdi". Be in the correct folder when you type this.

For historical curiousity, I notice that in your VHD struggles you typed "Siggah.vhd" on the command line, but the error message refers to "SIGGAH.VHD". Are Mac OS X filenames case sensitive?

Re: Vboxmanage Modifyhd error

Posted: 10. Dec 2012, 15:55
by rpmurray
mpack wrote:For historical curiousity, I notice that in your VHD struggles you typed "Siggah.vhd" on the command line, but the error message refers to "SIGGAH.VHD". Are Mac OS X filenames case sensitive?
Only if you choose them to be so when you format the drive.

Re: Vboxmanage Modifyhd error

Posted: 10. Dec 2012, 16:43
by mpack
I see. In that case please consider my question appropriately amended: I want to know if the OPs filesystem is case sensitive.

Re: Vboxmanage Modifyhd error

Posted: 10. Dec 2012, 21:39
by Haggis
Yes, OSX is case sensitive. Though i hadn't posted that (sorry!) as I got the same result with using the correct case.

output from: UUID: VBoxManage showhdinfo siggah.vdi

1fb78df2-8869-4c82-bfa6-17766c061e98
Accessible: yes
Logical size: 476941 MBytes
Current size on disk: 16257 MBytes
Type: normal (base)
Storage format: VDI
Format variant: dynamic default
In use by VMs: Win7 Test (UUID: 895dba00-d557-479e-a0d1-5b406e754bd4)
Location: /Users/Colin/VirtualBox VMs/Win7 Test/siggah.vdi