Enable and Use Nested Virtualization VMware ESXi

Enable and Use Nested Virtualization VMware ESXi

Reading Time: 3 minutes

Nested virtualization is the practice of running a virtual machine inside another virtual machine. Virtualization technology has come a long way in the past decade. Nowadays, we can create entire virtual environments on a single, physical host.

Much like any virtual environment, nested virtualization works on the same principle, i.e., you create a virtual server on a physical server, install ESXi hypervisor, and run another hypervisor inside the ESXi host hypervisor.

While this might initially sound perplexing, it’s not that complicated to enable nested virtualization on a VMware ESXi host. Testing and learning are the most common reasons for nested virtualization’s widespread use. In most cases, virtualization experts run a different hypervisor inside the host hypervisor.

We’ve discovered that the most common nested hypervisor in ESXi hosts is Hyper-V. However, you can try nested virtualization with any other hypervisor, such as VirtualBox, Xen, RedHat, etc.

This guide will explain how to enable and use nested virtualization in VMware ESXi hosts. So with that said, let’s begin.

What is Nested Virtualization?

Nested virtualization means running a hypervisor inside a host hypervisor. Most commonly, nested virtualization support type 1 hypervisor to host other hypervisors. A type 1 hypervisor runs directly on the physical server’s hardware. An example of a type 1 hypervisor is VMware vSphere ESXi or Hyper-V.

You can set up both hypervisors on a physical host, where the host shares the underlying physical hardware, and then install another hypervisor. However, nested virtualization doesn’t support all forms of hypervisor-hypervisor relationships.

For example, you can’t run a nested ESXi inside a host ESXi. Therefore, nested virtualization is limited in this regard. On the other hand, you can run Hyper-V inside VMware Workstation. So right out the bat, you need to determine if the hypervisor host/guest combination supports nested virtualization.

The following combinations do not support nested virtualization. However, you can still technically run it, albeit it will lack any sort of support if you run into issues:

  • VMware ESXi inside VMware Workstation;
  • VMware ESXi inside VMware Fusion;
  • VMware ESXi inside VMware ESXi;
  • VMware ESXi inside other third-party hypervisors.

How to Enable Nested Virtualization in ESXi?

Although running nested ESXi inside an ESXi host isn’t supported, you can still do it. Here are the steps how to enable nested virtualization support for ESXi/ESXi nested virtualization:

  • Upload the ESXi installer ISO file to the virtual machine datastore. We will use the ISO file to create new virtual machines in our nested environment;
  • Create a new virtual machine with ESXi installed;
  • On the hardware end, the new virtual machine running must have several features installed;
  • In the CPU screen, allow hardware-assisted virtualization;
  • Next, enable I/O MMU;
  • Since VMware supports memory ballooning, feel free to allow the nested VM running ESXi enough virtual RAM;
  • Add 2 to 4 NICs;
  • Create a standard port group for VLANs and give access to NICs to all VLANs;
  • Select the ESXi installer and connect it to the CD/DVD;
  • Make sure to select boot settings as Normal/Legacy. ESXi doesn’t support UEFI-based BIOS installation;
  • Install the VMware VM ESXi. Go over the installation wizard and finish the setup.

With these steps, you have now successfully created an ESXi VM inside another ESXi host. The VMware hypervisor doesn’t support this form of nested virtualization, but it is possible to create it. The newly created VM will run on a Windows server and come with VMware tools installed for greater control.

Use Cases for Nested Virtualization

With that said, what are the use cases for nested virtualization? Are there any benefits to going one layer deeper into virtualization, or does all of this only take inspiration from Inception?

Despite thinking that nested virtualization somehow exposes the flaws of virtualization, there are, in fact, real benefits to this type of virtualization solution. As such, here are the use cases for nested virtualization:

  • Creating a Testing Environment

In general, one of the most common use cases for nested virtualization is the ability to test various build specifications. No matter the build you’re testing, nested VMs are replaceable and easily replicable.

  • Showcasing Demos

Despite the low cost of virtualization, you can showcase your demo in a nested environment with little to no effort. Suppose you want to deploy a demo on-site for customers to show its features and capabilities. You can easily replicate a guest hypervisor inside another hypervisor.

  • Isolating Environments

With nested virtualization, you dive deeper into isolating the VMs via an isolated virtual network. This means you can fully experiment on the VMs without fearing the experiments backfiring on your virtual network.

Conclusion

Nested virtualization isn’t new, and its use will become more widespread. VMware nested virtualization makes it possible to run virtual machines inside another virtual machine by installing VMware vSphere VMs on top of another VMware hypervisor.

Given the use cases of VMware nested virtualization, you now know how to run ESXi VMs inside an ESXi host.