Skip to content

Instantly share code, notes, and snippets.

@MatthewRDodds
Forked from joost/resize_boot2docker.sh
Last active August 29, 2015 14:25
Show Gist options
  • Save MatthewRDodds/558e7653a74a9370ff96 to your computer and use it in GitHub Desktop.
Save MatthewRDodds/558e7653a74a9370ff96 to your computer and use it in GitHub Desktop.
Resize boot2docker VirtualBox image

Resize boot2docker VirtualBox image

Steps we will take:

  1. Change boot2docker image type (this will take long)
  2. Resize image
  3. Resize partion (using GParted)

Stop boot2docker

boot2docker stop

Change the size of the image.

# Convert the VMDK image to VDI (one that we can resize). This will take some time.
vboxmanage clonehd ~/VirtualBox\ VMs/boot2docker-vm/boot2docker-vm.vmdk ~/VirtualBox\ VMs/boot2docker-vm/boot2docker-vm.vdi --format VDI --variant Standard

Resize

vboxmanage modifyhd ~/VirtualBox\ VMs/boot2docker-vm/boot2docker-vm.vdi --resize 40000

Next we need to change the boot2docker partition size to use our resized image

Install GParted on your boot2docker vm:

Start GParted

  • Boot your boot2docker vm (it should boot from the GParted ISO/CD)
  • Choose all defaults

Resize the partition (in the GUI):

  • Right click > Resize on the boot2docker-data partition
  • Drag the slider to increase the partition/volume
  • Click Resize/Move
  • Click Apply > and one last time :) (this wont take long)
  • Quit and Shutdown

Next remove GParted

  • Go to: VirtualBox > boot2docker-vm > Settings > Storage
  • Remove the IDE controller (and thus the GParted ISO)

Start the boot2docker vm using VirtualBox

  • Click Start :)

After this you can start boot2docker normally

boot2docker status # => poweroff
boot2docker start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment