How to resize a virtual disk in VirtualBox

Last update: 26/03/2025
Author Isaac
  • VirtualBox allows you to resize virtual disks to expand the storage available.
  • You can do it through its graphical interface or through commands with VBoxManage.
  • After resizing, it is necessary to adjust the partition within the guest operating system.

How to resize a virtual disk with VirtualBox

If you've ever run out of space on a VirtualBox virtual machine and are wondering how to expand its virtual disk without losing data, you've come to the right place. Increasing the size of a virtual disk may seem like a complicated process, but with the right tools, it's quite simple. In this article, we'll explain in detail how to resize a virtual disk in VirtualBox using different methods and tools.

Whether you prefer to use the VirtualBox graphical interface or run commands in the terminal, here you will find all the available options for expanding a virtual disk without risking data loss. We will also cover how to apply changes within the guest operating system to ensure that the additional space is properly available.

Why resize a virtual disk in VirtualBox?

When you create a virtual machine in VirtualBox, you need to define the size of the virtual disk. However, it is common to underestimate the amount of space needed to store programs, data, and updates. A virtual disk with little space can affect performance and limit functions within the guest operating system.

Some common reasons for increasing disk size in VirtualBox include:

  • The guest operating system displays insufficient space warnings.
  • Need to install new apps that require more storage.
  • Improve the overall performance of the virtual machine.

Method 1: Using the VirtualBox graphical interface

Since VirtualBox version 6, an easier way to resize virtual disks from the Graphic interface, without the need to use commands in the terminal.

Steps to increase the virtual disk size:

  1. Open VirtualBox and go to the option File > Virtual Media Manager.
  2. In the list of disks, select the disk you want to expand.
  3. At the bottom of the window, adjust the disk size with the slider.
  4. Once you have set the new size, click on Apply.
  Windows 11 not recognizing your new internal hard drive? Ultimate guide with updated solutions

This method is the fastest if your version of VirtualBox is supported, but it does not automatically perform the partition expansion within the operating system.

Method 2: Using the command line (VBoxManage)

If you prefer to perform the process manually or your version of VirtualBox doesn't have a graphical option, you can use VBoxManage, a command-line tool included with VirtualBox.

Steps to resize disk with VBoxManage:

    1. Shut down the virtual machine completely.
    2. Open the terminal or the symbol of the system en Windows (CMD).
    3. Run the following command to change the location to the folder where VirtualBox is located:

cd "C:\Program Files\Oracle\VirtualBox"

    1. Now, run the command to resize the virtual disk:

VBoxManage modifyhd "C:\Users\TuUsuario\VirtualBox VMs\MiVM\MiDisco.vdi" --resize 51200

  1. This command will increase the size to 50GBYou can change “51200” to the size in MB you need.

This method requires entering the exact path of the file .vdi and it only works if the disk is dynamic or expandable type.

Adjust the operating system to recognize the new size

After increasing the virtual disk size, the guest operating system will still display the same amount of available storage. It is necessary extend the partition within the system.

For Windows:

  • Open the Disk manager of Windows.
  • Locate the expanded disk partition, right-click it, and select “Extend Volume.”
  • Follow the wizard to allocate the additional space to the system.

To Linux:

  • Start the virtual machine with a GParted Live CD.
  • Select the disk partition and use the “Resize” option.
  • Apply the changes and reboot the system.

Additional tips

Before making changes to the virtual disk size, it is recommended to follow these steps: good practice:

  • Make a backup: Duplicate the file .vdi before starting to avoid data loss.
  • Check compatibility: The methods described only work with dynamic disks.
  • Always expand the partition: Extending the disk without adjusting the partition will have no effect on the usable size.
  How to fix corrupted user profile in Home windows 10

Expanding a virtual machine's storage in VirtualBox is a simple process if you follow the proper steps. Whether using the graphical interface or the command line, making sure to adjust the partition within the operating system is key to taking advantage of the newly available space. By following this guide, you'll keep your virtual machine running smoothly and with enough space for future expansions.

10 Best Programs to Partition a Hard Drive
Related article:
10 Best Programs to Partition a Hard Drive