Expand/Resize Virtualbox Disk Size (Windows Host, Ubuntu Guest)

Dec 13, 2019

Only Dynamically allocated storage could be resize. The following error occur if run VBoxManage modifymedium on fixed size disk.

Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage.exe: error: Failed to resize medium
VBoxManage.exe: error: Resizing to new size 17179869184 is not yet supported for medium 'D:\vm\Lubuntu\Data_4G.vdi'
VBoxManage.exe: error: Details: code VBOX_E_NOT_SUPPORTED (0x80bb0009), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleModifyMedium(struct HandlerArg *)" at line 768 of file VBoxManageDisk.cpp

If you have a fixed size disk, refer to VirtualBox Convert Fixed Disk to Dynamic/Stadard.

Resize VirtualBox VDI Disk

Launch command prompt

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

Change Disk Size

VBoxManage modifymedium disk "D:\vm\Lubuntu\Lubuntu.vdi" --resize 24576

NOTE: 24576 = 1024 * 24 = 24G.

NOTE: You can check for disk location with VirtualBox -> Settings -> Storage and click on Disk.

Pesize Partition

You need to repartition the disk as well.

Since I am resizing a mounted disk, I need to use GParted Live CD. Download gparted-live-1.0.0-5-i686.iso.

At VirtualBox -> Settings -> Storage, Add Optical Drive or select existing Optical Drive

VirtualBox add GParted Live CD

Start the Ubuntu Guest and you shall be prompted with the GParted Screen: select GParted Live (Default Settings), keymap and language.

Expand the extended File System: Right click on it and select Resize/Move.

NOTE: The option is disabled if you are not using Live CD, since it is mounted.

GParted Resize

GParted Resize

Resize the Partition.

GParted Resize

Click Resize/Move.

Expand the ext4 File System: Right click on it and select Resize/Move.

GParted Resize

Resize the Partition again, and click Click Resize/Move.

Click Apply All Operation at the toolbar.

GParted Apply

After the operation is done, close GParted. Click Exit on the Desktop.

Remove GParted Live CD from VirtualBox -> Settings -> Storage, then start the Ubuntu guest again.

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.