Wednesday, December 16, 2015

VirtualBox 5 and still not working

VirtuaBox is gone to version 5 and it's VMDK support is still crap.

It's my mistake, when I was creating the last VM I should have paid attention, I was sleepcreatingVMs and accidentally created the VM with a VMDK disk. WRONNNGGG!!! I needed an other 100G on the VM, and then I started banging my head on my desk again.

Luckily it's just tedious stuff. Our good friend qemu-utils package comes to our rescue again, so it's just a waste of space and time. We got to convert it to a better supported format, and then do the work:

time qemu-img convert -f vmdk -O vdi /fullpathtodisk.vmdk  /fullpathtodisk.vdi
VBoxManage modifymedium disk /fullpathtodisk.vdi --resize 200000 

Note that you got to count the zeros correctly. I typed 20000 and it gave me the unhelpful message:  

0%... 
Progress state: VBOX_E_NOT_SUPPORTED 
VBoxManage: error: Resize medium operation for this format is not implemented yet! 

Well, yes, resizing to smaller sizes is not implemented, but at least be more helpful to a sleep-reprived sysadmin. I was telling it to resize it to 20GB, not 200GB! I scratched my head, googled the error, had some coffee, thought about it for a while, came back, tried the vmdk again, wasted more time, only after that I counted the zeros and cursed at myself loudly.

It would be nice if VirtualBox, after all these years, would support mnemonics like MB, GB... 

Syntax error: --resize: RTGetOpt: Command line option has argument with bad format. 

Darnit!!!