kerberos issue (SPN not found) with windows Hyper-V (samba 4.5.3 AD)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

kerberos issue (SPN not found) with windows Hyper-V (samba 4.5.3 AD)

Samba - General mailing list

I've setup over 6 months ago samba 4 AD on centos 7.3 (self compiled
from source). Up until now I didn't encounter any undocumented errors. I
have 3 DC's (all samba 4.5.3) which are working pretty nice with over 60
windows clients.

The issue I've stumbled upon is when I added Windows server Hyper-V
hosts to the domain. Tried with Hyper-V from 2012, 2012r2 and new 2016 -
all exact same problem.

I've searched and googled and found one old topic with the same issue in
samba lists, but no help was given, but also - not enough info was supplied.

The main issue is that Hyper-v Hosts are unable to authenticate each
other using kerberos for live migration and replication (only two
features that require kerberos) - windows host gives well documented
error, that it's unable to authenticate using kerberos.

I've gathered all the logs, which I think explain the issue quite
clearly and hopefully someone will be able to give a viable solution.

domain/realm let's call it: @ MYDOMAIN.COM.XYZ
hyper-v hosts:
BM-SRV-5 and BMSRV-WIN10 (both with windows server 2016 standard with
hyper-v host role installed)
DC1, DC2, DC3 are my 3 domain controllers (names not really original :) )

Microsoft Hyper-V requires specific SPN's registered for hosts:

*Microsoft Virtual Console Service**
**Hyper-V Replica Service**
**Microsoft Virtual System Migration Service*

The SPN's should be automatically registered in the AD machine account
by the windows, but this fails with windows error 14050. This error is
well documented, but none of the solutions helped, and I think the error
is with samba AD as I'll try to explain.

I added the  SPN's manually via windows setpsn (for both hyper-v hosts
of course, is of course bogus name, real domain is
something different)

/setspn -S "Hyper-V Replica Service/BMSRV-WIN10" BMSRV-WIN10//
//setspn -S "Hyper-V Replica Service/"
//setspn -S "Microsoft Virtual System Migration Service/BMSRV-WIN10"
//setspn -S "Microsoft Virtual System Migration
Service/" BMSRV-WIN10//
//setspn -S "Microsoft Virtual Console Service/BMSRV-WIN10" BMSRV-WIN10"//
//setspn -S "Microsoft Virtual Console
Service/" BMSRV-WIN10//
Both windows and samba when queried show correct SPN's:
output of windows query:

spn -l BMSRV-WIN10

Registered ServicePrincipalNames for
     Hyper-V Replica Service/BMSRV-WIN10
     Hyper-V Replica Service/
     Microsoft Virtual Console Service/BMSRV-WIN10
     Microsoft Virtual Console Service/
     Microsoft Virtual System Migration Service/BMSRV-WIN10
     Microsoft Virtual System Migration Service/

output of samba-tool query:
samba-tool spn list BMSRV-WIN10$

samba-tool spn list BMSRV-WIN10$
schema_fsmo_init: we are master[no] updates allowed[no]
User CN=BMSRV-WIN10,CN=Computers,DC=mydomain,DC=com,DC=xyz has the
following servicePrincipalName:
          Hyper-V Replica Service/BMSRV-WIN10
          Hyper-V Replica Service/
          Microsoft Virtual Console Service/BMSRV-WIN10
          Microsoft Virtual Console Service/
          Microsoft Virtual System Migration Service/BMSRV-WIN10
          Microsoft Virtual System Migration

It looks all fine and well (the SPN names are 100% correct verified).

For the hyper-v features to work (replica and live migration) with
kerberos I need to setup delegation (it's set - verified it a milion
times over it's set the right way, just like MS wants it).

I know that I can obtain tickets to other SPN
(from windows: *klist cifs/BMSRV-WIN10* grants me a valid ticket for

Now cometh the error:
When I try to run hyper-v replica it fails with error concerning
kerberos and SPN  not being there

Log from samba DC3 (when trying to start Hyper-V replica from BM-SRV-5
to BMSRV-WIN.10)

ipv4: for Hyper-V\ Replica\
Service/[hidden email] [canonicalize,
renewable, forwardable]
[2017/03/16 10:55:07.246904,  4]
   LDB_lookup_spn_alias: no alias for service Hyper-V Replica Service
[2017/03/16 10:55:07.246971,  3]
   Kerberos: Searching referral for
[2017/03/16 10:55:07.247028,  3]
   Kerberos: Server not found in database: Hyper-V\ Replica\
Service/[hidden email]: no such entry
found in hdb
[2017/03/16 10:55:07.247053,  3]
   Kerberos: Failed building TGS-REP to ipv4:

log from wireshark (earlier attempt but same issue, this time when
trying to start live migration from BM-SRV-5 to BMSRV-WIN10):

     Padding: 0
     kdc-options: 40810000 (forwardable, renewable, canonicalize)
     realm: MYDOMAIN.COM.XYZ
         name-type: kRB5-NT-SRV-INST (2)
         sname-string: 2 items
             SNameString: Microsoft Virtual System Migration Service
             SNameString: BMSRV-WIN10
     till: 2037-09-13 02:48:05 (UTC)
     nonce: 17847174
     etype: 5 items

     pvno: 5
     msg-type: krb-error (30)
     ctime: 2017-03-16 08:01:23 (UTC)
     cusec: 128
     stime: 2017-03-16 08:01:23 (UTC)
     susec: 66964
     error-code: eRR-S-PRINCIPAL-UNKNOWN (7)
     realm: <unspecified realm>
         name-type: kRB5-NT-UNKNOWN (0)
         sname-string: 0 items

Same errors are when going the other way round,

So the SPN's are clearly there (both setspn -l and samba-tool spn list
outputs confirm that), the client sends correct request (as seen by
wireshark and/or samba log), but suddenly samba is unable to find the SPN.
I'm a complete newbie (well, sort-of) when it comes to kerberos and
samba, but maybe because the SPN is with spaces, as it's pretty unusual,
but that's what Microsoft wants/needs?
I don't know, just a guess :-) . The features offered by hyper-v in AD
are obviously beneficial and I would love to get them working.
Any help, workaround or tip - I will be very, very thankful. If more
info is needed I'll gladly supply logs/whatever is needed.

Kacper Wirski

To unsubscribe from this list go to the following URL and read the