This should be easy but it's escaping me. I've researched on the web and it confirms that if I surround a Windows path in quotes it takes care of spaces. But not with VirtualBox. What am I overlooking?

VBoxManage modifyhd "C:\Users\sam\VirtualBox VMs\Ubuntu 14 desktop.vdi" --resize 16480

=> 'C:\Users\sam\VirtualBox VMs\Ubuntu 14 desktop.vdi' (VERR_FILE_NOT_FOUND)

This attempt:

VBoxManage modifyhd C:\Users\sam\"VirtualBox VMs"\"Ubuntu 14 desktop.vdi" --resize 16480

=> Syntax error: Invalid parameter 'VMs"Ubuntu 14 desktop.vdi'

Closer, but no cigar.

VBoxManage modifyhd C:\Users\sam\'VirtualBox VMs'\'Ubuntu 14 desktop.vdi' --resize 16480

=> Syntax error: Invalid parameter 'VMs'\'Ubuntu'"

Ok, time for brute force. You know when you use tab to complete folder names? I changed directories down to sam and when I attempted to tab the name of "VirtualBox" it spat back the .virtualbox directory name which is not what I need. I attempted to quote the VirtualBox VMs in CMD and it could not find that folder name. That's probably a clue but I'm unsure how to search for a solution to that. What am I overlooking? thanx, sam

  • rename "VirtualBox VMs" VirtualBoxVMs and rename "Ubuntu 14 desktop.vdi" Ubuntu14desktop.vdi :) – Paul Nov 19 '14 at 0:29
  • Yes, that would work normally. But the wrinkle is that VirtualBox maintains a record of the original path and it balks at finding this duplicate. Thx for offering as I hadn't thought of it yet. – sam452 Nov 19 '14 at 1:22
  • I was being flippant - but in any case, I think the VirtualBox config files are XML - or at least plain text, so you could update them too. Your first option should "just work" so I think this is some internal parsing issue with vbox itself. Someone will know. – Paul Nov 19 '14 at 1:34
  • I caught that. :) Your response was right on the money. What helped was to copy the path in VB's Media Manager, something I have missed. If you can update your response into the answer I'll accept that, thx. – sam452 Nov 19 '14 at 13:48

It looks like the best bet might be to remove the spaces from the path:

rename "VirtualBox VMs" VirtualBoxVMs 
rename "Ubuntu 14 desktop.vdi" Ubuntu14desktop.vdi

Then update the VirtualBox configuration to match. You can edit the config files directly with VB, or update the disk paths in media manager.

  • Yes, the path is special to VirtualBox. Retrieving it from the Media Manager directly was the approach to go. Thx. – sam452 Nov 19 '14 at 22:34

My Advice would be to use the uuid. You can get it by using :

VBoxManage.exe showhdinfo "c:\MyMachine.vdi"

Or by using this trick : rename the vdi and then click on configuration of your vm and go to storage. Then try to add the renamed vdi as hard drive. You will get an error but if you expand the error message, you will see the uuid. So just copy it and paste it in the command:

VBoxManage modifyhd $UUID --resize 16480

Hope that this will help someone

  • This would have the same problem in the showhdinfo command as the path still contains spaces. – psusi Mar 19 '16 at 0:42
  • Yeah that's why I added the trick. – rsabir Mar 19 '16 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.