Member-only story

Azure Nested Virtualization — Internet Connection

Sarah Lean
2 min readApr 6, 2023

--

Building a lab environment to simulate certain scenarios or get hands-on experience with technology can be really useful.

Years ago we used to invest in physical lab environments for home use, but these days you can use Azure as that lab environment. And with nested virtualization capabilities building a Hyper-V lab is feasible.

Below I walk you through the process of setting up the networking within your Azure virtual machine for that nested virtualisation scenario.

Requirements:

  • Windows Server 2022 build 20348 or later
  • Enabled Hyper-V Role
  • PowerShell

Setup Hyper-V NAT Switch

The first step is to create a new Hyper-V virtual switch. The virtual switch allows virtual machines created on Hyper-V hosts to communicate with other computers. The following PowerShell command will create the virtual switch.

New-VMSwitch –SwitchName “NATSwitch” –SwitchType Internal

Now we have the virtual switch set up we need to configure the virtual network adapter. The virtual network adapter enables communications between virtual machines through the virtual switch. The following PowerShell command will set up the virtual network adapter.

New-NetIPAddress –IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceAlias "vEthernet (NATSwitch)"

--

--

Sarah Lean
Sarah Lean

Written by Sarah Lean

Community Speaker — Lifelong Learner — Founder of the Glasgow Azure User Group

No responses yet