Make those VirtualBox virtual disks larger without loosing data

If you have ever used virtualization software to make virtual machines (VMs) then you know how easy it is to add and remove hardware resources to modify the VM to be configured the way you want it to be. Even though you can do far more things hardware wise to a VM than you can to a physical computer (without actually adding more physical hardware) there are still some limitations and things to look out for.

VirtualBox is a virtualization platform designed by Oracle and is free alterative to VMware's vSphere and Microsoft’s Hyper-V software. It allows you to create virtual machines that run on your local computer and use your computer's hardware resources as its own. One catch is that you have to share things like your hard disk space and RAM with all the VMs you make so if you are running 3 VMs with 6GB of RAM each then that's 18GB out of your total RAM that will be used by them assuming you have that much in your computer to begin with.

So let's say you have your VM created and exactly the way you want it except for you realized you didn’t make the hard drive big enough and you already used all the available space to make a volume in Windows. So what do you do? Unfortunately it's not as easy as going into the setting for the VM and simply making it bigger. But that doesn't mean it's not possible but rather that you have to put a little more work into resizing the drive.

As you can see for the settings of a VM named Windows7 there is a virtual disk called Windows7.vdi and its 25GB in size and set to dynamically allocate storage which means grow the disk file as needed. Now we are going to expand the size of the disk to 30GB. You should always backup your data before doing something like this in case something goes wrong.

VirtualBox disk properties

To do this we need to open a command prompt and go to the VirtualBox installation directory after shutting down the VM in question which should be C:\Program Files\Oracle\VirtualBox.

VirtualBox installation directory

Next we need to use the VBoxManage modifyhd command to resize a disk named Windows7.vdi located on our D drive under D:\VirtualDisks. By default your virtual disks will be located at C:\Users\username\VirtualBox VMs but not in our case. So the command we need to run will be

VBoxManage modifyhd "D:\VirtualDisks\Windows7.vdi" --resize 30720

Notice the quotes around the path and the 2 dashes before the word resize. 30720 is 30GB in MB.

Here is the output of our command.

VirtualBox disk resize

Now when we go to the properties of the VM and look at the size of the Windows7.vdi disk it's now 30GB.

VirtualBox disk properties

Then we can go into Windows and extend the volume and that can be done with Disk Management. Simply select the original volume and right click on it and choose Extend Volume. Then allocate the rest of the space to the volume.

DiskManagement extend volume

So as you can see it's not too difficult to enlarge the size of a virtual disk in VirtualBox and it really just takes one command to do so. So next time you are sizing a disk for a new VM you don't have to worry about not making it large enough because you now know how to make it bigger if needed!

Pin It

Join Us On FaceBook

Join Us On Twitter

Get insights into the computer industry and regular updates on our site. Click Here

OCT Youtube Channel

New tech tip videos posted on a regular basis. Subscribe today! Click Here

Sponsored

LATEST VIDEOS

Try out some interesting free software from Kaspersky ...

Learn How to Create a RAID 1 Mirrored Drive Set ...

Use the ipconfig command to troubleshoot network problem...

Avoid having to put in your password when you start your...

Kill stubborn tasks that refuse to die with Taskkill ...

Find out how much information Microsoft is gathering fro...

RECENT TIPS

Another utility you can use to fight off spyware As you...

Get those programs uninstalled completely with Revo Unin...

Make your computer easier to use with the Windows Ease o...

Learn the history of wireless technology and how it work...

Try out some interesting free software from Kaspersky ...

Tweak Windows 10 to have it work the way you want it to ...

NEWS

Microsoft to release Windows 10 Pro for Workstations If...

Microsoft wants to change how we use Windows 10 with Win...

FCC challenges the current net neutrality regulations A...

Mozilla takes things up a notch with its new faster and ...

Qualcomm Inc. has come out with a new server level proce...

Once again it's time for a Microsoft security breach tha...