May 13 2016 0

Increase disk size for VirtualBox Guest

Recently I can into a issue with one of my Windows based VirtualBox images. It had run out of disk space. Lucky for me it is possible to increase the size of a disk image.

Backup, backup, backup

Before performing any of the following steps make sure you have a complete backup of your virtual machine.

Preparation

To be able to resize a disk image the VirtualBox Guest can not have any snapshots (prior to version 4.3.*). So if your are still making use of an older version of VirtualBox you will either have to remove all the snapshots or upgrade to the latest version of VirtualBox (current release is 5.0.).

Resizing a disk image

If your are making use of disk images that are of the type (format) VMDK (Virtual Machine Disk) you will first have to clone the disk image converting it into the type (format) VDI (VirtualBox Disk Image)

VBoxManage clonehd "original.vmdk" "cloned.vdi" --format vdi
Cloning disk imageCloning disk image

After this step you can use the resize command. The following command resize the disk image named cloned.vdi to 51200 MB (50 GB)

VBoxManage modifyhd "cloned.vdi" --resize 51200
Resizing disk imageResizing disk image

To convert into back into the original format (VMDK) execute the following command

VBoxManage clonehd "cloned.vdi" "resized.vmdk" --format vmdk

Wrapping it up

You can now use the resized image as disk image within your VirtualBox Guest. After Windows has booted up we still need to make sure Windows is made aware of the additional available space. To do this start Computer Management (via Control Panel -> Administrative Tools) and under Storage’ -> Disk Management’ perform the action Extend Volume’ (by right-clicking on the partition to be extended). Accepting all the default values should be enough to

Extend VolumeExtend Volume

Previous post
Basket Shooter Progress #6
Next post
Basket Shooter Build Complete
This blog is powered by Blot