Install VMware ESXi on a Hyper-V

It is possible to use nested virtualization to run VMware ESXi as a Virtual Machine in Hyper-V. To some, this may be a viable option if you are unable to acquire any new hardware, or if you simply want to test new VMware products on your Windows 10 desktop.

Although this process is not officially supported by VMware or Microsoft, it is possible to get an ESXi environment stood up using Hyper-V. There are a number of prerequisites to adhere to as well as an understanding that following this process may not give a smooth end-to-end user experience.

Before we start we MUST prep the ISO and inject Hyper-V compatible Network drivers. If you do not do this the process will fail and you will be unable to connect to your ESXi server.

VMware PowerCLI is a requirement here. Please see our related post for how to install PowerCLI.

Preparing the ESXi Hypervisor image

  • Download an ESXi customizer tool from http://vibsdepot.v-front.de/tools/ESXi-Customizer-PS-v2.5.1.ps1 and save to your local machine (e.g to C:\ESXi).
  • Open PowerShell and type Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass select [Y] Yes to enable. This will allow you to execute downloaded scripts:Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
  • Ensure you are in the same directory as the script that has just been downloaded (e.g C:\ESXi).
  • Now type .\ESXi-Customizer-PS-v2.5.1.ps1 -v60 -vft -load net-tulip   (Net Tulip are Hyper-V compatible network drivers).
  • This process will take several minutes to complete:ESXi net tulip injector
  • Now if you go to your folder (e.g C:\ESXi) you will see your customized ISO Image. This is the image you will need to use to build your ESXi server in Hyper-V:Customized ESXi Image for Hyper-V

    Alternative way to prepare the ESXi Hypervisor image

    Please Note – At the time of writing we experienced issues with the ESXi Online Customizer application. We were getting errors creating the customized ISO suggesting issues with the VMware online repositories – this could be a temporary issue, but here is an alternative way to manually inject the net-tulip drivers:

Customizer Error

  • The method DOES NOT work on Windows 10. This was completed on a Windows 7 Laptop
  • Download and install the legacy ESXi Customizer application
  • Download ESXi Hypervisor from MyVmware – I chose version 5.1 as I had it available locally
  • Download the Net-tulip drivers and extract to your computer
  • Run the ESXi-Customizer.cmd (as Administrator):Manually inject net-tulip drivers
  • Select the ESXi Hypervisor, Select the Net-Tulip .vib file, and set working directory – then click run:Manually inject net-tulip drivers
  • Ignore the warning message – click NO:Manually inject net-tulip drivers
  • After a few minutes the custom ISO will be created:Manually inject net-tulip driversManually inject net-tulip drivers completed

