Hyper-Vで使用するWindows7のベースイメージを作成してみました。今までは差分ディスクを使わずにインストールしていたのですがさすがにめんどくさくなったので・・・
まずは、Hyper-VでWindows7をインストール。今回使用したISOはSP1込のものを使用しました。
そして、最新の更新プログラムをインストールして準備完了。
先に重要なことを書きます。
Windows7 でSysprepを実行すると
このようなエラーが出ます。
Windows Automated Installation Kit for Windows 7 Readme
こちらを見ると、既知の問題として載っていました。
Windows7でSysprepを行うにはWindows Media Player Network Sharing Serviceを停止する必要があります。
これでかなり悩んだ・・・
また、応答ファイルを使用せずにSysprepをかけると追加したドライバなどが外れます。更にSysprepは3回まで可能ですが、それを回避する設定を行います。
ではここから応答ファイルの作成です。
System Image Manager を起動し、Windows 7 Enterprise カタログをISOイメージから選択します。
まずはRearmの処理を行います。
http://support.microsoft.com/kb/929828/ja
こちらが参考ページ
そして、これはWindows7では必ずやっておかないとはまる設定。この設定を行わないと、Sysprepを実行後に追加したドライバーが削除されてしまいます。
ロケールの設定
ディスプレイの設定
ローカルAdministratorのパスワード設定
OOBEセットアップ部分
・HomeEULAPage:使用許諾契約を表示しない(自動的に許諾する)
・NetworkLocation:コンピュータの場所(家庭-Home、職場-Work、公共の場所-Other)
・ProtectYourPC:自動更新の設定(推奨設定は1)
・SkipMachineOOBE:コンピュータ名の入力画面のスキップ
・SkipUserOOBE:デフォルトユーザー名の入力画面のスキップ
ここの設定をしても動作が怪しいです。特にNetworkLocationは設定してあるにもかかわらず聞いてきました。
オートログオンで使用するアカウントのパスワード
ここの設定をしておけば、administratorアカウントが有効になります
ここでタイムゾーンや組織名などの入力。2バイト文字は使用できませんので注意が必要。
もしオートログオンでadministratorを有効にしないのならば、ローカルアカウントを作ってadministratorsグループに入れておきましょう。
ドメインに参加させるにはここに入力
ここも忘れずに
オートログオンでドメインを登録。ちなみにログオンカウントを2回にしておきます。理由はドメインに参加後にコンピューターアカウント名の変更を行いリブートするからです。
ここで、ドメイン参加後のバッチの登録
setlocal set /p num=番号: net user administrator /active:yes wmic ComputerSystem WHERE "name = '%computername%' " Call Rename "Win7-%num%" endlocal shutdown /r /t 0
これがコンピューター名変更バッチファイル
実は、ドメインに参加させると、ローカルのadministratorが無効になるのでそれを有効化させてもいます。
ワークグループ用は
[xml]
<pre><?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-Security-Licensing-SLC" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
<component name="Microsoft-Windows-PnpSysprep" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>0411:00000411</InputLocale>
<SystemLocale>ja-JP</SystemLocale>
<UILanguage>ja-JP</UILanguage>
<UserLocale>ja-JP</UserLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Display>
<ColorDepth>32</ColorDepth>
<DPI>120</DPI>
<HorizontalResolution>1024</HorizontalResolution>
<RefreshRate>60</RefreshRate>
<VerticalResolution>768</VerticalResolution>
</Display>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>1</ProtectYourPC>
<SkipMachineOOBE>true</SkipMachineOOBE>
<SkipUserOOBE>true</SkipUserOOBE>
</OOBE>
<AutoLogon>
<Password>
<Value>UABhACQAJAB3ADAAcgBkAFAAYQBzAHMAdwBvAHIAZAA=</Value>
<PlainText>false</PlainText>
</Password>
<Username>administrator</Username>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
</AutoLogon>
<TimeZone>Tokyo Standerd Time</TimeZone>
<RegisteredOwner>Learning Solution</RegisteredOwner>
<RegisteredOrganization>Edifist Learning</RegisteredOrganization>
<ShowWindowsLive>false</ShowWindowsLive>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog:f:/sources/install_windows 7 enterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend></pre>
ドメイン参加用は
<pre><?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-Security-Licensing-SLC" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
<component name="Microsoft-Windows-PnpSysprep" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>0411:00000411</InputLocale>
<SystemLocale>ja-JP</SystemLocale>
<UILanguage>ja-JP</UILanguage>
<UserLocale>ja-JP</UserLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Display>
<ColorDepth>32</ColorDepth>
<DPI>120</DPI>
<HorizontalResolution>1024</HorizontalResolution>
<RefreshRate>60</RefreshRate>
<VerticalResolution>768</VerticalResolution>
</Display>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>1</ProtectYourPC>
<SkipMachineOOBE>true</SkipMachineOOBE>
<SkipUserOOBE>true</SkipUserOOBE>
</OOBE>
<AutoLogon>
<Password>
<Value>UABhACQAJAB3ADAAcgBkAFAAYQBzAHMAdwBvAHIAZAA=</Value>
<PlainText>false</PlainText>
</Password>
<Username>administrator</Username>
<Enabled>true</Enabled>
<LogonCount>2</LogonCount>
<Domain>fabrikam.com</Domain>
</AutoLogon>
<TimeZone>Tokyo Standerd Time</TimeZone>
<RegisteredOwner>Learning Solution</RegisteredOwner>
<RegisteredOrganization>Edifist Learning</RegisteredOrganization>
<ShowWindowsLive>false</ShowWindowsLive>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>c:name.bat</CommandLine>
<RequiresUserInput>true</RequiresUserInput>
<Order>1</Order>
</SynchronousCommand>
</FirstLogonCommands>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Identification>
<Credentials>
<Domain>fabrikam.com</Domain>
<Password>Pa$$w0rd</Password>
<Username>administrator</Username>
</Credentials>
<JoinDomain>fabrikam.com</JoinDomain>
</Identification>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog:f:/sources/install_windows 7 enterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend></pre>
[/xml]
となりました。
後は、出来上がった応答ファイルをコピーして
sysprep /generalize /oobe /shutdown /unattend:c:unattend.xml
コマンドを実行すればOK
IME2010を使用している場合は次のサイトも参考になります。
http://remarque.blog50.fc2.com/blog-entry-117.html
数十種の機種で7のイメージを作ってますが、
Windows Media Player Network Sharing Serviceを停止しなくとも、
「コンピュータのsysprepを実行中に致命的なエラー~」
このエラーが出たことがありません。
Sysprepの回数制限を知らない時は出ましたが。
>また、応答ファイルを使用せずにSysprepをかけると追加したドライバなどが外れます。
これもIntel HD GraphicsとAccelerometerP11は外れてしまいますが、
他のドライバは外れたことがありません。
環境による違いということでしょうかね?
仕様機種:2007年~2012年のDELL製PC(ノート、デスク共)、同年代のFMVノート数種
OS:Win7HP、Pro、Ultiの各x86、x64
こればかりは、おっしゃるとおり環境による違いとしか言えませんね。こちらに書いたことは実際に私が体験したことなので、このようなこともありますよと捉えていただき、同じトラブルがあった際には参考になれば幸いです。
はじめまして。普段から記事を読ませて頂き、大変参考にさせて頂いています。
Windows7のSysprep応答ファイルについて勉強しているところなのですが、
Skiprearmの設定において、
【Microsoft-Windows-Security-Licensing-SLC】のコンポーネントを利用されていますが、
Microsoftでは『Windows7』から【Microsoft-Windows-Security-SPP】を推奨する旨の記載をしているページを幾つか見かけました。
※【Microsoft-Windows-Security-Licensing-SLC】の方はVista(とXP?)までが推奨のようです。
■1カ所目→ 本記事の「http://support.microsoft.com/kb/929828/ja」にある、「次のテキストは Windows 7 の XML 応答ファイルの一例です。」という所
■2カ所目→ 「http://msdn.microsoft.com/ja-jp/library/ff715480.aspx」にある「重要」欄の英文
しかしながら、Windows7でも【Microsoft-Windows-Security-Licensing-SLC】を使ってSkiprearmを有効化できる様ですね。
来年にはWindows9も出るので今更感はありますが恐れながら情報共有まで。。
失礼いたしました。