Skip to content

Instantly share code, notes, and snippets.

@stormwild
Last active March 26, 2024 04:06
Show Gist options
  • Save stormwild/6403128 to your computer and use it in GitHub Desktop.
Save stormwild/6403128 to your computer and use it in GitHub Desktop.
VirtualBox clone fixed size vm to dynamic, resize dynamic vm, expand partition

http://brainwreckedtech.wordpress.com/2012/01/08/howto-convert-vdis-between-fixed-sized-and-dynamic-in-virtualbox/ http://www.webdesignblog.asia/software/linux-software/resize-virtualbox-disk-image-manipulate-vdi/#comment-474

While there is no way to actually switch a VDI between fixed-size and dynamic, you can clone the existing VDI into a new one with different settings with VBoxManage.

VBoxManage clonehd [old-VDI] [new-VDI] --variant Standard
VBoxManage clonehd [old-VDI] [new-VDI] --variant Fixed

If you want to expand the capacity of a VDI, you can do so with

VBoxManage modifyhd [VDI] --resize [megabytes] 

Ex. VBoxManage modifyhd Ubuntu12.vdi --resize 30000 (30GB)

http://kamaths.org/virtualbox-increase-hard-disk-size-of-linux-guest/

On a linux guest you need to resize the partion to take advantage of the resized disk.

Examples:

VBoxManage clonehd Ubuntu12.vdi Ubuntu12Dynamic.vdi --variant Standard
@aurel1211
Copy link

aurel1211 commented Jun 11, 2017

I didn't know where to post so I posted my problem here. I want to create a virtual machine with fix sized disk on virtualbox. How can I do this?

@AshkanV
Copy link

AshkanV commented Aug 14, 2017

Fantastic!
I Also found that you can do it with "Virtual Media Manager" from "File" menu, using copy button and following the steps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment