Docker fails to change the Disk image location

I have googled this problem as it seems to come up quite frequently.

I have tried everything under google to troubleshoot this issue but under docker 4.78.0 (the latest) and Windows 11 with WSL2, if I try to change the disk image location it simply comes back with “Failed to apply settings.” I would provide screenshots but there is really no screenshot to capture of value there other than the error message “Failed to apply settings.”

  • I am running docker as administrator and the destination has plenty of free space for the .vhdx files.

To recreate under windows 11.

Settings → Resources → Select Browse and a new location under “Disk Image Location”

The \AppData\Local\Docker\wsl location has two folders under it.

  • disk\docker_data.vhdx,

  • main\ext4.vhdx

  • I notice right away as soon as I start the operation, the main\ext4.vhdx file is removed

  • In my NEW location a DockerDesktopWSL\disk folder is created and populated with a docker_data.vhdx file

  • The hard drive churns for about 5 minutes

  • The next thing I get is the error that it “Failed to apply settings”

  • Lastly the main\ext4.vhdx is suddenly placed back under its original location.

  • The ext4.vhdx never gets created in the new location.

  • The docker_data.vhdx file remains orphaned in the new location.

I’m at my wits end to change the location of these files as they are eating up my cdrive space. I’ve also tried shrinking the vhdx files to no avail. open DiskPart and select your disk (select vdisk file="C:\path\to\disk.vhdx"), then run compact vdisk. 0 space is reclaimed this way. This is frustrating to say the least as these seem like very basic operations.

This used to work. There is an existing issue on GitHub:
Docker hangs on Disk Image Location change to empty folder on external volume · Issue #195 · docker/desktop-feedback · GitHub

Looks like it could be the same issue.

Update: Never mind. I missed that it’s for Mac. You might want to create a new issue for Windows.

You could check if docker desktop logs provides any additional details.

I did see this one and tried various things from it but it was from three years ago (can a 3 year old bug that is this obvious still be around without being fixed?)… A few issues with what I tried from that incident link.

  • The settings.json file no longer exists, at least I can’t find it on my system. There is a settings-store.json file under roaming/docker but I am unsure of the syntax to set the new directory, and the process for doing it so that docker doesn’t get confused. Is that what that file is even used for?
  • I tried the “change the virtual disk size” hack but low and behold I can’t find this setting in current versions of docker desktop.

I’d pull my hair out over this one but I have none left.

You would think it would be easy to find “A” log file that has the output of setting change process and results, but in going through the local\docker\log\host directory of logs and local\docker\log\vm logs nothing stands out. I’m really trying hard here to get “something” to go off of here. The help is much appreciated. Issue creation is restricted onthat link you sent BTW.