Skip to content

Instantly share code, notes, and snippets.

@tuxnker
Last active December 2, 2016 15:24
Show Gist options
  • Save tuxnker/0e520546633d1fd7e4ac7d03cbc3eb6d to your computer and use it in GitHub Desktop.
Save tuxnker/0e520546633d1fd7e4ac7d03cbc3eb6d to your computer and use it in GitHub Desktop.
reduce the size of a virtual-box disk
VBoxManage clonehd $(ls *.vmdk) box-disk1.vdi --format VDI && \
VBoxManage modifyhd box-disk1.vdi --compact && \
VBoxManage storageattach $(pwd | sed 's#.*/##') --storagectl IDE --device 0 --port 0 --type hdd --medium "box-disk1.vdi" && \
rm -f $(ls *.vmdk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment