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.