Hyper-V Server R2の唯一特別機能:USB 起動
Hyper-V Server R2 は、他のすべてのWindowsバージョンと違ってUSBドライブから起動できす。 この機能に関してサーバーOEM社だけしかサポートされていませんが、自分のUSBサムドライブを起動できるようにしたいなら、以下の情報を読んでください。
要件
· 8+ GB USBサムドライブ (USB 2.0対応必要)
· Windows Automated Installation Kit (WAIK)
· Hyper-V Server 2008 R2 DVD (ここからISOをダウンロードできます)
· Windows Vista/Win7/Server 2008/R2
ステップ0: 基本セットアップ
Windows Vista/Win7/Server 2008/R2マシンでWAIKをインストールする。32ビットか64ビット版でもOK
Hyper-V Server 2008 R2のISOをダウンロードしてDVDに焼く
USBサムドライブをマシン本体に差し込む
ステップ1: VHDを作成
mkdir c:\hvvhd
diskpart create vdisk file=c:\hvvhd\hyperV.vhd maximum=12288 type=fixed
select vdisk file=c:\hvvhd\hyperV.vhd
attach vdisk
create partition primary
assign letter=r
format quick fs=ntfs label=hyperV
exit
ステップ2: Microsoft Hyper-V Server 2008 R2イメージをVHDに適用
cd /d "c:\program files\Windows OPK\tools\<architecture>\"
imagex /apply <WIMのパス> 1 r:\
<architecture>はx86かAMD64です
<WIMのパス>はHyper-V Server R2のINSTALL.WIMファイルの場所。普通は、Hyper-V Server R2のDVDの「SOURCES」というフォルダの中にあります。
終わったら、以下のコマンドでVHDをアンマウントする
diskpart
select vdisk file=c:\hvvhd\hyperv.vhd
detach vdisk
exit
ステップ3: USBを準備
USBドライブの番号を表示するには
diskpart
list disk
USBディスク番号が分かりましたら以下のコマンドを実行する
select disk <USBディスク番号>
clean
create partition primary
select partition 1
active
format quick fs=ntfs
assign letter=z
exit
ステップ4: VHDとブートファイルをUSBにコピー
Copy <VHDのパス> <USBディスクの文字>
例:
Copy c:\hvvhd\hyperV.vhd z:
それからbootsect.exeでブートファイルをコピーするには
cd /d "c:\program files\Windows OPK\tools\PETools\<architecture>\"
bootsect /nt60 <USBディスクの文字> /force /mbr
例:
cd /d "c:\program files\Windows OPK\tools\PETools\amd64"
bootsect /nt60 z: /force /mbr
ステップ5: Boot Configuration Data(BCD)をUSBに作成
USBディスクにあるVHDをマウントする
diskpart
select vdisk file=z:\hyperv.vhd
attach vdisk
exit
マウントされたVHDにブートファイルをコピーする
bcdboot <VHDの文字>\windows /s <USBディスクの文字>
例:
bcdboot r:\windows /s z:
ステップ6: メモリPagingを無効にする
USB Flashを早く使い古さないためにメモリPagingファイルを無効した方がいいです。
reg load HKLM\HyperVTemp r:\windows\system32\config\system
reg add "HKLM\HyperVTemp\ControlSet001\Control\Session Manager\Memory Management" /v PagingFiles /t REG_MULTI_SZ /d "" /f
reg delete "HKLM\HyperVTemp\ControlSet001\Control\Session Manager\Memory Management" /v ExistingPageFiles /f
reg unload HKLM\HyperVTemp
ステップ7: VHDをアンマウントする
diskpart
select vdisk file=z:\hyperv.vhd
detach vdisk
exit
ステップ7を完成したらUSBサムドライブから起動できます。
もしろん、ホストマシンのBIOSをUSBから起動可能にする必要がありますが、Hyper-V Server 2008 R2起動可能のUSBサムドライブ準備は完了です。