One of the new features with Windows Server 2016 is the Nested Virtualization. It means that you can run a VM inside a Virtual Machine. So you also can run an ESXi inside a Hyper-V Virtual Machine. It can be useful only in a testing environment because it is really not supported in production!

Basically, to install ESXi in a Hyper-V Virtual Machine, below are the steps:

Protect Your Data with BDRSuite

Cost-Effective Backup Solution for VMs, Servers, Endpoints, Cloud VMs & SaaS applications. Supports On-Premise, Remote, Hybrid and Cloud Backup, including Disaster Recovery, Ransomware Defense & more!
  1. Download and install PowerCLI
  2. Download ESXi-Customizer-PS. It is a PowerShell script that will simplify and automate the process of creating fully patched and customized ESXi installation ISOs using the VMware PowerCLI ImageBuilder module. You can download it from http://www.v-front.de/p/esxi-customizer-ps.html
  3. Create Hyper-V VM with a Legacy Network Adapter
  4. Configure the adapter with Mac Spoofing enabled
  5. Use the customizer to download and rebuild the ESXi ISO
  6. Mount the newly created ISO inside the Virtual Machine
  7. Download and run the “Enable-NestedVM.ps1” script. Download it from: https://github.com/Microsoft/Virtualization-Documentation/blob/master/hyperv-tools/Nested/Enable-NestedVm.ps1
  8. And then, you can install ESXI 6.0

The only prerequisites to run these steps is that you must have a Hyper-V Host running Windows Server 2016 or Windows 10 with an Intel processor with VT-x and EPT technology.

Preparing ESXi 6.0 ISO

Let’s start by downloading and installing PowerCLI. A few weeks ago, VMware published VMware PowerCLI on the PowerShell Gallery. So in this article, I will install VMware.PowerCLI 10.0.0.7895300 via the following PowerShell command. Don’t forget to open an elevated prompt:

PS> Install-Module -Name VMware.PowerCLI

Download Banner

Hyper-V-Virtual-Machine

Wait a moment until the installation finishes. Once the installation is done, you can run the customizer script:

Hyper-V-Virtual-Machine

The script will download the ESXi 6.0 ISO from the VMware online depot and customize it by injecting drivers:

    Use the –v60 parameter for ESXi 6.0 but you can use the -v65 parameter for ESXi 6.5
  • Use the –vft parameter to connect to the V-Front Online Depot
  • Use net-tulip in order to load DECchip 21140 Ethernet driver inside the ISO. This driver allows running ESXi as a VM under Microsoft Hyper-V

Hyper-V-Virtual-Machine

Once the ISO is downloaded, you can check if the file exists in the current directory.

Hyper-V-Virtual-Machine

Creating the Virtual Machine

Now we can create the Virtual Machine for our ESXi. That’s pretty simple, you just need to create a 1st Gen Virtual Machine:

Hyper-V-Virtual-Machine

Click Next and:

  1. Enter a Virtual Machine name
  2. Browse to the location in which the Virtual Machine will be stored

Hyper-V-Virtual-Machine

Select the first choice “Generation 1” and click Next

Hyper-V-Virtual-Machine

Specify the amount of memory to allocate to this Virtual Machine

Hyper-V-Virtual-Machine

Don’t connect the network because we must remove the default adapter and then create a new one. The newly adapter will be a legacy adapter.

Hyper-V-Virtual-Machine

Select “Create a virtual hard disk”

Hyper-V-Virtual-Machine

Now you can mount the ESXi ISO file

Hyper-V-Virtual-Machine

Review the information and validate the wizard by clicking Finish

Hyper-V-Virtual-Machine

Ok now, I successfully created the ESXi VM but before starting this Virtual Machine, I must modify the settings.

Hyper-V-Virtual-Machine

Right-click the Virtual Machine and select “Settings”

Hyper-V-Virtual-Machine

Modify the number of virtual processors. I will configure 2 processors for this VM.

Hyper-V-Virtual-Machine

Then remove the default network adapter

Hyper-V-Virtual-Machine

Add a Legacy Network Adapter and connect to your Hyper-V Virtual Switch in order to communicate with the internet or with your LAN.

Hyper-V-Virtual-Machine

Enabling Nested Virtualization

This step is very simple, because we just need to run the “Enable-NestedVm.ps1” script:

Hyper-V-Virtual-Machine

Note: Don’t forget to enable Mac Address Spoofing.

Starting and configuring the ESXi Virtual Machine

Here is the final step. Start the Virtual Machine and add the following command to the boot options:

ignoreHeadless=TRUE

Hyper-V-Virtual-Machine

Wait a few seconds until the installation is finished. Once it’s done, your ESXi is installed in a Hyper-V Virtual Machine and ready to be used.

Hyper-V-Virtual-Machine

Conclusion

Thanks to Windows Server 2016 and the Nested Virtualization, you can easily install ESXi in a Hyper-V Virtual Machine which is great to test a new ESXi version.

Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.

3.7/5 - (3 votes)