|
kfc328 (Kevin Cornelius) January 17, 2025, 3:52pm 1
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.EnableWindowsOptionalFeatureCommandBut, 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 1 Like
rimelek (Ákos Takács) January 19, 2025, 12:05am 2
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?
kfc328 (Kevin Cornelius) January 19, 2025, 1:40am 3
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. 1 Like
rimelek (Ákos Takács) January 19, 2025, 8:52am 4
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 i don’t know what can cause this error, but you can find issues like this: github.com/PowerShell/PowerShell
Get-WindowsOptionalFeature -Online fails on 7.1.0-rc.2 (MSIX)- [Get-WindowsOptionalFeature: Class not registered]
opened 12:57AM - 25 Oct 20 UTC
Issue-Bug OS-Windows Area-Maintainers-Build Package-MSIX WG-NeedsReview KeepOpen
## Steps to reproduce ```powershell Get-WindowsOptionalFeature -Online …>Get-WindowsOptionalFeature: Class not registered get-error Exception : Type : System.Runtime.InteropServices.COMException ErrorCode : -2147221164 TargetSite : Name : ThrowTerminatingError DeclaringType : System.Management.Automation.MshCommandRuntime, System.Management.Automation, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 MemberType : Method Module : System.Management.Automation.dll StackTrace : at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord) Message : Class not registered Source : System.Management.Automation HResult : -2147221164 CategoryInfo : NotSpecified: (:) [Get-WindowsOptionalFeature], COMException FullyQualifiedErrorId : Microsoft.Dism.Commands.GetWindowsOptionalFeatureCommand InvocationInfo : MyCommand : Get-WindowsOptionalFeature ScriptLineNumber : 1 OffsetInLine : 1 HistoryId : 1 Line : Get-WindowsOptionalFeature -Online PositionMessage : At line:1 char:1 + Get-WindowsOptionalFeature -Online + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ InvocationName : Get-WindowsOptionalFeature CommandOrigin : Internal ScriptStackTrace : at <ScriptBlock>, <No file>: line 1 ``` ## Expected behavior ```powershell $PSVersionTable Name Value ---- ----- PSVersion 7.0.3 PSEdition Core Get-WindowsOptionalFeature -Online FeatureName : Printing-PrintToPDFServices-Features State : Enabled FeatureName : Windows-Defender-Default-Definitions State : Disabled FeatureName : Printing-XPSServices-Features State : Enabled ... ``` ## Actual behavior ``` Error: Get-WindowsOptionalFeature: Class not registered ``` ## Environment data ```powershell $PSVersionTable Name Value ---- ----- PSVersion 7.1.0-rc.2 PSEdition Core GitCommitId 7.1.0-rc.2 OS Microsoft Windows 10.0.20211 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 ``` Does the following command work? Get-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatformIf 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. dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Windows version is: 23H2 Windows 11?
kfc328 (Kevin Cornelius) January 19, 2025, 4:32pm 5 Get-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform 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 registeredHowever, I believe the feature must be enabled and working properly because I have WSL 2 installed and working! Here is my version info: 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.22631.4602Here is some more specific information on my Windows version if that is helpful: Edition Windows 11 Home Version 23H2 Installed on 12/17/2022 OS build 22631.4602 Experience Windows Feature Experience Pack 1000.22700.1055.0I will try resetting Windows and see if that magically fixes these issues.
kfc328 (Kevin Cornelius) January 19, 2025, 7:23pm 6
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!
system (system) Closed January 29, 2025, 7:23pm 7
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed. (责任编辑:) |

