Skip to content

Instantly share code, notes, and snippets.

@aseigneurin
Created November 25, 2015 22:03
Show Gist options
  • Save aseigneurin/7d5f2f927cb7481cf776 to your computer and use it in GitHub Desktop.
Save aseigneurin/7d5f2f927cb7481cf776 to your computer and use it in GitHub Desktop.
Advice when preparing a VM

Set up the VM with automating tools

Properly export the VM

Shrink the disk (from https://www.maketecheasier.com/shrink-your-virtualbox-vm/):

  • Reboot in Recovery mode (hold the Shift key while the VM is booting)
  • Switch to Console
  • Mount the disk in read-only mode: mount -n -o remount,ro -t ext3 /dev/sda1 /
  • Zero out the free space: zerofree /dev/sda1
  • Shut down the VM: shutdown -h now

Then export the VM as an OVA file.

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