Vboxmanage Modifyhd error

Discussions related to using VirtualBox on Mac OS X hosts.
Haggis
Posts: 8
Joined: 8. Dec 2012, 08:00

Vboxmanage Modifyhd error

Post 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
Attachments
VBox.log
Log file for the VM
(88.41 KiB) Downloaded 16 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Vboxmanage Modifyhd error

Post 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).
Haggis
Posts: 8
Joined: 8. Dec 2012, 08:00

Re: Vboxmanage Modifyhd error

Post 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)
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Vboxmanage Modifyhd error

Post 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.
Haggis
Posts: 8
Joined: 8. Dec 2012, 08:00

Re: Vboxmanage Modifyhd error

Post by Haggis »

Hi Perryg,

Thanks. No luck, same error message.

Any other suggestions?

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

Re: Vboxmanage Modifyhd error

Post by Perryg »

Post the exact command you just tried. Don't use the UUID.
Haggis
Posts: 8
Joined: 8. Dec 2012, 08:00

Re: Vboxmanage Modifyhd error

Post 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.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Vboxmanage Modifyhd error

Post 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.
Haggis
Posts: 8
Joined: 8. Dec 2012, 08:00

Re: Vboxmanage Modifyhd error

Post 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
Attachments
Win7 Test.zip
.vbox and .xml files
(3.99 KiB) Downloaded 21 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Vboxmanage Modifyhd error

Post 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.
Attachments
Win7 Test.vbox.zip
(2.78 KiB) Downloaded 25 times
Haggis
Posts: 8
Joined: 8. Dec 2012, 08:00

Re: Vboxmanage Modifyhd error

Post 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
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Vboxmanage Modifyhd error

Post 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?
rpmurray
Volunteer
Posts: 918
Joined: 3. Mar 2009, 00:29
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7, Mac OS X (various flavors)
Location: Between Heaven and Hell

Re: Vboxmanage Modifyhd error

Post 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.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Vboxmanage Modifyhd error

Post by mpack »

I see. In that case please consider my question appropriately amended: I want to know if the OPs filesystem is case sensitive.
Haggis
Posts: 8
Joined: 8. Dec 2012, 08:00

Re: Vboxmanage Modifyhd error

Post 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
Post Reply