Error when resizing VirtualBox disk on Windows

I recently needed to resize my CentOS VDI using the following command:

"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "c:\CentOS\CentOS.vdi" --resize 20480

Unfortunately it kept failing with this error message:

VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Code CO_E_SERVER_EXEC_FAILURE (0x80080005) - Server execution failed (extended info not available)
VBoxManage.exe: error: Most likely, the VirtualBox COM server is not running or failed to start.

After pulling my hair for almost an hour I finally tried running the command from a NON-elevated command prompt. Yes, that’s right, this command apparently MUST NOT be run with administrator privileges. Weird.

Also, this is CentOS with an LVM partition which can’t be resized with GParted. To resize an LVM partition follow these steps.

  • anon

    Thanks!

  • Martin

    Thank you, i was stuck on the elevated command prompt as well. Probably wouldnt have tried it without your suggestion.

    Lifesaver!

  • Dmitry

    Thanks a lot!

  • Mike

    Thanks! You just saved me a ton of aggravation….

  • Thanks! That saved some pain 🙂

  • Excellent! I had an old backup of a hard disk that I wanted to load up in VBox, but there was a UUID conflict. Both “VBoxManage clonevdi disk1.vdi disk2.vdi” and “VBoxManage internalcommands sethduuid disk.vdi” were giving me this same error.

  • Anonymous

    I have not idea how you figured that out. that’s the most ridiculous sh*t. it works at a non-admin command prompt but not an elevated command prompt?? thank you!

  • Gary Wardell

    Wow,

    Who would have thought. Usually commands like this have to be run with administrative privileges. And usually things that work as a normal user also work as an administrator.

    I had to try this myself as I didn’t believe it.

    This really needs to be written up and put in the documentation.

    I had tried ALL of the remades I could find on the virtualbox site, all to no avail.

    Gary

  • Toff

    Thanks so much – as others have said; who would have thought a problem would have been caused by using elevate privileges!!

  • Anand

    Great !!! Thanks for saving my time

  • Son

    Thanks for saving my time.

  • FF

    Wow. Unbelievable. Thank you.

  • Justin

    Good catch. Thank you.

  • lafat32

    Gracias! esto me ha ayudado mucho.