Docker Desktop - Unexpected WSL error

deploying WSL2 distributions
ensuring data disk is available: exit code: 4294967295: running WSL command wsl.exe C:\WINDOWS\System32\wsl.exe --mount --bare --vhd D:\Programs_x64\Docker\images\disk\docker_data.vhdx: Failed to attach disk '\\?\D:\Programs_x64\Docker\images\disk\docker_data.vhdx' to WSL2: Access is denied. 
Error code: Wsl/Service/AttachDisk/MountVhd/HCS/E_ACCESSDENIED
: exit status 0xffffffff
checking if isocache exists: CreateFile \\wsl$\docker-desktop-data\isocache\: The network name cannot be found.

I can solve the issue by running wsl --unregister docker-desktop. But then when I shut down Docker Desktop and restart it, the error is there again.

When I run ‘wsl -l’, I see 2 distributions:

Ubuntu (Default)
docker-desktop

System Information
Diagnostics ID: 12C7270B-A00A-4037-9DBB-F795F103CA70/20240905211852
Docker Desktop version: 4.33.1.0
Docker version 27.1.1, build 6312585
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.19045.4780

I’m running Docker Desktop as administrator.

Any help much appreciated!

1 Like

hello @serrhendrik , have you been able to figure out how to fix this issue?

Thank you.

1 Like

Following message is translated by moderators using Google Translate:

Open cmd as an administrator and remount it, wsl --mount --bare --vhd D:\AI\Docker\docker\wsl\disk\docker_data.vhdx, but it needs to be remounted every time the computer restarts. It is very troublesome.

This is an English community forum. Please, write your posts in English, otherwise moderators can delete it. I fixed it this time