Page 1 of 1

resize the virtualbox vdi, while the file is on the external hard drive

Posted: 16. Jul 2017, 16:45
by clsa
directory of my vdi file
directory of my vdi file
WX20170716-121504.png (71.11 KiB) Viewed 5871 times
Hello, I want to increase the size of the windows10 vm, and I have done that before. However, a couple days ago, I moved my windows10 vm to an external hard drive. And when I try to increase the size this time, I got following errors.

LuWeichendeMacBook-Air:~ luweichen$ VBoxManage modifyhd --resize 100000 ~/Volumes/G-DRIVE\ mobile\ USB/VirtualBox\ VMs/win\ 10/win\ 10.vdi
VBoxManage: error: Could not find file for the medium '/Users/luweichen/Volumes/G-DRIVE mobile USB/VirtualBox VMs/win 10/win 10.vdi' (VERR_FILE_NOT_FOUND)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 179 of file VBoxManageDisk.cpp

Can someone help me plz. Thx

Re: resize the virtualbox vdi, while the file is on the external hard drive

Posted: 16. Jul 2017, 18:07
by mpack
Please post a screenshot of your hosts file browser window opened to that folder. Or, listing the folder in a terminal window would be just as good.

I.e. please prove that the error message is wrong, and that file really is at that location.

Re: resize the virtualbox vdi, while the file is on the external hard drive

Posted: 16. Jul 2017, 20:22
by socratis
I'll focus on the part of the command line that's wrong:
VBoxManage modifyhd --resize 100000 ~/Volumes/G-DRIVE...
Do you see that tilde (~) in front of the "/Volumes/..."? That shouldn't be there. That tilde translates to "your home directory". And your VDI is not in your home directory, it's in the "G-DRIVE...". i.e. "/Volumes/G-DRIVE...".

Re: resize the virtualbox vdi, while the file is on the external hard drive

Posted: 16. Jul 2017, 21:49
by clsa
That works. Thx a lot

Re: resize the virtualbox vdi, while the file is on the external hard drive

Posted: 31. Jul 2017, 19:18
by BobOra
I'm getting an error in trying to resize a Windows 10 guest .vdi under macOS 10.12.6. I've dragged the .vdi file into Terminal, and surrounded it with quotes. I usually have success with this form of an escaped path name, but wanted to check if that is the correct method. Secondly, the first recipe I used (from other parts of the forums) places the full path after "modifyhd"; however in this thread, it appears the path is at the end. I tried it at the end as well, but this did not change the results.

$ VBoxManage modifyhd "/Users/bob/VirtualBox\ VMs/Windows\ 10\ Enterprise\ 64-bit/Windows\ 10\ Enterprise\ 64-bit.vdi" --resize 35000

VBoxManage: error: Could not find file for the medium '/Users/bob/VirtualBox\ VMs/Windows\ 10\ Enterprise\ 64-bit/Windows\ 10\ Enterprise\ 64-bit.vdi' (VERR_FILE_NOT_FOUND)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 179 of file VBoxManageDisk.cpp

thanks

Bob

Re: resize the virtualbox vdi, while the file is on the external hard drive

Posted: 31. Jul 2017, 20:34
by BobOra
I just tried running the command without quotes surrounding the path, and it worked.

Bob

Re: resize the virtualbox vdi, while the file is on the external hard drive

Posted: 31. Jul 2017, 20:38
by mpack
BobOra wrote:I just tried running the command without quotes surrounding the path, and it worked.
I'm no expert on OS X command line, but looking at the syntax you were using I would expect that you should either "escape" the spaces as you were doing, or you surround the string in quotes. Not both.

Re: resize the virtualbox vdi, while the file is on the external hard drive

Posted: 31. Jul 2017, 23:16
by BobOra
I believe you are correct. It has been a long while, and I'd forgotten the usage.