管理人のSE経験値(Exp)を見える化するブログ

中小企業(独立系Sier)でインフラエンジニアをしている管理人が日々の業務、自己啓発によって得た知識、経験を雑記するブログです。

Windows 10:Hyper-Vの仮想マシン上にHyper-V環境を構築する (Nested Hyper-V)

目的

Windows 10にてNested Hyper-Vを利用し、Hyper-V仮想マシン上にHyper-V環境を構築出来る様なので実際にやってみました。
個人的な備忘の為に記事を書きます。

利用条件

Hyper-Vホスト:
Windows Server 2016 or Windows 10 Anniversary Update (バージョン:1607)
Intel Processor (VT-x/EPT Technology搭載)

Hyper-V VM
Windows Server 2016 or Windows 10 Anniversary Update (バージョン:1607
・構成バージョン8.0以上のHyper-V VM


検証環境

NPC-002:Windows 10 64bit (バージョン:1607)
TESTSV-02:NPC-002上の仮想マシン/Windows Server 2016
TESTSV-03:TESTSV-02上の仮想マシン/Windows Server 2016

参考にさせて頂いたサイト

ついに実現したNested Hyper-V を体感してみる - GMOインターネット株式会社

入れ子になった仮想化


作業手順 (PowerShell)

"Enable-NestedVM.ps1"の入手


Hyper-Vホスト(検証環境としてはNPC-002)にてPowerShellを実行
・C:\Temp\にPowerShell Scriptを出力

> Invoke-WebRequest https://raw.githubusercontent.com/Microsoft/Virtualization-Documentation/master/hyperv-tools/Nested/Enable-NestedVm.ps1 -OutFile C:\Temp\Enable-NestedVm.ps1


Nested Hyper-Vの有効化


Hyper-Vホスト(検証環境としてはNPC-002)にてPowerShellを実行
Hyper-V VM(TESTSV-02)にてNested Hyper-Vを有効化

> . C:\Enable-NestedVm.ps1 -VmName "testsv-02"

This script will set the following for testsv-02 in order to enable nesting:
    Virtualization extensions will be enabled
    Dynamic memory will be disabled
    Optionally enable mac address spoofing

Input Y to accept or N to cancel:Y
Mac Address Spoofing isn't enabled (nested guests won't have network).

Would you like to enable MAC address spoofing? (Y/N)Y

作業結果

無事にHyper-V仮想マシン上にHyper-V環境を構築出来ました。
この機能のお陰で個人的な検証環境が充実しました(笑

f:id:Miyamon:20161128232437p:plain

利用環境

Windows 10 Pro 64bit (バージョン:1607)