Installing ESXi on Hyper-V

  1. Ensure you have the Hyper-V feature enabled on your Windows 10 or Windows Server product. If not, Hyper-V can be added using the Turn Windows Features on or off from the control Panel:Turn Windows features on or off
  2. Launch Hyper-V Manager, right click and select new > Virtual machine:Hyper-V Create Virtual Machine
  3. Click next on the Before you begin screen:Hyper-V - Before you begin
  4. Enter a name for your VM and choose a location to store the VM:Hyper-V - Specify Name and Location
  5. You must now Select Generation 1 for type of Virtual Machine generation:Hyper-V - Specify Generation
  6. Enter the amount of RAM you wish to use. Ensure Dynamic Memory usage is unticked:Hyper-V - Assign Memory
  7. Ensure that there is no connection selected on the Configure Networking Screen – we will come back to this later:Hyper-V - Configure Network
  8. Enter the size of the VM and the name of the vhdx files. 10GB is plenty:Hyper-V - Connect Hard Disk
  9. Next, select Intall an operating system from a bootable CD/DVD-ROM and select the VMware ESXi Hypervisor ISO image we created earlier:Hyper-V - Installation Options
  10. On the summary page, check all your settings are correct then select finish:Hyper-V - Complete the New Virtual Machine Wizard       
  11. Before you start the VM, right click and chose Settings:Hyper-V - Edit Settings
  12. Allocate the vCPU count applicable to your system:Hyper-V - Change CPU settings
  13. Remove any pre-existing Network interface(s):Hyper-V - Remove Network Adapters
  14. Click add hardware and select Legacy Network Adapter then Add – This will pick up the NET-TULIP driver injected into the ISO at the beginning:Hyper-V - Add Legacy Network driver
  15. Ensure the Legacy Network Adapter is connected to your physical network. Press OK to apply changes:Hyper-V - attach legacy network adapter to physical network
  16. Next we need to prep Windows to allow nested VMs. This is done in PowerShell. There is an opensource script on GitHub which does the hard work for you.
  17. Navigate to https://github.com/MicrosoftDocs/Virtualization-Documentation/blob/master/hyperv-tools/Nested/Enable-NestedVm.ps1 and download the Enabled-NestedVM.ps1 PowerShell script. Save it to the same location as your VM.
  18. Open PowerShell  (must be run as Administrator) and navigate to the location you saved the Enabled-NestedVM.ps1 (e.g G:\ESXi\)
  19. Type Set-ExecutionPolicy -scope Process -ExecutionPolicy Bypass
  20. This will allow you to run downloaded PowerShell scripts on your system.
  21. Select [Y] Yes to enable the feature.
  22. Now type .\Enabled-NestedVM.ps1 -vmname “YOUR VM NAME”:Enabled-NestedVM.ps1
  23. Answer [Y] when prompted to run an enable MAC Spoofing.
  24. Now you can power on your VM.
  25. It will boot into the ESXi Installer – Press TAB immediatey to edit the boot options.
  26. Type ignoreHeadless=TRUE   (Note this is case sensitive):ignoreHeadless=TRUE      Installing ESXi
  27. Follow the onscreen commands to install ESXi. You will need to select the location of the installer files:Installing ESXi
  28. Press Enter to continue and accept the licence agreement:Installing ESXi select hard disk to install too
  29. Next select the 10GB partition created earlier:Installing ESXi
  30. Enter the Keyboard layout settings and set the root password:Installing ESXi
  31. Then press F11 to start the installation process – Install will take a few minutes:
  32. Disconnect the Virtual CD-DVDROM Drive and reboot the server:Eject Hypervisor media
  33. The ESXi Server will now boot (This will take a few minutes).
  34. Once VMware has loaded you will see the ESXi shell and you should see an IP address. If you see this the installation and legacy network configuration was successful:Esxi Installed on Hyper-V with networking enabled
  35. Press F2 and Log in as ROOT:Esxi enter Root password
  36. Now we must make the boot option chosen earlier for “ignoreHeadless=TRUE” permanent. To do this we need to enable the ESXi Shell. Navigate to Troubleshooting options and then Enable ESXi shell:Esxi - Troubleshooting optionsESXi - enable ESXi Shell
  37. Now press ALT F1 to enter the ESXi Shell.
  38. Log in with the root credentials.
  39. Type esxcfg-advcfg –set-kernel “TRUE” ignoredHeadless:Esxi Shell rootEsxi - set headless
  40. Then reboot the server.
  41. ESXi will now boot without any manual intervention.
  42. Next it is advisable to disable the ESXi Shell for security purposes:Disable ESXi Shell
  43. Next you can attempt to connect to the IP address of your newly created ESXi Host. You will most likely NOT be able to ping the ESXi server despite it having a Net-Tulip IP address.
  44. Open Command Prompt (as administrator) and add a static route to your ESXi IP. Type route add -p 192.168.1.240 192.168.1.1 (Substitute for your details).
  45. Now Ping your ESXi Host again and if will reply:Esxi on Hyper-V - no ping to host
  46. Next Open your web browser and connect to the IP of your ESXi host.
  47. Download the vSphere Client and install:vSphere - Installation startvSphere - Installation licence pagevSphere - Installation startvSphere - Installation in progress
  48. Open vSphere client and connect to your Esxi server using the root credentials created earlier: The configuration is complete:Esxi running on Hyper-V

 

Read related articles