USB メモリから起動できる Hyper-V Server 2012 Release Candidate を 作成する
Windows 8 の Release Preview と同時に Hyper-V Server 2012 についてもリリースされているので、手軽な Hyper-V 検証環境として USB メモリから起動できる Hyper-V Server 2012 を作ってみました。
Hyper-V Server については、2008 R2 に続き 2012 でもUSB起動がサポートされているようで安心しました。USBメモリも以前、2008 R2 の時に作ったものを使いまわしたのですが、16 GByte のUSBメモリでも動作します。
基本的に手順は以前と同じです。マイクロソフトの Hyper-V Server 2008 R2 の手順を参考に、カスタマイズしました。
Deploying Microsoft Hyper-V Server 2008 R2 on USB Flash Drive
http://technet.microsoft.com/en-us/library/ee731893(WS.10).aspx
今回チャレンジで手順に2つの変更をしてみたのですが、うまく行きませんでした。
- VHDを可変ディスクにする。
→固定ディスクでは無いと起動できませんでした。Hyper-V Server では固定ディスクを指定する必要があるようです。
→ブートマネージャの書き込みに失敗。100MByteくらいは余裕を空けておいた方が良いようです。
ということで、結局は以前どおりの手順で無難に進めました。
必要な材料
・Windows Automated Installation Kit for Windows 7
・Hyper-V Server 2012 Release Candidate
・16GByte の USB メモリ(あらかじめNTFSでフォーマットし、ディスクの管理ツールでアクティブとしてマークしておきます)
Amazonで以下のUSBメモリを購入してやってみました。
BUFFALO USB3.0/2.0用 USBメモリー ホワイト 16GB RUF3-K16G-WH
作業環境
・Windows 7 (私は、Windows 7 Ultimate 32bit で実施しました)
・ダウンロードしたWindows Automated Installation Kit for Windows 7やHyper-V Server 2008 R2 SP1はISOファイルなのでドライブにマウントできるソフトをあらかじめインストールしておいてください。
・作業には、3つのドライブレターを使います。E:\(Hyper-v 2008 R2 SP1 のISOマウント用)R:\(Hyper-v編集用)Z:\(USB用)
まず、最初にWindows Automated Installation Kit for Windows 7 をインストールします。
次にコマンドラインからコマンドを実行していきます、以下はUSB メモリを作成した際のコマンドラインのログです。所要時間は、だいたい1時間ほど。フォーマットやファイルのコピーなどに時間が掛かるので何かの片手間にすると良いと思います。
途中で以下のようなダイアログが表示されますが、必要ないので×ボタンを押して閉じてください。
C:\>diskpartMicrosoft DiskPart バージョン 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
コンピューター: tekk-PCDISKPART> create vdisk file="C:\Users\tekk\AppData\Local\Temp\tmp8099.vhd" maximum=14338 type=fixed
100% 完了しました
DiskPart により、仮想ディスク ファイルが正常に作成されました。
DISKPART> select vdisk file="C:\Users\tekk\AppData\Local\Temp\tmp8099.vhd"
DiskPart により、仮想ディスク ファイルが選択されました。
DISKPART> attach vdisk
100% 完了しました
DiskPart により、仮想ディスク ファイルがアタッチされました。
DISKPART> create partition primary
DiskPart は指定したパーティションの作成に成功しました。
DISKPART> assign letter=H
DiskPart はドライブ文字またはマウント ポイントを正常に割り当てました。
DISKPART> format quick fs=ntfs label=hyperV
100% 完了しました
DiskPart は、ボリュームのフォーマットを完了しました。
DISKPART> exit
DiskPart を終了しています...
C:\>"C:\Program Files\Windows AIK\Tools\x86\imagex.exe" /apply "E:\sources\install.wim" 1 H:\
ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7600.16385
[ 100% ] Applying progress
Successfully applied image.
Total elapsed time: 7 min 25 sec
C:\>dism.exe /image:H: /Set-AllIntl:ja-JP
展開イメージのサービスと管理ツール
バージョン: 6.1.7600.16385イメージのバージョン: 6.2.8400.0
入力ロケールが次に設定されました: ja-JP
システム ロケールが次に設定されました: ja-JP
ユーザー ロケールが次に設定されました: ja-JP
UI 言語が次に設定されました: ja-JP
操作は正常に完了しました。C:\>dism.exe /image:H: /Set-LayeredDriver:6
展開イメージのサービスと管理ツール
バージョン: 6.1.7600.16385イメージのバージョン: 6.2.8400.0
操作は正常に完了しました。
C:\>diskpart
Microsoft DiskPart バージョン 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
コンピューター: tekk-PCDISKPART> select vdisk file="C:\Users\tekk\AppData\Local\Temp\tmp8099.vhd"
DiskPart により、仮想ディスク ファイルが選択されました。
DISKPART> detach vdisk
DiskPart により、仮想ディスク ファイルがデタッチされました。
DISKPART> exit
DiskPart を終了しています...
C:\>robocopy.exe "C:\Users\tekk\AppData\Local\Temp" Z:\ "tmp8099.vhd"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
ROBOCOPY :: Windows の堅牢性の高いファイル コピー
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
開始: Sun Jun 03 09:20:21 2012
コピー元 : C:\Users\tekk\AppData\Local\Temp\
コピー先 : Z:\
ファイル: tmp8099.vhd
オプション: /COPY:DAT /R:1000000 /W:30
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
1 C:\Users\tekk\AppData\Local\Temp\
100% 新しいファイル 14.0 g tmp8099.vhd
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
合計 コピー済み スキップ 不一致 失敗
Extras
ディレクトリ: 1 0 1 0 0 0
ファイル: 1 1 0 0 0 0
バイト: 14.001 g 14.001 g 0 0 0 0
時刻: 0:24:07 0:24:07 0:00:00 0:00:00
速度: 10383719 バイト/秒
速度: 594.161 MB/分
終了: Sun Jun 03 09:44:29 2012
C:\>"C:\Program Files\Windows AIK\Tools\PETools\x86\bootsect.exe" /nt60 Z: /force /mbr
Target volumes will be updated with BOOTMGR compatible bootcode.
Z: (\\?\Volume{ec963046-647e-11e1-b8f5-001e4cf5cb47})
Successfully updated NTFS filesystem bootcode.
\??\PhysicalDrive1
Successfully updated disk bootcode.
Bootcode was successfully updated on all targeted volumes.
C:\>diskpart
Microsoft DiskPart バージョン 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
コンピューター: tekk-PC
DISKPART> select vdisk file="Z:\tmp8099.vhd"
DiskPart により、仮想ディスク ファイルが選択されました。
DISKPART> attach vdisk
100% 完了しました
DiskPart により、仮想ディスク ファイルがアタッチされました。
DISKPART> exit
DiskPart を終了しています...
C:\>"C:\Program Files\Windows AIK\Tools\x86\bcdboot.exe" H:\windows /s Z:
Boot files successfully created.
C:\>reg.exe load HKLM\HyperVTemp H:\windows\system32\config\system
この操作を正しく終了しました。
C:\>reg.exe add "HKLM\HyperVTemp\ControlSet001\Control\Session Manager\Memory Ma
nagement" /v PagingFiles /t REG_MULTI_SZ /d "" /f
この操作を正しく終了しました。
C:\>reg.exe delete "HKLM\HyperVTemp\ControlSet001\Control\Session Manager\Memory
Management" /v ExistingPageFiles /f
この操作を正しく終了しました。
C:\>reg.exe unload HKLM\HyperVTemp
この操作を正しく終了しました。
C:\>diskpart
Microsoft DiskPart バージョン 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
コンピューター: tekk-PC
DISKPART> select vdisk file="Z:\tmp8099.vhd"
DiskPart により、仮想ディスク ファイルが選択されました。
DISKPART> detach vdisk
DiskPart により、仮想ディスク ファイルがデタッチされました。
DISKPART> exit
DiskPart を終了しています...