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:
- Download and install PowerCLI
- 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
- Create Hyper-V VM with a Legacy Network Adapter
- Configure the adapter with Mac Spoofing enabled
- Use the customizer to download and rebuild the ESXi ISO
- Mount the newly created ISO inside the Virtual Machine
- 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
- 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

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

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

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

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:

Click Next and:
- Enter a Virtual Machine name
- Browse to the location in which the Virtual Machine will be stored

Select the first choice “Generation 1” and click Next

Specify the amount of memory to allocate to this 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.

Select “Create a virtual hard disk”

Now you can mount the ESXi ISO file

Review the information and validate the wizard by clicking Finish

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

Right-click the Virtual Machine and select “Settings”

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

Then remove the default network adapter

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

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

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

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.

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.
Hello,
I am trying to install ESXi on Windows 2016 on Azure platform, I followed all the instructions but ESXi could not find NIC card so installation is came to end. Could you please let me know how to fix this issues?
https://uploads.disquscdn.com/images/12dac8cae2233b6816b461891310be8a17a60d42b711b848d68328c4898fc036.jpg
Hi Jags,
I never tried to install ESXi on Azure, so not sure if it could work or not…
But I will try it when possible and let you know if it works or not.
Nicolas
@PrigentNico:disqus did you manage to make it work on Azure?
Hi
I tried to install esxi on azure but I go this error : which telling me the virtual machine management service failed to start the virtual machine because one of the hyper-v components is not running.
https://uploads.disquscdn.com/images/b87324bbe14594e76303a550303da2d4b3bf4182ecb75b581b73a3d87261ad89.png
I have the some problem but I tried to install it locally on my Windows 10 computer. During installation i get the message that ‘nfs41client failed to load’.
you need to use the ESXi-6.0.0-20180304001-standard.iso. A newer version wont work. It Will fail with the nfs41client message
Still the same error…
use -sip customizer script option & select 29 image
You can add the sip parameter to select an imageprofile from the list. By default, the latest imageprofile will be selected.
You can also try the latest script: http://vibsdepot.v-front.de/tools/ESXi-Customizer-PS-v2.6.0.ps1
I am attempting this on Windows Server 2016. Everything in ESXi Customizer looks good (see log below), but I still get the nfsclient failed to load error, as well. Checked the nettulip docs at https://vibsdepot.v-front.de/wiki/index.php/Net-tulip and it says “Compatible With: ESXi 5.0, ESXi 5.1, ESXi 5.5, ESXi 6.0, ESXi 6.5”. But I’ve tried to get it to work on 6.0 and 6.5, and I’ve used the -sip parameter to allow me to choose the right image profile (Using Imageprofile ESXi-6.0.0-20180304001-standard …), and it still doesn’t work. Very frustrating, as I’ve followed these exact instructions. Did anyone else figure this out?
Updates ESXi 6.0 Image Profile-ESXi-6.0.0-20180304001-standard)
Load additional VIBs from Online depots …
Add VIB net-tulip 1.1.15-1 [New AcceptanceLevel: CommunitySupported] [OK, added]
Exporting the Imageprofile to ‘E:ISOsESXi-6.0.0-20180304001-standard-customized.iso’. Please be patient …
All done.
I have now finally gotten it to install, but I had to use ESXi-6.0.0-20160302001-standard to get it to work. I saw that version referenced in another set of VMware on Hyper-V instructions, so tried that, and, thank GOD, it finally worked. :) Even THEN, it still froze the first time around on the install screen, not letting me press “Enter” to continue, but it worked on a restart after that.
Maximilian, thanks for your info! only god knows how many images i’ve tried until now, the only one who works is the one you posted, the ESXi-6.0.0-20160302001-standard. This works on Hyper-V on Windows 10 1903.
How do I get that particular image version? The customizer syntax only specifies “6.0”, and I’m getting “ESXi-6.0.0-20191204001”.
I got the right image. The “-sip” parameter causes the customizer script to present a list of all images available and prompt for a selection.
I’ve found that you have to back at least as far as 2017-06-04 to get it to work. There are also some additional tricks you have to do to fully get it up and running. This post had all the rest that I needed: https://www.nakivo.com/blog/install-esxi-hyper-v/
Same with me when try to install ESXi 6.7 on Windows Server 2019
I never tried to install ESXi on Windows Server 2019.
Maybe Dan did it? You should check his website for more information: https://www.v-front.de/p/esxi-customizer-ps.html
Nicolas
Guys how can I run the command: ignoreHeadless=TRUE?
Shift and O during startup
i was tried above command to change boot option
displays error mssage
could not find the kernel
So I finally got it to run using ESXi-6.0.0-20160302001-standard. Now I am faced with when trying to start a guest vm on it, I get the message Hyper-V and VMware are incompatible and to remove Hyper-V first. Any suggestions?
I noticed my Hyper-V backups started to fail as soon as I installed VMWare PowerCLI on the Hyper-V host.
I got the error “Error While Executing powershell Queries” in the backup failure report. I have managed to fix this myself after removing PowerCLI and deleting all the modules that start with VMware. under C:Program FilesWindowsPowerShellModules. The solution is posted here: https://www.assadali.com/2020/01/vembu-bdr-backup-for-hyper-v-fails-with.html