To develop my projects, I have a Linux virtual machine on my Desktop and Notebook. When I configured, used a 10GB HD, guessing it would take too long to not have enough space…

The problem is that it didn’t took too long, and suddenly I was with only 900MB of free space. I needed to resize my virtual machine HD, and it is on VMDK (Virtual Machine Disk) format. This format is cool because we can transit between different virtualization softwares… On my case, I like to use Virtual Box from Oracle.

Virtual Box comes with a executable called VBoxManage, inside its own folder. To me, the path is C:\Program Files\Oracle\Virtual Box\VBoxManage.exe. We’ll use this executable to alter the actual size of the VMDK.

Open the command prompt, and enter on Virtual Box folder:

We’ll use only 2 comands from VBoxManage, the clonehd and the modifyhd:

Note that –resize 81920 is in MegaBytes, being equal to 80GB (80 * 1024).

If you receive the error “Cannot register the hard disk becuase a hard disk with UUID already exists.“,  it has solution!!!

Also on command prompt, lets use VBoxManage to change the UUID of the VDI hard disk created with clone.

After that, just clone again from VDI to VMDK that it will work. Remember to use a software like GParted on the new VMDK file, to fully allocate the new free space, or else you will turn your VM on and will see the same small old size.

Also, don’t forget to delete the VDI that was created, and to delete the old VMDK on Virtual Media Manager of Virtual Box.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.