Open vault-thirteen opened 1 year ago
I have tried the suggestion of the com.docker.diagnose.exe
utility.
I have shut the WSL down, rebooted the PC, but nothing has changed.
wsl --shutdown
The diagnostics is the same.
I mentioned this issue in the WSL issue tracker. https://github.com/microsoft/WSL/issues/5895
I can reproduce this issue.
Eg trying to change the "Disk image location" from SSD to HDD by moving from C:
drive to :
B:\user\AppData\Local\Docker\wsl\DockerDesktopWSL
Will just create the folder, and docker desktop will just show the loading icon, with no disk activity on B:
drive.
Clicking cancel will show Docker engine is not running
I just ran the docker debug: https://pastebin.com/bdvFK839
i experience the same problem, the loading icon keeps spinning forever and the docker engine is stopped. trying to restart it and the changes are not applied.
from another issue for the mac version. i found a workaround by downgrading the docker desktop version 4.17 stopped the loading phase. but the disk image location reverts back to C: drive
Yesterday I ran into this issue with latest stable Docker Desktop 4.19.0
(106363) and today I ended up with workaround.
4.20.0
Still does NOT work, but developers have fixed "something" in related issue #13269 So, new issue was created #13522 (wait again until next "fix" π₯)
Manually change setting customWslDistroDir
in %APPDATA%\Docker\settings.json
BUT there are several caveats, please read and repeat carefully π€
First of all, after installing Docker Desktop I installed Debian
WSL distribution and set it as default distro (before that the default distro was docker-desktop-data
).
I don't think this is a critical moment, but Microsoft Learn (former docs) website recommends to install WSL distro before installing Docker Desktop. So, if you need exact PowerShell commands for that:
However, you can try without installing (changing) default WSL distribution. Maybe it will work with docker-desktop-data
as default. Then, give us feedback, because I didn't test it π
Step 1
%APPDATA%\Docker\settings.json
, e.g. in PowerShell
& ($env:APPDATA + "\Docker\settings.json")
customWslDistroDir
(empty string ""
by default), for example,
"customWslDistroDir": "D:\\apps\\Docker\\docker_wsl_images\\wsl"
Pay attention on double backslahes \\
in the path.settings.json
If you are lucky, one of two ext4.vhdx
files (the smallest one) will be moved from old location %LOCALAPPDATA%\Docker\wsl\distro\ext4.vhdx
to specified (new) location D:\apps\Docker\docker_wsl_images\wsl\main\ext4.vhdx
Pay attention that sub folder is changed (in my case) from "distro" to "main".
Step 2
Unfortunately, the largest ext4.vhdx
(~1.44GB) file for docker-desktop-data
distro stays in its [default] place: %LOCALAPPDATA%\Docker\wsl\data\ext4.vhdx
But you can move it manually. I found a way to do that in this comment.
After moving the image file, Docker Desktop should run normally.
I hope this long long comment will help someone π
yes, such a problem really exists (the recommendations above really helped to solve the problem) I don't quite understand why it is not possible to choose the drive on which docker desktop will be installed during installation.
I don't quite understand why it is not possible to choose the drive on which docker desktop will be installed during installation.
@TheOdemMove Hi! Actually, it's possible π You can't specify where to install Docker's VM (docker-desktop-data
and docker-desktop
) in installation wizard, BUT you can choose where to install Docker Desktop app (and all its components, ~2.8 GB on Windows). However, you have to install Docker Desktop from the command line in this case. The option --installation-dir
will help you π
Docker documentation provides the example without additional command-line arguments. Here's the example for PowerShell to install Docker Desktop to the custom folder:
Start-Process "D:\Docker Desktop Installer.exe" -Wait -ArgumentList "install --installation-dir=D:\apps\Docker\Docker"
Note: Pay attention that there is no any quotes for path value. I didn't try the path with spaces but you can pass a list of strings to -ArgumentList
which are not split (as when we pass a single string, my example). See more about ArgumentList
I can reproduce this issue. Eg trying to change the "Disk image location" from SSD to HDD by moving from
C:
drive to :B:\user\AppData\Local\Docker\wsl\DockerDesktopWSL
Will just create the folder, and docker desktop will just show the loading icon, with no disk activity on
B:
drive. Clicking cancel will showDocker engine is not running
I just ran the docker debug: https://pastebin.com/bdvFK839
Same with me
Facing the same issue with hyper-v in the current latest windows docker desktop
try this solution:
%APPDATA%\Docker\settings.json
, change the location to what ever you wantSame problem on linux debian 12 with docker desktop v4.27.0 when moving Disk image location from an SDD to an HDD. I fix that by editing the dataFolder field in $HOME/.docker/desktop/settings.json. Thanks to these messages for helping me to fix this.
Confirm the same issue occurs with win 11 and latest Docker desktop.
Solution was https://github.com/docker/for-win/issues/13345#issuecomment-1727929905 except the location to change is in "C:\Users[USER]\AppData\Roaming\Docker\settings.json"
Confirm the same issue occurs with win 11 and latest Docker desktop.
Solution was #13345 (comment) except the location to change is in "C:\Users[USER]\AppData\Roaming\Docker\settings.json"
@sonicviz Well, I have no Windows 11, but I don't think they changed a behavior for environment variable APPDATA
. It lets you 'hide' your real user name in such public instructions.
Try to paste %APPDATA%\Docker
in Windows Explorer's address bar and press Enter (see picture below for Windows 10). If you have not changed the default value it evaluated as C:\Users\yourusername\AppData\Roaming\Docker
Sure, I just prefer seeing complete paths rather than virtual. Either way is fine if it resolves to where you need to get to. The bigger issue is Docker Desktop is still bugged trying to do this in the app. Not a big deal to edit the settings manually, but would be nice if it wasn't bugged as well!
Facing the same issue with hyper-v in the current latest windows docker desktop
try this solution:
- quit docker desktop
- edit
%APPDATA%\Docker\settings.json
, change the location to what ever you want- start docker desktop
This is OK, fixed it with this solution, thanks.
@zhqu1148980644 Does not work for me. After changing the path in the file, Docker Desktop 4.34.3 confirms the directory. Puts something into it, but NOT the images. They are still stored somewhere. Notably the images screen also does not help to show them.
Fun fact: if you wanted to user Portainer/Portainer to inspect settings, Docker Desktop again lets you down with 404, access denied. You have read correctly. 404, access denied....
@zhqu1148980644 Does not work for me. After changing the path in the file, Docker Desktop 4.34.3 confirms the directory. Puts something into it, but NOT the images. They are still stored somewhere. Notably the images screen also does not help to show them.
I also had this issue today.
I experience the same problem with version 4.36.
The previously mentioned %APPDATA%\Docker\settings.json
does not exist.
Using the previously mentioned docker installation arguments --installation-dir=D:\apps\Docker\Docker
changes where docker is installed, but does not change where docker saves its disk images.
The error message I get is: An error occurred while applying the "Disk image location" setting. The previous value has been restored.
status not OK but 500: Unhandled exception: Source and destination directory owner mismatch.
Manually setting the same folder owner on the old and the new directory, does not change anything. Manually moving the DockerDesktop folder to the new location doesn't work, as Docker requires the folder to not already exist.
Actual behavior
Docker Desktop v4.17.1 Settings -> Resources -> Advanced: Disk image location is set to
I press the "Browse" button and select a new location. The text under the "Disk image location" label changes to:
I press the "Apply & restart" button and wait. An empty folder named 'DockerDesktopWSL' is created and that's all. Disk image is not in that folder.
I restart the Docker Desktop program. Go to the same settings again and what I see is: the 'Disk image location' is set to the old path before the change !
Expected behavior
I expect the disk images to be moved to a new location specified in the settings.
Information
Is it reproducible? I hope so.
Is the problem new? I did not use Docker Desktop before.
Did the problem appear with an update? No.
Windows Version: Microsoft Windows [Version 10.0.19045.2728]
Docker Desktop Version: v4.17.1
WSL2 or Hyper-V backend? WSL2
Are you running inside a virtualized Windows e.g. on a cloud server or a VM: No. Real Windows.
Output of
& "C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check
Steps to reproduce the behavior
See above.