Resizing you Virtual Disk

From Klaus' wiki
Revision as of 10:28, 6 January 2017 by Klaus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a short description of how you can resize your haddisk to the virtual PC.

First shut down the guest operating system - the Centos.

The free and open version of VIrtualBox does not - yet - have the capability to resize the .vmdk disk's. Therefore you have to convert the present harddisk to another format, vdi.

$ vboxmanage clonehd "d03428v1-disk1.vmdk" "clone.vdi" --format vdi

here put in your diskname, eg. "Centos.vmdk"

Now, after a while waiting time, we are ready to perform the actual resizing.

$ vboxmanage modifyhd "clone.vdi" --resize 80000

Here the disk is resized to 80 GB ~ 80000MB

Finally one could think that we now need to clone the disk back to the vmdk-format. But that is not necessary. Just delete the present disk in the VirtualBox Manager - click Settings for the particular machine and move down to Storage. Delete the attached disk, e.g. Centos.vmdk and insert the "clone.vdi" instead.

Boot the PC and see that everything works.

As root start gparted and resize the main partition to t he new size.