In this guide, I’ll walk you through the process of increasing the disk size of a VirtualBox virtual machine (VM) and allocating the additional space using GParted.


Step-by-Step Guide

1. Access the Virtual Media Manager

Go to the Virtual Media Manager of the VM you want to resize. You can find this under File > Virtual Media Manager.

file-tools-vmmanager


2. Select the Disk to Resize

Find the disk you want to increase in size and double-click it.

double-click-disk


3. Increase Disk Size

At the bottom of the screen, drag the slider to the right to increase the disk size to your desired value.

disk-size-increase


4. Verify Disk Size in the VM

Start your VM and run the following command in the terminal to check the disk size:

df -h

You’ll notice that the size remains the same because the additional space hasn’t been allocated yet.

terminal-command-disk-size


5. Download GParted ISO

We’ll use GParted to allocate the new disk space. Download the ISO file here.

gparted-download


6. Attach the GParted ISO

  1. In VirtualBox, go to the Settings of the VM you want to resize.
  2. Navigate to Storage.
  3. Click on Add Optical Drive.

vm-settings-storage


7. Select the GParted ISO

  1. Click Add and locate the GParted .iso file you just downloaded.
  2. Select the ISO, then click Choose at the bottom of the screen.

selecting-gpart-iso click-choose-gparted


8. Boot the VM with GParted

Start the VM. You should see the following screen:

gparted-initialized

Press Enter.


9. Launch GParted

When prompted, press Enter again to proceed with the default options.

console-data-interface

After selecting your language, choose option 0 to start GParted with its graphical interface.


10. GParted Interface

Once GParted loads, you’ll see its graphical interface:

gparted-interface


11. Resize the Partition

  1. Double-click the partition you want to resize.
  2. Drag the slider to allocate the remaining unallocated space.
  3. Click Resize/Move.

resize-vm


12. Apply the Changes

Click Apply All Operations to finalize the resizing.

apply-operation


13. Detach the GParted ISO

  1. Shut down the VM.
  2. Go to Settings > Storage.
  3. Remove the GParted ISO from the Optical Drive.

remove-attachment-gpart


14. Verify the New Disk Size

Start your VM again. Run the following command to check the new disk size:

df -h

You should now see the updated disk size.

new-disk-size


Conclusion

Congratulations! 🎉 You have successfully increased the disk size of your VirtualBox VM and allocated the additional space using GParted.