{"componentChunkName":"component---src-templates-post-template-js","path":"/azure-cannot-use-hyperv-en","result":{"data":{"markdownRemark":{"id":"b16c1fcd-e7ad-5ada-9432-ced679290b92","html":"<blockquote>\n<p>This page has been machine-translated from the <a href=\"/azure-cannot-use-hyperv\">original page</a>.</p>\n</blockquote>\n<h2 id=\"introduction\" style=\"position:relative;\"><a href=\"#introduction\" aria-label=\"introduction permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Introduction</h2>\n<p>This article is about <strong>how to resolve a problem where a virtual machine created with Hyper-V stops starting on a Windows OS running on an Azure virtual machine</strong>.</p>\n<p>The other day, when I tried to start a Linux machine on Hyper-V on Windows 10 running as an Azure VM, the following error message appeared and it would not start.</p>\n<p><code class=\"language-text\">Failed to start the virtual machine 'MACHINE' because one of the Hyper-V components is not running.</code></p>\n<p>In conclusion, <strong>if you want to use Hyper-V on an Azure VM, you need to choose a size that provides a CPU with support for “nested virtualization”</strong>, and it started successfully once I selected <code class=\"language-text\">Standard D4s_v4</code>.</p>\n<h2 id=\"cause-of-the-problem\" style=\"position:relative;\"><a href=\"#cause-of-the-problem\" aria-label=\"cause of the problem permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Cause of the Problem</h2>\n<p>The cause of the problem above was that support for Hyper-V nested virtualization was not available.</p>\n<p>To begin with, it seems there are various restrictions when you want to run yet another virtual machine with Hyper-V on top of a virtual machine that was itself created with Hyper-V.<br>\nAfter checking the documentation, I found the following limitations.</p>\n<blockquote>\n<p>Both the Hyper-V host and guest must be Windows Server 2016 / Windows 10 Anniversary Update or later. There are also some differences in the virtual network for second-level virtual machines.\n<a href=\"https://docs.microsoft.com/ja-jp/virtualization/hyper-v-on-windows/user-guide/nested-virtualization\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Nested virtualization | Microsoft Docs</a></p>\n</blockquote>\n<p>The reason for these restrictions is that Hyper-V depends on the CPU’s hardware virtualization features.<br>\nHyper-V uses CPU features such as Intel VT-x and AMD-V.</p>\n<p>These CPU features are used exclusively, so if Hyper-V is using them, other software normally cannot use them.</p>\n<p>Because of that, <strong>on a virtual machine running on top of Hyper-V, you normally cannot use those CPU features to do even more virtualization</strong>.<br>\n(As far as I could tell, other VM software and VirtualBox also use these features, so they probably cannot use them either.)</p>\n<p>However, with Hyper-V, enabling support for nested virtualization seems to make it possible to virtualize the CPU features themselves, which in turn lets you build virtual machines with Hyper-V in multiple layers.</p>\n<p>Looking back at the issue this time, it is easy to forget, but <strong>the instances used by Azure’s VM service are already virtualized with Hyper-V in the first place</strong>.</p>\n<p>In other words, <strong>using Hyper-V on an Azure VM is effectively doing another round of Hyper-V-based virtualization inside a machine that is already virtualized with Hyper-V</strong>.</p>\n<p>Within Azure’s VM service, only <strong>specific virtual machine sizes</strong> support this nested virtualization.</p>\n<p>I found information about support for nested virtualization in Azure’s VM service in the following article.  </p>\n<p><a rel=\"noopener\" href=\"https://docs.microsoft.com/ja-jp/azure/virtual-machines/windows/nested-virtualization\" target=\"_blank\">How to enable nested virtualization in Azure Virtual Machines - Azure Virtual Machines | Microsoft Docs</a></p>\n<p>I also found the list of Azure VM sizes that can use nested virtualization here.  </p>\n<p><a rel=\"noopener\" href=\"https://docs.microsoft.com/en-us/azure/virtual-machines/acu\" target=\"_blank\">Overview of the Azure Compute Unit - Azure Virtual Machines | Microsoft Docs</a></p>\n<p>That page includes the following note.</p>\n<p><code class=\"language-text\">Hyper-threaded and capable of running nested virtualization</code></p>\n<p>It looks like this <code class=\"language-text\">Hyper-threaded</code> entry is related to the mechanism that makes nested virtualization possible. (I’m not entirely sure.)</p>\n<p>As a result, recreating the virtual machine with <code class=\"language-text\">Standard D4s_v4</code>, a 16 GB memory size that can use the <code class=\"language-text\">Hyper-threaded</code> feature above, fixed the problem.</p>\n<h2 id=\"summary\" style=\"position:relative;\"><a href=\"#summary\" aria-label=\"summary permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Summary</h2>\n<p>As described above, the cause of this issue was that I had created the virtual machine using a resource size that does not support nested virtualization.</p>\n<p>While identifying the cause and getting to the solution, I had tried several other things along the way.</p>\n<p>In particular, deleting the Hyper-V virtual machine and rebuilding it took a huge amount of time and effort, so I really wish I had not done that lol<br>\nI got the impression that my lack of understanding about virtualization and CPU features, and about the problems that can happen when you build another virtual machine on top of a virtual machine, really slowed down the troubleshooting.</p>\n<p>Even when I directly googled the error text, I could not find many useful pages, so this time I decided to write the article myself.<br>\nEventually I arrived at the idea that it was probably a CPU issue, and helpful articles came up when I searched for things like “Azure Hyper-V size” and “Azure Hyper-V CPU”.</p>\n<p>This kind of situation—where <strong>if you have the background knowledge, you can find the right search terms and solve it immediately</strong>—happens pretty often, doesn’t it?<br>\nAnyway, it reminded me once again that even when using cloud services, you still need knowledge of infrastructure and networking, so I want to study more seriously.</p>","fields":{"slug":"/azure-cannot-use-hyperv-en","tagSlugs":["/tag/azure-en/","/tag/hyper-v-en/","/tag/notes-en/","/tag/english/"]},"frontmatter":{"date":"2020-12-27","description":"This article explains how to resolve a problem where a virtual machine created with Hyper-V would no longer start on a Windows OS running on an Azure virtual machine.","tags":["Azure (en)","Hyper-V (en)","Notes (en)","English"],"title":"Why Hyper-V on an Azure VM Failed with “one of the Hyper-V components is not running” and How to Fix It","socialImage":{"publicURL":"/static/dc4d8b7f8795f3c3d3489d9957d155f2/no-image.png"}}}},"pageContext":{"slug":"/azure-cannot-use-hyperv-en"}},"staticQueryHashes":["251939775","401334301","825871152"]}