Page 1 of 2

Increasing XP.vdi

Posted: 16. Jul 2013, 08:03
by lindac
I am trying to increase the size of my VDI. I've read all the posts on this an keep getting a syntax error.

I've used various versions of the following:

VBoxManage modifyhd "/Users/[name]/VirtualBox VMs/XP/XP.vdi" --resize 40960

and get Syntax error: Invalid parameter 'VMs/XP/XP.vdi"'

Terminal doesn't seem to like the space between VirtualBox and VMs. I've also tried:

VBoxManage modifyhd /Users/[name]/VirtualBox VMs/XP/XP.vdi --resize 40960
VBoxManage modifyhd /Users/[name]/VirtualBox\ VMs/XP/XP.vdi --resize 40960
VBoxManage modifyhd "/Users/[name]/VirtualBox\ VMs/XP/XP.vdi" --resize 40960
VBoxManage modifyhd "Users/[name]/VirtualBox\ VMs/XP/XP.vdi" --resize 40960
VBoxManage modifyhd "Users/[name]/VirtualBox VMs/XP/XP.vdi" --resize 40960
VBoxManage modifyhd /Users/[name]/VirtualBox\ VMs/XP/XP.vdi --resize 40960

and get the same syntax error message.

I've also tried using the UUID as follows:

VBoxManage modifyhd 02c93f83-2dfa-45cb-a01f-e6cdaf0e7443|XP.vdi --resize 40960

and got the following error message:
VBoxManage: error: Could not find file for the medium '/Users/lindacollett/02c93f83-2dfa-45cb-a01f-e6cdaf0e7443|XP.vdi' (VERR_FILE_NOT_FOUND)
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 178 of file VBoxManageDisk.cpp

Here is my hd info:

UUID: 3ea5a80c-0955-4028-bfde-b0e786684944
Parent UUID: base
Format: VDI
Location: /Users/[name]/VirtualBox VMs/XP/XP.vdi
State: locked read
Type: normal
Usage: XP (UUID: 5f2d3271-9429-425c-8ef5-f1874de0eaea) [Snapshot 1 (UUID: d95e4d49-b450-4237-abd2-6a1110108f91)]

UUID: 02c93f83-2dfa-45cb-a01f-e6cdaf0e7443
Parent UUID: 3ea5a80c-0955-4028-bfde-b0e786684944
Format: VDI
Location: /Users/[name]/VirtualBox VMs/XP/Snapshots/{02c93f83-2dfa-45cb-a01f-e6cdaf0e7443}.vdi
State: locked write
Type: normal
Usage: XP (UUID: 5f2d3271-9429-425c-8ef5-f1874de0eaea)

I've also tried:
VBoxManage modifyhd 02c93f83-2dfa-45cb-a01f-e6cdaf0e7443 --resize 40960

Error message received:
VBoxManage: error: Failed to lock media when compacting '/Users/[name]/VirtualBox VMs/XP/Snapshots/{02c93f83-2dfa-45cb-a01f-e6cdaf0e7443}.vdi'
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Medium, interface IMedium, callee nsISupports
VBoxManage: error: Context: "Resize(cbResize, progress.asOutParam())" at line 539 of file VBoxManageDisk.cpp

I get the same error message when I try VBoxManage modifyhd 3ea5a80c-0955-4028-bfde-b0e786684944 --resize 40960 too.

I am a novice with this and any help would be greatly appreciated.

Re: Increasing XP.vdi

Posted: 16. Jul 2013, 08:24
by loukingjr
Drag the .vdi file to a terminal window, type VBoxManage modifyhd at the front of the path and --resize (new size) at the end of the path and hit return.

Re: Increasing XP.vdi

Posted: 16. Jul 2013, 12:13
by noteirak
what's with the [name] everywhere? Is that actually your real path or did you replace the real value everywhere?

Re: Increasing XP.vdi

Posted: 19. Jul 2013, 00:55
by lindac
Thanks for your relpy loukingjr. Unfortunately I had already tried that and still get the syntax error.

Yes, noteirak I replaced the real value everywhere for security reasons. :-)

I'm still needing some help with this issue if anyone has any more ideas.

Thanks!

Re: Increasing XP.vdi

Posted: 19. Jul 2013, 01:48
by loukingjr
it looks like you have a snapshot. that could be the problem. you could merge the snapshot in the VB GUI and then resize. or you could create a full clone and resize that. then replace the .vdi. I think that may work.

Re: Increasing XP.vdi

Posted: 19. Jul 2013, 13:27
by mpack
Try it again, and this time use the UUID of the disk, not the UUID of the VM. Also the "|XP.vdi" suffix should not be there, just the UUID (the "|" in the user manual syntax description means OR, i.e. the disk can be identified using its uuid OR filename).

Typing the full path will work if you get the path and filename correct, but some people have trouble anyway. Most such problems can be eliminated by wrapping the filename in quotes "like so", as this prevents any spaces or other special characters being treated as separators or switches.

Re: Increasing XP.vdi

Posted: 19. Jul 2013, 15:41
by loukingjr
mpack wrote:Try it again, and this time use the UUID of the disk, not the UUID of the VM. Also the "|XP.vdi" suffix should not be there, just the UUID (the "|" in the user manual syntax description means OR, i.e. the disk can be identified using its uuid OR filename).

Typing the full path will work if you get the path and filename correct, but some people have trouble anyway. Most such problems can be eliminated by wrapping the filename in quotes "like so", as this prevents any spaces or other special characters being treated as separators or switches.
just so I don't give anyone the wrong info, do snapshots not matter when resizing a VM? At least one time she tried using the UUID of her snaphot.
Location: /Users/[name]/VirtualBox VMs/XP/Snapshots/{02c93f83-2dfa-45cb-a01f-e6cdaf0e7443}.vdi

I've also tried:
VBoxManage modifyhd 02c93f83-2dfa-45cb-a01f-e6cdaf0e7443 --resize 40960
the reason I'm asking is three different users and myself have used the method of "dragging the .vdi file to the terminal..." on our Macs and it worked for them and myself. but we had no snapshots.

Re: Increasing XP.vdi

Posted: 19. Jul 2013, 16:25
by Perryg
Resizing the guests HDD does *not* work if you have snapshots. They must be merged first to create a single flat file.

Dragging the file into terminal with a Mac or Linux host is a fast way to get the absolute path into the terminal. You may need to be sure that the path does not contain spaces but usually the OS tries to fix this by placing a different separator that allows it to work into the path, like the "\" but you just need to be sure and if spaces exist you simply need to wrap in it quotes.

Cloning the original guest that has snapshots using the current state will also merge the snapshot/s for you if you want to be sure you don't loose the original by a merge that fails, which I have actually seen. Thus I stay away from snapshots and clone instead.

Edit: I must say that creating the default location to have a space in the name was a stupid idea IMHO. This single oversight has caused a lot of problems.

Re: Increasing XP.vdi

Posted: 19. Jul 2013, 16:28
by loukingjr
thanks Perry. that's what I thought.

Re: Increasing XP.vdi

Posted: 19. Jul 2013, 17:29
by mpack
loukingjr wrote:just so I don't give anyone the wrong info, do snapshots not matter when resizing a VM? At least one time she tried using the UUID of her snaphot.
We are talking at cross purposes. I am addressing the syntax error that the OP has reported, not the mechanics of resizing a drive: there's a "Howto" already written to describe the latter.

Re: Increasing XP.vdi

Posted: 19. Jul 2013, 19:21
by loukingjr
Yes I see. I was trying to help her accomplish what she wanted to accomplish. Sorry.

Re: Increasing XP.vdi

Posted: 9. Jan 2014, 06:31
by HaohaiZi
Hi Everybody!

I am new in mac, so please help me in these case:
I try to increase space of Virtual Disk on mac host / windows 7 guest.

After i'd type:
# /Users/haohaizi/VirtualBox\ VMs/Windows\ 7\ 64/NewVirtualDisk1.vdi --resize 35000

the terminal wrote: /Users/haohaizi/VirtualBox VMs/Windows 7 64/NewVirtualDisk1.vdi: Permission denied

How to increase disk space?

Pls, pls, pls!

Re: Increasing XP.vdi

Posted: 9. Jan 2014, 10:34
by socratis
HaohaiZi wrote:# /Users/haohaizi/VirtualBox\ VMs/Windows\ 7\ 64/NewVirtualDisk1.vdi --resize 35000
You forgot to include the *actual command*. Your command line should have been:
VBoxManage modifyhd /Users/haohaizi/VirtualBox\ VMs/Windows\ 7\ 64/NewVirtualDisk1.vdi --resize 35000

Re: Increasing XP.vdi

Posted: 9. Jan 2014, 10:46
by HaohaiZi
oh, really! made change. and now is:

VBoxManage modifyhd /Users/haohaizi/VirtualBox\ VMs/Windows\ 7\ 64/NewVirtualDisk1.vdi --resize 35000
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!


any idea? :roll:

Re: Increasing XP.vdi

Posted: 9. Jan 2014, 10:59
by mpack
Assuming that the file really is a VDI, and not just something else that you renamed, this error usually means that you're trying to shrink the drive instead of expand it. Check the syntax in the user manual again, and pay attention to the meaning of the final numeric argument.