# Resize Boot2Docker disk volume

Boot2Docker VirtualBox VM is limited up to 20GB hard drive space allocated. The Boot2Docker package installer ships with a VMDK volume, which VirtualBox's native tools cannot resize.

We explain in following manual how to resize space.

Note: After that, when hard drive space will be too short and the drive is in VDI format, use this tutorial starting on GParted for resizing /sd1 to new size define in VirtualBox interface for hard drives.

# Operation

  1. Stop the Docker virtual machine
docker-machine stop default
  1. In order to resize the Boot2Docker disk volume, first clone a VDI volume from the default VMDK volume. Launch the VirtualBox application.

Virtualbox Main

  1. Click on "File>Virtual Media Manager" and "Copy" button.

Virtualbox Vm Manager Vmdk

  1. Select the image to copy

Virtualbox Vdi Default

  1. Select the VDI - VirtualBox Disk Image type

Virtualbox Vdi Choose

Select dynamic allocation in the next pop-up

  1. After copy, resize the newly cloned VDI volume to the desired capacity. We recommend at least 64GB.

Virtualbox Vdi Resize

  1. Select the default virtual machine, then click on the "Settings" gear on top.

Virtualbox Default Parameters

  1. In storage, add the cloned VDI volume via the "Add" option on SATA. If your are running Docker on a laptop with a solid-state hard drive, please make sure the "Solid-state Drive" option is selected for the cloned VDI volume.

Virtualbox Default Vdi

  1. Add a new IDE controller

Virtualbox Ide Controller

  1. Mount the GParted ISO via the "Add CD/DVD Device" option.

Virtualbox Default Gparted

  1. Click on "System" icon to review the boot order for GParted first.

Virtualbox Gparted First

Virtualbox Gparted First Media

  1. Click on the "Start" icon to boot up the Boot2Docker virtual machine, which will launch the GParted ISO. Select "GParted Live (Default settings)".

Virtualbox Gparted Start

  1. Set the policy for handling keymaps

Virtualbox Gparted Keymaps

  1. Set language preference

Virtualbox Gparted Language

  1. Select 0

Virtualbox Gparted Video

  1. Once GParted launches, click on the "Resize/Move" icon.

Virtualbox Gparted Resize

  1. Set the new disk volume size to the maximum. Click on the "Resize/Move" button to start the process.

Virtualbox Gparted Resize Start

  1. Confirm the resizing operation by clicking on the "Apply" button.

Virtualbox Gparted Resize Apply

  1. Power off the machine after the resizing operation finishes.

Virtualbox Gparted Stop

  1. Remove the GParted ISO

Virtualbox Gparted Remove

  1. Now Boot2Docker virtual machine is ready with the new volume size.