Problems Resizing VDI

Discussions related to using VirtualBox on Mac OS X hosts.
saeran
Posts: 4
Joined: 14. Jul 2013, 06:29

Problems Resizing VDI

Post by saeran »

I'm trying to resize a VDI. I am doing so via the instructions here (can't post links, I'm a new member)
I type the following in to terminal "VBoxManage modifyhd /Volumes/Raid0Storage/VirtualBox/Win7v2.vdi --resize 60000"
But then I get this in return.

Saerans-Mac-Pro:~ Saeran$ VBoxManage modifyhd /Volumes/Raid0Storage/VirtualBox/Win7v2.vdi --resize 60000
VBoxManage: error: Could not find file for the medium '/Volumes/Raid0Storage/VirtualBox/Win7v2.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 220 of file VBoxManageDisk.cpp

Would appreciate some help.
Cheers
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: Problems Resizing VDI

Post by mpack »

The message seems pretty clear: there is no such file with that path and name.

VirtualBox VMs are normally contained in a VM folder which has the name of the VM, and also inside a parent folder for all VMs, called "VirtualBox VMs" (that's on Windows hosts, it may vary on other hosts). In which case I would expect the VDI path to be :- "/Volumes/Raid0Storage/VirtualBox VMs/Win7v2/Win7v2.vdi". Note the quotes around the path because it contains a space.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Problems Resizing VDI

Post by loukingjr »

You could look in the VirtualBox preferences and see where VirtualBox thinks the Default Machine Folders are suppose to be.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
ciamurra
Posts: 98
Joined: 22. May 2011, 15:59
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: windowsXP

Re: Problems Resizing VDI

Post by ciamurra »

I'm trying to do the same thing. I used Terminal, and the command that finally worked is this
VBoxManage modifyhd Documents/VirtualBox/HardDisks/WindowsXP.vdi --resize 20480
Use that exact syntax and substitute the absolute path including the name and extension. Do not begin with User/<name> in the path.
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: Problems Resizing VDI

Post by mpack »

ciamurra wrote:I'm trying to do the same thing. I used Terminal, and the command that finally worked is this
VBoxManage modifyhd Documents/VirtualBox/HardDisks/WindowsXP.vdi --resize 20480
Use that exact syntax and substitute the absolute path including the name and extension. Do not begin with User/<name> in the path.
Just to clarify, that example shows the use of an obsolete (v3.x and earlier) path to the VDI. Ignoring paths and looking at syntax, AFAICS the syntax is identical to what the OP already indicated he was using.

However the observation to use an absolute path is a good one - or at least "cd" into the correct folder and leave the path off altogether.
saeran
Posts: 4
Joined: 14. Jul 2013, 06:29

Re: Problems Resizing VDI

Post by saeran »

Appreciate the help but still no progress.
Editing the command to include quotation marks like one suggested however it made no difference...
Saerans-Mac-Pro:~ Saeran$ VBoxManage modifyhd "/Volumes/Raid0 Storage/VirtualBox/Win 7 v2.vdi" --resize 60000
VBoxManage: error: Could not find file for the medium '/Volumes/Raid0 Storage/VirtualBox/Win 7 v2.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 220 of file VBoxManageDisk.cpp
I'm definitly using the correct path. cl.ly/image/1E250Y411X2J (sorry can't make it a link, still not a member for one day)

NOTE: Names have been changed since my last post. I edited the names so there were no spaces, it helped but I figured quotation marks would work fine so I changed them back to their original names. The VM still runs fine, just can't resize it.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Problems Resizing VDI

Post by Perryg »

Post the results of the following in a host terminal:

Code: Select all

VBoxManage list systemproperties | grep "Default machine folder"
or if grep does not work in a Mac use the following

Code: Select all

VBoxManage list systemproperties
saeran
Posts: 4
Joined: 14. Jul 2013, 06:29

Re: Problems Resizing VDI

Post by saeran »

Perryg wrote:Post the results of the following in a host terminal:

Code: Select all

VBoxManage list systemproperties | grep "Default machine folder"
or if grep does not work in a Mac use the following

Code: Select all

VBoxManage list systemproperties
Saerans-Mac-Pro:~ Saeran$ VBoxManage list systemproperties | grep "Default machine folder"
Default machine folder: /Volumes/Raid0 Storage/VirtualBox
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Problems Resizing VDI

Post by noteirak »

Your path doesn't contain the VM name, where it usually does. Are you sure the path is correct?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
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: Problems Resizing VDI

Post by mpack »

How about simply showing us a directory listing of "/Volumes/Raid0 Storage/VirtualBox".
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Problems Resizing VDI

Post by loukingjr »

I think the problem is he has a space in the name of one of the folders. Macs don't mind that. VirtualBox seems to.

edit: well I never had to resize a .vdi but on a Mac, the easiest way seems to be to drag the .vdi to the terminal, type VBoxManage modifyhd in the front of the path and --resize <the new size> at the end of the path and hit return.
Last edited by loukingjr on 15. Jul 2013, 14:42, edited 2 times in total.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Problems Resizing VDI

Post by noteirak »

Actually the OS does, because space is a parameter delimiter in a command line.
But in this case the OP has used double quotes to enclose spaces, so it should work, given the fact the filename is correct of course.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Problems Resizing VDI

Post by loukingjr »

see above. I edited my post.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
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: Problems Resizing VDI

Post by mpack »

No, VirtualBox doesn't care about spaces in folder names, in fact the standard machine folder name on Windows hosts contains a space, i.e. "VirtualBox VMs". I can't speak for other hosts.

Of course when using a command line a space is a separator, so to treat a string as a single unit when it contains spaces, you must wrap the string in quotes.

Note that the OP had no space in his first post, but in the example when he said that quotes didn't work, he did have a space. The default machine folder seems to have a space in it - though I haven't paid much attention to the default machine folder branch of this discussion, since it's a possible red herring: there is no need to assume that the VM is actually located there.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Problems Resizing VDI

Post by loukingjr »

I just made a clone of one of my guests which has two spaces in it's name, dragged the .vdi file to a terminal window and did what I said above. works fine.

Code: Select all

louiss-imac:~ Mine$ VBoxManage modifyhd /Applications/VMs/antiX\ 12\ Clone/antiX\ 12\ Clone-disk1.vdi --resize 24000
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
louiss-imac:~ Mine$ 
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
Post Reply