Skip to content

Nano Server ltsc2025: gMSA Kerberos to SQL Server fails ("Failed to generate SSPI context") #664

Open

Description

@balaraghav

Describe the bug
On a Windows Server 2025 host, process-isolated Nano Server ltsc2025 containers can't authenticate to SQL Server with a gMSA credential spec. SqlConnection.Open() fails with Failed to generate SSPI context. On the same host, with the same credential spec, the same SQL Server and the same command, Nano Server ltsc2022 and Server Core ltsc2025 containers connect with Kerberos.

Image OS build Result
mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2025 26100.33674 ❌ Failed to generate SSPI context
mcr.microsoft.com/dotnet/sdk:10.0-nanoserver-ltsc2025 26100.33674 ❌ Failed to generate SSPI context
mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2025 26100.33674 ✅ KERBEROS as the gMSA
mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 20348.5773 ✅ KERBEROS as the gMSA
mcr.microsoft.com/dotnet/sdk:10.0-nanoserver-ltsc2022 20348.5773 ✅ KERBEROS as the gMSA

The Nano Server and Server Core 2025 images are on the same build, so this looks specific to the Nano Server 2025 image.

  • Checked on the host/AD side: SPN, DNS, secure channel, clock skew, and the encryption type (AES-256).
  • Setup: SQL Server runs on the container host itself.

To Reproduce
Run the following on a domain-joined Windows Server 2025 host. The host needs a gMSA credential spec (New-CredentialSpec), and SQL Server needs a login for the gMSA. Replace <sql-fqdn> and <gmsa>:

$t = @'
$c = New-Object System.Data.SqlClient.SqlConnection "Server=tcp:<sql-fqdn>;Database=master;Integrated Security=SSPI;Connect Timeout=15"
try { $c.Open(); $q = $c.CreateCommand(); $q.CommandText = "SELECT CONCAT(auth_scheme, CHAR(32), SUSER_SNAME()) FROM sys.dm_exec_connections WHERE session_id=@@SPID"; "OK: " + $q.ExecuteScalar() }
catch { "FAILED: " + $_.Exception.Message }
'@
$b = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($t))
foreach ($i in 'mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2025','mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022','mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2025') {
  "== $i"; docker run --rm --user ContainerAdministrator --security-opt "credentialspec=file://<gmsa>.json" --entrypoint pwsh $i -NoProfile -EncodedCommand $b
}

Expected behavior
The Nano Server ltsc2025 container authenticates with Kerberos as the gMSA, like the Nano Server ltsc2022 and Server Core ltsc2025 containers.

Configuration:

  • Edition: Windows Server 2025 Datacenter 10.0.26100.33650, domain-joined, process isolation
  • Base Image being used: Nano Server ltsc2025 (fails); Nano Server ltsc2022 and Server Core ltsc2025 work
  • Container engine: Docker
  • Container Engine version: 27.4.1

Additional context
This may be related to #537, but that report is about Nano Server ltsc2022 and inbound Kerberos. We can collect traces (pktmon, TSS ADS_Auth) if useful.

Activity

  1. github-actions commented on Nov 2, 2026

    @github-actions

    Thank you for creating an Issue. Please note that GitHub is not an official channel for Microsoft support requests. To create an official support request, please open a ticket here. Microsoft and the GitHub Community strive to provide a best effort in answering questions and supporting Issues on GitHub.

  2. changed the title [-]Nano Server ltsc2025: gMSA Kerberos to SQL Server fails ('Failed to generate SSPI context'); Nano ltsc2022 and Server Core ltsc2025 work on the same host[/-] [+]Nano Server ltsc2025: gMSA Kerberos to SQL Server fails ("Failed to generate SSPI context")[/+] on Nov 2, 2026
  3. microsoft-github-policy-service commented on Dec 3, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been open for 30 days with no updates.
    no assignees, please provide an update or close this issue.

  4. TheJayMann commented on Dec 4, 2026

    @TheJayMann

    I don't know if this is actually related to #537 or not, as that appears to describe a problem with nanoserver ltsc2022, and I have ltsc2022 actually working, along with the OP. I've constructed a simpler test (in my case, I'm downloading the dotnet/aspnet images rather than the dotnet/sdk images, but they use the same base image and should have the same result), where, instead of trying to connect to a SQL Server with gMSAs that have all been properly set up, I instead attempt to query the sysvol share of the domain, i.e. dir \\domain\sysvol. This has the same success matrix as provided by the OP (although I have not tried the servercore ltsc2025, I assume it would work properly for me as well).
    The specific error I would get on nanoserver ltsc2025 is that an attempt was made to logon, but the network logon service was not started. I see that in 2022, the netlogon service is running, while on 2025 it is not. Attempting to start the service would give a dependency error. When looking at the dependencies, I would see that it depeneded on LanmanWorkstation, which was not running, and it depended on NSI, which was running, and MRxSmb20, which was not installed. This driver is installed on 2022. Thus this appears to be related to (but not necessarily limited to) the removal of the MRxSmb20 driver, on which LanmanWorkstation depends. This is now an issue because .NET 11 does not publish to nanoserver ltsc2022, thus nanoserver images cannot be used with .NET 11 while having a working gMSA. dotnet/dotnet-docker#7490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions