You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Enable nested virtualization on a template VM in Azure Lab Services | Microsoft Docs
3
-
description: Learn how to Enable nested virtualization on a template VM in Azure Lab Services.
3
+
description: Learn how to create a template VM with multiple VMs inside. In other words, enable nested virtualization on a template VM in Azure Lab Services.
4
4
services: lab-services
5
5
documentationcenter: na
6
6
author: spelluru
@@ -17,59 +17,79 @@ ms.author: spelluru
17
17
18
18
---
19
19
# Enable nested virtualization on a template virtual machine in Azure Lab Services
20
-
This article covers how to set up nested virtualization on a template virtual machine in Azure Lab Services. Nested virtualization is used in Azure Lab Services when each student in a class requires multiple machines.
21
-
20
+
21
+
Currently, Azure Lab Services enables you to set up one template virtual machine in a lab and make a single copy available to each of your users. If you are a professor teaching networking, security, or IT classes, you may need to provide each of your students with an environment in which multiple virtual machines can talk to each other over a network.
22
+
23
+
Nested virtualization enables you to create a multi-VM environment inside a lab’s template virtual machine. Publishing the template will provide each user in the lab with a virtual machine set up with multiple VMs within it. This article covers how to set up nested virtualization on a template machine in Azure Lab Services.
24
+
25
+
## What is nested virtualization?
26
+
27
+
Nested virtualization enables you to create virtual machines within a virtual machine. Nested virtualization is done through Hyper-V, and is only available on Windows VMs.
28
+
29
+
For more information about nested virtualization, see the following articles:
30
+
31
+
-[Nested Virtualization in Azure](https://azure.microsoft.com/blog/nested-virtualization-in-azure/)
32
+
-[How to enable nested virtualization in an Azure VM](../../virtual-machines/windows/nested-virtualization.md)
33
+
22
34
## Considerations
35
+
23
36
Before setting up a lab with nested virtualization, here are a few things to take into consideration.
24
37
25
-
- When creating a new lab, select **Medium (Nested Virtualization)** or **Large** sizes for the virtual machine size. These virtual machine sizes support nested virtualization.
38
+
- When creating a new lab, select **Medium (Nested virtualization)** or **Large (Nested virtualization)** sizes for the virtual machine size. These virtual machine sizes support nested virtualization.
26
39
- Choose a size that will provide good performance for both the host and client virtual machines. Remember, when using virtualization, the size you choose must be adequate for not just one machine, but the host as well as any client machines that must be run concurrently.
27
40
- Client virtual machines will not have access to Azure resources, such as DNS servers on the Azure virtual network.
28
-
- Host virtual machine requires setup to allow for the client machine to have internet connectivity.
41
+
- Host virtual machine requires setup to allow for the client machine to have internet connectivity.
29
42
- Client virtual machines are licensed as independent machines. See [Microsoft Licensing](https://www.microsoft.com/licensing/default) for information about licensing for Microsoft operation systems and products. Check licensing agreements for any other software being used before setting up the template machine.
30
43
31
44
## Enable nested virtualization on a template VM
32
-
The steps in this section focus on setting up nested virtualization for Windows Server 2016 or Windows Server 2019. You will use a script to set up template machine with Hyper-V. For an automated solution, see scripts at [Lab Services Hyper-V Scripts](https://github.com/Azure/azure-devtestlab/tree/master/samples/ClassroomLabs/Scripts/HyperV). The following steps will walk you through how to use the script.
33
45
34
-
1. If you're using Internet Explorer, you may have to add `https://github.com` to the trusted sites list.
46
+
This article assumes that you have created a lab account and lab. For more information about creating a new lab account, see [tutorial to set up a Lab Account](tutorial-setup-lab-account.md). For more information how to create lab, see [set up a classroom lab tutorial](tutorial-setup-classroom-lab.md).
47
+
48
+
>[!IMPORTANT]
49
+
>Select **Large (nested virtualization)** or **Medium (nested virtualization)** for the virtual machine size when creating the lab. Nested virtualization will not work otherwise.
50
+
51
+
To connect to the template machine, see [create and manage a classroom template](how-to-create-manage-template.md).
52
+
53
+
The steps in this section focus on setting up nested virtualization for Windows Server 2016 or Windows Server 2019. You will use a script to set up template machine with Hyper-V. The following steps will guide you through how to use the [Lab Services Hyper-V scripts](https://github.com/Azure/azure-devtestlab/tree/master/samples/ClassroomLabs/Scripts/HyperV).
54
+
55
+
1. If you're using Internet Explorer, you may have to add `https://github.com` to the trusted sites list.
35
56
1. Open Internet Explorer.
36
57
1. Select the gear icon, and choose **Internet options**.
37
58
1. When the **Internet Options** dialog appears, select **Security**, select **Trusted Sites**, click **Sites** button.
38
59
1. When the **Trusted sites** dialog appears, add `https://github.com` to the trusted websites list, and select **Close**.
1.Download the Git repository files as outlined in the following steps. Alternatively, the Git repository can be cloned from [https://github.com/Azure/azure-devtestlab.git](https://github.com/Azure/azure-devtestlab.git).
62
+
1. Download the Git repository files as outlined in the following steps.
42
63
1. Go to [https://github.com/Azure/azure-devtestlab/](https://github.com/Azure/azure-devtestlab/).
43
-
1. Click the ***Clone or Download** button.
64
+
1. Click the **Clone or Download** button.
44
65
1. Click **Download ZIP**.
45
66
1. Extract the ZIP file
67
+
68
+
>[!TIP]
69
+
>You can also clone the Git repository at [https://github.com/Azure/azure-devtestlab.git](https://github.com/Azure/azure-devtestlab.git).
70
+
46
71
1. Launch **PowerShell** in **Administrator** mode.
47
72
1. In the PowerShell window, navigate to the folder with the downloaded script. If you're navigating from the top folder of the repository files, the script is located at `azure-devtestlab\samples\ClassroomLabs\Scripts\HyperV\`.
48
73
1. You may have to change the execution policy to successfully run the script. Run the following command:
49
-
74
+
50
75
```powershell
51
-
Set-ExecutionPolicy bypass -force
76
+
Set-ExecutionPolicy bypass -force
52
77
```
78
+
53
79
1. Run the script:
54
-
80
+
55
81
```powershell
56
82
.\SetupForNestedVirtualization.ps1
57
83
```
58
84
59
85
> [!NOTE]
60
86
> The script may require the machine to be restarted. Follow instructions from the script and re-run the script until **Script completed** is seen in the output.
61
-
1. Don’t forget to reset the execution policy. Run the following command:
87
+
1. Don’t forget to reset the execution policy. Run the following command:
62
88
63
89
```powershell
64
90
Set-ExecutionPolicy default -force
65
91
```
66
92
67
93
## Conclusion
68
-
Now your template machine is ready to create Hyper-V virtual machines. See [Create a Virtual Machine in Hyper-V](/windows-server/virtualization/hyper-v/get-started/create-a-virtual-machine-in-hyper-v) for instructions on how to create Hyper-V virtual machines. Also, see [Microsoft Evaluation Center](https://www.microsoft.com/evalcenter/) to check out available operating systems and software.
69
94
70
-
## Next steps
71
-
See the following articles:
72
-
73
-
- [How to enable nested virtualization in an Azure VM](../../virtual-machines/windows/nested-virtualization.md)
74
-
- [Install the Hyper-V role on Windows Server](/windows-server/virtualization/hyper-v/get-started/install-the-hyper-v-role-on-windows-server)
Now your template machine is ready to create Hyper-V virtual machines. See [Create a Virtual Machine in Hyper-V](/windows-server/virtualization/hyper-v/get-started/create-a-virtual-machine-in-hyper-v) for instructions on how to create Hyper-V virtual machines. Also, see [Microsoft Evaluation Center](https://www.microsoft.com/evalcenter/) to check out available operating systems and software.
0 commit comments