Steps we will take:
- Change boot2docker image type (this will take long)
- Resize image
- Resize partion (using GParted)
boot2docker stop
# 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
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
- Download GParted ISO from http://gparted.sourceforge.net or http://sourceforge.net/projects/gparted/files/gparted-live-stable/0.18.0-2/ (Note that the latest version doesn't work, you need to use v0.18.0-2)
- Open VirtualBox
- Go to: boot2docker-vm > Settings > Storage
- Right click - Add an IDE controller
- Add your downloaded GParted ISO as CD/DVD
- (boot2docker itself also is an ISO, do NOT remove it)
- Add your VDI to the SATA controller as Harddisk
- Remove the VMDK partition
- Boot your boot2docker vm (it should boot from the GParted ISO/CD)
- Choose all defaults
- 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
- Go to: VirtualBox > boot2docker-vm > Settings > Storage
- Remove the IDE controller (and thus the GParted ISO)
- Click Start :)
After this you can start boot2docker normally
boot2docker status # => poweroff
boot2docker start