is not a valid Win32 application
Description
deploying WSL2 distributions provisioning docker WSL distros: ensuring main distro is deployed: deploying "docker-desktop": importing WSL distro "%1 is not a valid Win32 application. \r\nError code: Wsl/Service/RegisterDistro/CreateVm/HCS/0x800700c1\r\n" output="docker-desktop": exit code: 4294967295: running WSL command wsl.exe C:\WINDOWS\System32\wsl.exe --import docker-desktop <HOME>\AppData\Local\Docker\wsl\main C:\Program Files\Docker\Docker\resources\wsl\wsl-bootstrap.tar --version 2: %1 is not a valid Win32 application. Error code: Wsl/Service/RegisterDistro/CreateVm/HCS/0x800700c1 : exit status 0xffffffff checking if isocache exists: CreateFile \wsl$\docker-desktop-data\isocache: The network name cannot be found.
Reproduce
docker --run
Expected behavior
It should run and not close.
docker version
Docker version 26.1.1, build 4cf5afa
This is all I get with docker --version
docker info
Unable to generate
Diagnostics ID
726D93F8-984A-49B4-9D84-58D97BFF1128\20240521155702.zip.
Additional Info
I think a Windows update is responsible for breaking the Docker Desktop system. I've been using it for months and suddenly it breaks.
Unfortunately I have tried many of the fixes for various issue found here. I think this started as a WSL deploy error. I didn't understand what I was looking at until after making many attempted fixes. Even uninstalling WSL and Docker Desktop didn't fix, it left me here. I'm out of ideas. Docker --info says unknown flag. My system is Win 10/64. I'm out of ideas.
According to the diagnostic, it's an issue with WSL2.
I found the exact same error message as https://github.com/microsoft/WSL/issues/8316. Maybe have a look at the WslService (and don't forget to restart the computer after enabling it).
Thank you for the info. I checked the service and it was running. So I reset it and restarted the cpu. I don't know that it had anything to do with this, but now Docker Desktop isn't crashing, it is now hanging on startup. It just continues to say "Starting the Docker Engine". Then again I have had a few more windows updated since.
I guess that is an improvement?
Well it took about 15 minutes for this to pop up.
Virtual Machine Platform is not enabled. Enable it using the following PowerShell script (in an administrative PowerShell) and then restart your computer before using Docker Desktop: Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
querying the Win32OptionalFeature class over WMI: Exception occurred. (Call cancelled )
I'm back to...
deploying WSL2 distributions
provisioning docker WSL distros: ensuring main distro is deployed: deploying "docker-desktop": importing WSL distro "%1 is not a valid Win32 application. \r\nError code: Wsl/Service/RegisterDistro/CreateVm/HCS/0x800700c1\r\n" output="docker-desktop": exit code: 4294967295: running WSL command wsl.exe C:\WINDOWS\System32\wsl.exe --import docker-desktop <HOME>\AppData\Local\Docker\wsl\main C:\Program Files\Docker\Docker\resources\wsl\wsl-bootstrap.tar --version 2: %1 is not a valid Win32 application.
Error code: Wsl/Service/RegisterDistro/CreateVm/HCS/0x800700c1
: exit status 0xffffffff
checking if isocache exists: CreateFile \\wsl$\docker-desktop-data\isocache\: The network name cannot be found.
I had this error until I enabled the virtualization option in bios . try to restart and check in the bios for the virtualization option. Try to enable it.
I don't see a virtualization option in my bios? Also, this seems to have started with a Windows update, which I am fairly certain didn't touch my bios.
I'm getting the following error when I try to start Docker Desktop for Windows.
Docker Desktop - Virtual Machine Platform not enabled
Virtual Machine Platform is not enabled. Enable it using the following PowerShell script (in an administrative PowerShell) and then restart your computer before using Docker Desktop:
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
querying the Win32OptionalFeature class over WMI: Exception occurred. (Invalid class )
But that is not the correct class name. The name should be Win32_OptionalFeature.
I have tried installing Docker Desktop. I am running Docker Desktop v4.32.0 on Windows 11 23H2 on a Surface Book 3.
C:\Git❯ get-windowsoptionalfeature -online | where state -eq Enabled | select FeatureName
FeatureName
-----------
Printing-PrintToPDFServices-Features
Printing-XPSServices-Features
MSRDC-Infrastructure
MicrosoftWindowsPowerShellV2Root
MicrosoftWindowsPowerShellV2
WCF-Services45
WCF-TCP-PortSharing45
MediaPlayback
WindowsMediaPlayer
SmbDirect
NetFx3
NetFx4-AdvSrvs
SearchEngine-Client-Package
Microsoft-RemoteDesktopConnection
WorkFolders-Client
Printing-Foundation-Features
Printing-Foundation-InternetPrinting-Client
HypervisorPlatform
VirtualMachinePlatform
Microsoft-Windows-Subsystem-Linux
Microsoft-Hyper-V-All
Microsoft-Hyper-V
Microsoft-Hyper-V-Tools-All
Microsoft-Hyper-V-Management-PowerShell
Microsoft-Hyper-V-Hypervisor
Microsoft-Hyper-V-Services
Microsoft-Hyper-V-Management-Clients
Containers
Containers-HNS
Containers-SDN
My issue was finally resolved using the info in this thread. https://github.com/docker/for-win/issues/14030#issuecomment-2220598176