VirtualBox Increase Disk Space of Guest Virtual Machine

VirtualBox Increase Disk Space of Guest Virtual Machine

We find the Guest Virtual Machine running out of the disk space assigned to them. Sometimes due to improper planning and sometimes due to unexpected increase in the size of data on the machine.

I have seen cases where we add additional disks and try to combine them together on the guest virtual machine. But we can also increase or expand the disk space of the Guest Virtual Machine.

Personally, I prefer VirtualBox which works really well for small test instances and clusters.

VirtualBox Increase Disk Space of Guest Virtual Machine

One such disk space issue was encountered on a test instance that I was working on and I figured increasing the disk space of the guest VM would be a better option over attaching additional disks to it.

The command line utility VBoxManage for VirtualBox makes life easier while managing the VMs.

To increase the disk space of guest virtual machine we need to use modifyhd parameter.

But first you need to shutdown the guest virtual machine.

The following is the syantax to increase disk space of guest virtual machine.

VBoxManage modifyhd VM_HD.vdi –resize SIZE_IN_MB

Let’s take an example for a guest virtual machine CentOS_6.5_x64 which has a VDI disk as CentOS_6.5_x64.vdi. The current size of the vdi is 25G. I will increase it to 40G.

We will cd into the directory for the guest virtual machine.

[[email protected] ~]# cd ~/VirtualBox\ VMs/CentOS_6.5_x64/

Now, let’s increase the disk space for CentOS_6.5_x64.vdi:

[[email protected] CentOS_6.5_x64]# VBoxManage modifyhd CentOS_6.5_x64.vdi –resize 40960

Output:

[[email protected] CentOS_6.5_x64]# VBoxManage modifyhd CentOS_6.5_x64.vdi --resize 40960
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
[[email protected] CentOS_6.5_x64]#

That should do it.

VirtualBox Increase Disk Space of Guest Virtual Machine

No Comments

Post a Comment

Time limit is exhausted. Please reload CAPTCHA.