Instantly give your VMs more hard drive space!
VirtualBox uses what they call Virtual Disk Images (VDI) as virtual hard drives for storage on their virtual machines and these virtual hard drives are actually files that are stored on the host computer that is running Virtual Box.
The great thing about using these types of virtual disks (and virtualization altogether) is that you can attach them and detach them from various virtual machines so they can be used by more than one VM. You can also resize them when needed if you notice that you are running low on space and need to increase their capacity.
The process for increasing the size of a VDI is very simple and the process only takes a few minutes to complete. One thing to keep in mind before adjusting anything with your virtual hard disks is to backup your data just in case something goes wrong because if you don’t, something WILL go wrong!
In my example I have a new VDI file that was created using 50 MB of space instead of the intended 50 GB of space so I will need to increase this size of the disk so I can have it the size that I need. Of course I can always delete this disk and make a new one but if you have file on the disk then that’s not an option unless you want to copy them somewhere else first and then back to the new disk.
To begin the process I will need to go to the File menu and then choose Virtual Media Manager. This will the show me all of the virtual hard disks (VDI files) that I am using with VirtualBox. As you can see below, the file called W10_1.vdi is the one that got created as a 50 MB disk so that’s the one I need to select.
Now I can simply move the slider to the right to increase the size of the disk until I get to 50 GB or I can manually type in 50 GB in the box to the right.
Once I click on Apply, the disk size will be increased to 50 GB and I will be ready to use my new found space.
One thing to keep in mind is that this process can only be used to increase the size of a virtual disk and not decrease the size. You might have also noticed the 2 TB size limit which is what you are stuck with when using the VirtualBox Manager GUI but if you need to increase the size larger than that then you can do it via the command line.