Moving docker-desktop "distro" vhdx file

$ wsl --list

I stopped docker and I backed these up and moved both to drive Z: (an SSD) using wsl export/import.

However each time I start docker desktop, it deletes Z:\docker-desktop\ext4.vhdx and re-creates it as C:\Users\${USER}\AppData\Local\Docker\wsl\distro\ext4.vhdx

It doesn’t do the same for docker-desktop-data (which originally was also in C:\Users\${USER}\AppData\Local\Docker\wsl)

What I want is for all the docker files plus any volumes I create to be on the SSD (Z:)

What am I missing?


WSL version:
Kernel version:
WSLg version: 1.0.51
Edition|Windows 11 Pro
Version 22H2
OS build 22621.2134
Windows Feature Experience Pack 1000.22659.1000.0
Docker desktop v4.18

The intended way to move the distributions can be found in Docker Desktop itself:

Settings → Ressources → Advanced → Disk Image Location

If I remember right, this feature was broken on Docker Desktop =< v4.20. So you will need to update your version before using the feature to move the disk images.

Thanks. I had not noticed this option.

I had to uninstall and reinstall as the method you suggested just endlessly looped with the hand copied config I’d setup (even though it did run).

After a clean install I was able to do the move though I noticed when they are under C:\Users\${USER}\AppData\Local\Docker\wsl they are directories named ‘data’ and ‘distro’ but after the move they end up in directories named ‘data’ and ‘main’. Not a problem, just odd.

Anyways thanks!