¯\_(ツ)_/¯

thunder@home:~$

This is my home blog, mostly to share some useful info or code snippets
~ 1 min

Heya,

After Windows 10 got 2004 update, I finally was able to use Docker for Windows with enabled and working VirtualBox.

By default Docker for Windows will keep its data on C: drive and if you have small SSD drive supposed to use only for system, Docker can consume all free space.

Docker Data location

By default, location of the files is %USERPROFILE%\AppData\Local\Docker\wsl

Lets move this to new location.

Here is what we need to do:

Stop Docker and make sure it has STOPPED state for two services

wsl --list -v

you should see something like this

  NAME                   STATE           VERSION
* docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2

Create a directory where Docker will store all its data

mkdir -p D:\Docker\wsl\data

Export Docker Data

wsl --export docker-desktop-data "D:\Docker\wsl\data\docker-desktop-data.tar"

This could take a while. In my case it was about 6Gb tarred and took about 1 minute :)

Now, unregister docker-desktop-data from WSL2

wsl --unregister docker-desktop-data

Run again wsl --list -v and you’d see only docker-desktop registered in WSL.

Lets import that back and bind to our new location

wsl --import docker-desktop-data "D:\Docker\wsl\data" "D:\Docker\wsl\data\docker-desktop-data.tar" --version 2

Now, just start Docker for Windows and see that all works :)

You can also move docker-desktop to that location as well by making same procedure but for docker-desktop instead of docker-desktop-data. But I didn’t test that.

Happy windockering!

Thank You For Reading