microsoft / Windows-Containers

Welcome to our Windows Containers GitHub community! Ask questions, report bugs, and suggest features -- let's work together.
MIT License
391 stars 60 forks source link

Unable to start `netprofm` service on windows server core 2022 ltsc image #514

Closed ivanovvitaly closed 3 weeks ago

ivanovvitaly commented 1 month ago

I'm trying to install Tailscale on windows server core 2022 ltsc base image, but installation fails with error

MSI (s) (E4:70) [16:52:55:270]: Product: Tailscale -- Some Windows system services required by Tailscale are currently disabled. Please re-enable the following services: netprofm

If I manually start the service using powershell I get the error

Start-Service : Service 'Network List Service (netprofm)' cannot be started due to the following error: Cannot start service netprofm on computer '.'.

How do I start the netprofm service? Please advice

vrapolinario commented 1 month ago

I don't have a response to this, but did some digging. Tried with Server Core and Server LTSC2022. The service is dependent on other services that are stopped:

PS C:\> get-service netprofm -RequiredServices

Status   Name               DisplayName
------   ----               -----------
Running  RpcSs              Remote Procedure Call (RPC)
Stopped  nlasvc             Network Location Awareness

When trying to start the nlasvc service, I get a similar error than netprofm:

PS C:\> start-service nlasvc
start-service : Service 'Network Location Awareness (nlasvc)' cannot be started due to the following error: Cannot
start service nlasvc on computer '.'.
At line:1 char:1
+ start-service nlasvc
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand

Interesting that nlasvc has all services it depends on started:

PS C:\> get-service nlasvc -RequiredServices

Status   Name               DisplayName
------   ----               -----------
Running  NSI                Network Store Interface Service
Running  RpcSs              Remote Procedure Call (RPC)
Running  Eventlog           Windows Event Log
Running  Dhcp               DHCP Client
Running  TcpIp              TCP/IP Protocol Driver

Finally, worth noting that netprofm service is running on a Windows Server with Server Core installation. I'll leave this to the PG team, but wanted to provide the quick findings.

djryanj commented 1 month ago

Confirmed that this is also an issue with servercore:ltsc2019.

johnstep commented 3 weeks ago

Some services are disabled by default in the base images, for efficiency. Please try changing the service start type for NlaSvc and netprofm from disabled to demand (manual). This can be done with sc.exe or with Set-Service from PowerShell, or even by editing the service registry values directly. Here is an example Dockerfile:

FROM mcr.microsoft.com/windows/servercore:ltsc2022
RUN sc.exe config NlaSvc start= demand & sc.exe config netprofm start= demand

The following should work from PowerShell:

'NlaSvc', 'netprofm' |% { Set-Service $_ -StartupType Manual }
ivanovvitaly commented 3 weeks ago

@johnstep thank you so much, I confirm that helps. Tailscale still fails to install, but the original issue with services is resolved.