LoginSignup
6
3

More than 5 years have passed since last update.

[Azure] Windows Server 2019インスタンス作成時にライセンス認証されない場合の対応手順

Last updated at Posted at 2019-01-10

2018年11月末に、Azure MarketplaceでWindows Server 2019のイメージが利用可能になりました。

image.png

実際に作成してみたところ、Windowsラインセンスが認証されない問題があったので、対応手順をまとめておきます。

作成したインスタンスの状況

Azure Marketplaceなので、当然Microsoftの公式イメージ(?)のはずですが、ライセンス認証の警告が出るVMがありました。

image.png

システムのプロパティを見ると「Windows is not activated.」となっています。

image.png

右の「Activate Windows」リンクを押すと、エラーが出ていました。

image.png

We can’t activate Windows on this device as we can’t connect to your organization’s activation server. Make sure that you’re connected to your organization’s network and try again. If you continue having problems with activation, contact your organization’s support person. Error code 0xC004F074.

弊社の環境では、アウトバウンドを全く制限していない環境でも、複数のインスタンスで現象が再現しました。

対応手順

Azure Windows 仮想マシンのライセンス認証に関する問題のトラブルシューティング に手順がまとまっていました。

Marketplaceのイメージということで、ライセンス自体は設定済みのはずなので後半の「VM と Azure KMS サービスの間の接続を確認する」を実施していきます。

まず、手順にある通りVMで PSping ツールをダウンロード して展開しておきます。以降の手順は、「管理者として実行」したPowerShell で実行します。

  • Azure KMS サーバーの構成を確認します。
PS C:\Users\azureuser\Downloads\PSTools> iex "$env:windir\system32\cscript.exe $env:windir\system32\slmgr.vbs /skms kms.core.windows.net:1688"
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

Key Management Service machine name set to kms.core.windows.net:1688 successfully.

"successfully"メッセージが出ることを確認します。

  • Psping を使用して、KMS サーバーへの接続があることを確認します。
PS C:\Users\azureuser\Downloads\PSTools> .\psping.exe kms.core.windows.net:1688

PsPing v2.10 - PsPing - ping, latency, bandwidth measurement utility
Copyright (C) 2012-2016 Mark Russinovich
Sysinternals - www.sysinternals.com

TCP connect to 23.102.135.246:1688:
5 iterations (warmup 1) ping test:
Connecting to 23.102.135.246:1688 (warmup): from 10.0.0.11:52907: 123.49ms
Connecting to 23.102.135.246:1688: from 10.0.0.11:52908: 123.29ms
Connecting to 23.102.135.246:1688: from 10.0.0.11:52909: 123.56ms
Connecting to 23.102.135.246:1688: from 10.0.0.11:52910: 123.48ms
Connecting to 23.102.135.246:1688: from 10.0.0.11:52911: 123.58ms

TCP connect statistics for 23.102.135.246:1688:
  Sent = 4, Received = 4, Lost = 0 (0% loss),
  Minimum = 123.29ms, Maximum = 123.58ms, Average = 123.48ms

image.png

コマンド実行するとライセンス許諾のダイアログが表示されるので、Acceptを選択して PsPing の応答があることを確認します。

  • ライセンス認証を試行します。
PS C:\Users\azureuser\Downloads\PSTools> 1..12 | % { iex "$env:windir\system32\cscript.exe $env:windir\system32\slmgr.vbs /ato" ; start-sleep 5 }
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

Activating Windows(R), ServerDatacenter edition (xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx) ...
Product activated successfully.

Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

Activating Windows(R), ServerDatacenter edition (xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx) ...
Error: 0xC004F074 The Software Licensing Service reported that the computer could not be activated. No Key Management Service (KMS) could be contacted. Please see the Application Event Log for additional information.
※以下省略※

コマンドを見ての通り、sleepを挟んでライセンス認証が12回試行されます。それぞれ正常終了したりエラーになったりしますが、1回でも "Product activated successfully." となればOKです(きっとこの不安定さが構築時に認証されない原因かと思われます...)。

コマンド実行後、システム設定の表示が認証済みに変わったことを確認します。

image.png

image.png

その他のエラー

Windows Server 2019のライセンス関連では、このようなエラーが出る場合があります。

image.png

This build of Windows will expire soon
Your build of Windows will expire on yyyy/mm/dd. You should move to a new build as soon as possible. Go online for more information.

このエラーはWindows Server 2019のPreview版を使っている場合に表示されるエラーで、VMを再作成する必要があります。こちらのリンク にもあるように Windows Server 2019は公開が遅れに遅れた経緯もあり、英語版のアナウンスを見てVM作成してみたが、実はPreview版だったという場合があるようです。

参考資料

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3