Skip to content

Instantly share code, notes, and snippets.

@obabawale
Created August 25, 2017 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save obabawale/0bfcb2bcb1bbee421105ee9d7afa5479 to your computer and use it in GitHub Desktop.
Save obabawale/0bfcb2bcb1bbee421105ee9d7afa5479 to your computer and use it in GitHub Desktop.
1. Change to the oracle virtualbox directory where you can run VBoxManage command
cd "C:\Program Files\Oracle\VirtualBox"
2. Clone the .vmdk file to a new .vdi file
VBoxManage clonehd "C:\Users\Somebody\VirtualBox VMs\Windows7\windows7.vmdk" "C:\Users\Somebody\VirtualBox VMs\Windows7\windows7.vdi" --format vdi
3. Run the next command to expand the cloned vdi disk. For instance, to expand to 50GB, do:
VBoxManage modifyhd "C:\Users\Somebody\VirtualBox VMs\Windows7\windows7.vdi" --resize 51200
4. In case you want convert to the .vmdk format, clone the new .vdi disk to .vmdk
VBoxManage clonehd "C:\Users\Somebody\VirtualBox VMs\Windows7\windows7.vdi" "C:\Users\Somebody\VirtualBox VMs\Windows7\resized.vdi" --format vmdk
5. You should be set to use any of the hard disks in your virtual machine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment