このドキュメントでは、ネストされた仮想化に対する Compute Engine のサポートについて説明します。ネストされた仮想化では、他の VM 内で仮想マシン(VM)インスタンスを実行して、独自の仮想環境を作成できます。ネストされた仮想化をサポートするために、Compute Engine は VM に Intel Virtualization Technology(VT-x)命令を追加します。これにより、VM を作成すると、その VM 上にあるハイパーバイザは追加の VM を実行できるようになります。
Compute Engine VM は、Google のセキュリティ強化された KVM ベースのハイパーバイザを備えた物理ホストで実行されます。ネストされた仮想化では、物理ホストとそのハイパーバイザはレベル 0(L0)環境にあります。L0 環境には複数のレベル 1(L1)VM をホストできます。各 L1 VM には、レベル 2(L2)VM のインストールに使用するもう 1 つのハイパーバイザがあります。図 1 に、物理ホスト、L1 VM、L2 VM の関係を示します。
図 1. L0 物理ホスト、L1 VM、L2 VM の関係。
ユースケース
ネストされた仮想化の使用としては、次のようなシナリオが考えられます。
Compute Engine で実行できない VM があります。たとえば、オンプレミス ワークロードの障害復旧ソリューションが、Compute Engine VM にフェイルオーバーする VM 上で実行されているとします。ネストされた仮想化を実行すると、Compute Engine への VM の移植にかかる時間を短縮できます。
さまざまなバージョンの OS でソフトウェア パッケージの新しいバージョンのテストと検証を行うソフトウェア検証フレームワークがあります。ネストされた仮想化を使用すると、Compute Engine イメージのライブラリを変換して管理する必要がなくなります。
パフォーマンスに関する注意事項
ハードウェア補助によるネストされた仮想化であっても、ネストされた VM で CPU バウンドのワークロードを実行すると、パフォーマンスが 10% 以上低下することがあります。また、入出力バウンドのワークロードでも 10% 以上低下する可能性があります。
制限事項
L1 VM には次の制限事項があります。
L1 VM でサポートされているハイパーバイザは Linux KVM のみです。Microsoft Hyper-V はサポートされていません。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eNested virtualization in Compute Engine allows running virtual machines (VMs) inside other VMs, enabling the creation of custom virtualization environments.\u003c/p\u003e\n"],["\u003cp\u003eCompute Engine uses a security-hardened, KVM-based hypervisor at level 0 (L0), which hosts level 1 (L1) VMs, each capable of running another hypervisor for level 2 (L2) VMs.\u003c/p\u003e\n"],["\u003cp\u003eNested virtualization can be useful for running VMs incompatible with Compute Engine or for testing software on various operating systems without managing numerous Compute Engine images.\u003c/p\u003e\n"],["\u003cp\u003eNested VMs may experience a performance decrease of 10% or more, especially in CPU or input/output-bound workloads, and certain VM types are not compatible.\u003c/p\u003e\n"],["\u003cp\u003eEnabling nested virtualization involves checking constraints, creating an L1 VM with the feature enabled, and then creating the nested L2 VM.\u003c/p\u003e\n"]]],[],null,["# About nested virtualization\n\nLinux\n\n*** ** * ** ***\n\nThis document describes Compute Engine support for nested virtualization.\nNested virtualization lets you run virtual machine (VM) instances inside of\nother VMs so you can create your own virtualization environments. To support\nnested virtualization, Compute Engine adds\n[Intel Virtualization Technology (VT-x)](https://en.wikipedia.org/wiki/X86_virtualization#Intel_virtualization_(VT-x))\ninstructions to VMs, so when you create a VM, the hypervisor that is already on\nthat VM can run additional VMs.\n\nCompute Engine VMs run on a physical host that has [Google's\nsecurity-hardened, KVM-based hypervisor](https://cloud.google.com/blog/products/gcp/7-ways-we-harden-our-kvm-hypervisor-at-google-cloud-security-in-plaintext).\nWith nested virtualization, the physical host and its hypervisor are the level 0\n(L0) environment. The L0 environment can host multiple level 1 (L1) VMs. On each\nL1 VM is another hypervisor, which is used to install the level 2 (L2) VMs.\nFigure 1 shows the relationship between the physical host, the L1 VMs, and the\nL2 VMs:\n[](/static/compute/images/nested-virtualization-diagram.svg) **Figure 1.** L0 physical host with L1 VMs and L2 VMs.\n\nUse cases\n---------\n\nScenarios where you might consider using nested virtualization include the\nfollowing:\n\n- You have VMs that you can't run on Compute Engine: For example, you\n might have a disaster recovery solution for an on-premises workload that is\n running on VMs that fail over to Compute Engine VMs. Running\n nested virtualization might save you time that you would use to port\n your VMs to Compute Engine.\n\n- You have a software-validation framework that you use to test and validate new\n versions of a software package on numerous versions of different OSes: Using\n nested virtualization lets you avoid converting and managing a library of\n Compute Engine images.\n\nPerformance considerations\n--------------------------\n\nEven with hardware-assisted nested virtualization, nested VMs might experience a\n10% or greater decrease in performance for workloads that are CPU-bound and\npossibly greater than a 10% decrease for workloads that are input/output bound.\n\nRestrictions\n------------\n\nL1 VMs have the following restrictions:\n\n- The only hypervisor supported in an L1 VM is Linux KVM; Microsoft Hyper-V\n isn't supported.\n\n- You can't use the following VMs:\n\n - E2 VMs\n\n - [Memory-optimized VMs](/compute/docs/machine-resource#memory-optimized_machine_family_guide)\n\n - VMs powered by [AMD and Arm processors](/compute/docs/cpu-platforms)\n\n For information about the processors supported in each zone, see\n [Available regions and zones](/compute/docs/regions-zones#available).\n\nL2 VMs have the following restrictions:\n\n- For licensed operating systems, you must [bring your own licenses](/compute/docs/nodes/bringing-your-own-licenses).\n\nUsing nested virtualization\n---------------------------\n\nTo use nested virtualization, complete the following steps:\n\n1. [Check whether the nested virtualization constraint is\n disabled](/compute/docs/instances/nested-virtualization/managing-constraint)\n\n2. [Create an L1 VM that has nested virtualization\n enabled](/compute/docs/instances/nested-virtualization/enabling)\n\n3. [Create a nested L2\n VM](/compute/docs/instances/nested-virtualization/creating-nested-vms)\n\nIf you run into any issues while creating a VM that has nested virtualization\nenabled or creating nested VMs, see [Troubleshoot nested virtualization](/compute/docs/troubleshooting/troubleshooting-nested-vms)."]]