The size of MobyLinuxVM.vhdx is large and getting larger, is it possible to shrink it?

So I am using the Docker for Windows beta. I have some concerns about the disk usage of the virtual disk MobyLinuxVM.vhdx.

  1. I just pull a single simple image. According to docker images, the image is ~6 GB. But MobyLinuxVM.vhdx actually takes ~11GB.

  2. I am expecting that the size of virtual disk is unchanged from time to time because I actually do not “save anything to Docker”. I basically open the container, as a drop-in Linux-like environment, do something, and close it. I do not commit any new container. But after some days, the size of MobyLinuxVM.vhdx is getting larger, from ~11GB to ~15GB!

Is there any way to actually shrink the useless virtual disk spaces?



thanks for the feedback. Being able to shrink the the HD is something we are tracking as a future feature but I’m not sure when it will get implemented. For now a very crude way of shrinking it is to use the Reset to Factory defaults option.


@rneugeba I have been using Docker for Windows Beta for a couple months and my MobyLinuxVM.vhdx file is 60GB!

How do I shrink it?


I wrote this article because I had the same problem, but it is written in Portuguese