User Tools

Site Tools


virtual:virtualbox

Virtualbox

Increase VDI disk size

Step 1: Increase the size of the drive.

For VirtualBox 6.0.x and later

Go to the MediaManager, find your VDI, make sure the “Properties” is enabled in the toolbar, select the “Attributes” on the bottom part. There is a slider and a numeric control there, that you can use to adjust the VDI size.

Be doubly careful before pressing the “Apply” button, because you can only increase the VDI size, you cannot decrease it. But that wouldn't be a real problem because you made a backup of your data before trying this stuff, right?

For VirtualBox before 6.0.x

Note: if the path has spaces in it you will need to wrap the path in quotes. Use the following command to increase the size of the drive:

VBoxManage modifyhd <absolute path to file> --resize <size in MB>

Example: I have a 10GB drive that I want to be 20GB the command would be.

VBoxManage modifyhd <absolute path including the name and extension> --resize 20480

Step 2: Extend the primary partition to include the new drive space.

Download the GParted Live CD or what ever partition manager program you wish and mount it to the guests virtual CD and boot the guest. You can download the GParted Live CD from HERE. From here you can expand the primary partition to use the new space.

Windows Vista and newer Windows guests can use the built in “Disk Management” tool to expand the primary partition.

Note 1: The only step that VirtualBox is concerned with is step 1. After that you need to seek additional information on the partition manager you wish to use from the vendor of the partition manager.

Note 2: You can not shrink a guest drive with VirtualBox due to the inherent danger of losing data or making the guest non-bootable.

Note 3: In 4.3.0 the devs fixed a bug which had previously made it impossible to resize a snapshot. Since then it is possible, but not recommended for non-experts.

Source: https://forums.virtualbox.org/viewtopic.php?f=35&t=50661

My Notes

You can only change the disk size if there are no snapshots. Even in version 6.1 Tested with a Windows 10 guest.

virtual/virtualbox.txt · Last modified: 2022/06/10 19:19 by 127.0.0.1