When launched Docker Desktop this morning I was greeted with an error message prompting me to run this command “Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform” in PowerShell as an administrator. This failed with this spectacular mess:
Enable-WindowsOptionalFeature : Class not registered
At line:1 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand
But, I’d noticed there was an update to Docker Desktop, so I thought I’d try to install that, and see if it solves my problem, but when running the Docker Desktop installer for version 4.37.1, I’m given this error:
Installation Failed
Component Docker.Installer.EnableFeaturesAction failed:
at Docker.Installer.InstallWorkflow.<DoHandleD4WPackageAsync>d__30.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Installer.InstallWorkflow.<DoProcessAsync>d__23.MoveNext()
If anyone has any idea what the cause of this unexpected behavior is, I’d really appreciate some advice. Docker Desktop has worked great since I installed it months ago, and I’ve only recently experienced any issues. Also, I haven’t installed any updates to Windows for a few days, so that can’t be the cause, as I was using Docker Desktop with no issues just yesterday. Windows version is: 23H2
VirtualMachinePlatform is required by Docker Desktop. If you can’t enable it on Windows, another Docker Desktop version will not be able to solve it. What is your Windows version?
My Windows version is 23H2. I was successfully running Docker Desktop as of Jan 16 (the day before my original post), then Docker Desktop inexplicably stopped working.
You are not the first saying Docker Desktop just stopped working without any change, but I believe you are the first showing that even PowerShell comands to enable Windows features fail.
Docker Desktop can use the WSL2 backend or HyperV backend. WSL2 requires VirtualMachinePlatform so if you choose WSL2, Docker Desktop requires that feature as well. If it is not available on Windows, Docker Desktop will not work
If not, try to use a different PowerShell version or click the link I shared to Microsoft’s documentation where they recommend a command that I think should work in cmd.
Hangs for a bit when run, but returns absolutely nothing. I tried it on Windows PowerShell (as admin) and PowerShell 7.4.6 (as admin as well). When it run it on Windows Powershell, I get about 115 lines added to my dism.log file including these errors:
2025-01-19 10:52:59, Error DISM DISM Package Manager: PID=4624 TID=24992 Failed to create a CBS package identity. - CDISMPackageManager::Internal_CreatePackageByName(hr:0x80040154)
2025-01-19 10:52:59, Error DISM DISM Package Manager: PID=4624 TID=24992 Failed to get the underlying CBS package. - CDISMPackageManager::OpenPackageByName(hr:0x80040154)
2025-01-19 10:52:59, Error DISM DISM Package Manager: PID=4624 TID=24992 Failed to open the Foundation package. - CDISMPackageManager::OpenFoundationPackage(hr:0x80040154)
2025-01-19 10:52:59, Error DISM API: PID=31520 TID=28840 Failed to open package - CGetFeatureInfoCommandObject::InternalExecute(hr:0x80040154)
2025-01-19 10:52:59, Error DISM API: PID=31520 TID=28840 InternalExecute failed - CBaseCommandObject::Execute(hr:0x80040154)
2025-01-19 10:52:59, Error DISM API: PID=31520 TID=15080 CGetFeatureInfoCommandObject internal execution failed - DismGetFeatureInfoInternal(hr:0x80040154)
When I run the analogous command in Command Prompt, it fails with the error message:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Error: 0x80040154
Class not registered
However, I believe the feature must be enabled and working properly because I have WSL 2 installed and working! Here is my version info:
I did the sensible thing and reinstalled Windows rather than trying to fix whatever was wrong with it. Turns out its faster to reinstall all of the relevant programs on my PC than it is to decipher these error messages. Thank you for the help though!