Docker – Move boot2docker machine to secondary hard drive – Windows 10 Home edition

Docker images can take a lot of spaces over time.
My primary hard drive is a 128GO SSD so I wanted to move my boot2docker virtual machine to my secondary hard drive (D:/).

I followed those instruction.

Here is the summary:

  1. Open virtualbox
  2. Stop the virtual machine default if it’s in function
  3. File > Virtual Media Manager
  4. Make a copy of disk.vmdk to the desired location on your secondary hard drive
    1. Type is VMDK
    2. Choose Dynamically allocated
    3. Choose the new location
      boot2docker-copy-hard-drive
  5. Go the Settings of the machine default
  6. Go to Storage tab
  7. Select disk.vmdk and remove it
    1. Note: take note of the SATA port
      boot2docker-remove-disk
  8. Add a new existing hard drive and select the copied one
    boot2docker-add-drive
    virtualbox-choose-existing
  9. Make sure the SATA port is the same as previously
  10. Launch docker again

Make sure your images are still there by running

docker images

You can safely delete the old hard drive

Note: It is located under C:\Users\%Username%\.docker\machine\machines\disk.vmdk

Advertisements