DiagHost service repeating startup failures in Windows Server Core 2022 container
When running Windows Server Core 2022 container, DiagHost service startup fails constantly.
- What is the DiagHost service meant to do? I couldn't really find any relevant information online. I want to know if the service not starting has any relevant consequences for our use case, or if it's safe to disable the service.
- Can Microsoft fix the container image so that it wouldn't throw constant errors by default?
The "DiagHost" service is not present on full Windows Server 2022 VM Datacenter virtual machine or in ltsc2019 based Server Core image. I've only seen it in the ltsc2022 Server Core image, where it doesn't start.
Reproducing the problem:
- Run Windows Server Core 2022 container with default settings. Ping is there just to keep the container running. docker run -d --name DiagHostIssue mcr.microsoft.com/windows/servercore:ltsc2022 ping -t localhost
- Open PowerShell connection to the container docker exec -it DiagHostIssue powershell
- Check the System event log Get-EventLog -LogName System -Newest 20 -EntryType Error | Format-List *
Expected result:
No repeating errors in System event log.
Actual result:
Repeating errors such as:
"The DiagHost service terminated unexpectedly. It has done this 3 time(s)."
"The DiagHost service terminated with the following error:
%%1722"
Service info:
get-service diaghost | fl *
Name : DiagHost
RequiredServices : {}
CanPauseAndContinue : False
CanShutdown : False
CanStop : False
DisplayName : diaghost
DependentServices : {}
MachineName : .
ServiceName : DiagHost
ServicesDependedOn : {}
ServiceHandle : SafeServiceHandle
Status : Stopped
ServiceType : Win32OwnProcess
StartType : Automatic
Site :
Container :
Get-WmiObject win32_service | ?{$_.Name -like 'diaghost'} | select Name, DisplayName, State, PathName
Name DisplayName State PathName
---- ----------- ----- --------
DiagHost DiagHost Stopped C:\Windows\System32\svchost.exe -k LocalSystemNetworkRestricted