AnselTaft.com
Digital strategist, front end + email developer, WordPress enthusiast, IT tinkerer, and not-so-horrible writer

How to Make Custom VMware ESXi 8.0 / 7.0 ISOs

Lately anytime I've struggled to get something to work I feel like I owe it to the people behind me to document the things I did to get it across the finish line. With that in mind here's the steps I took to remix both the ESXi 7.0U2e and 8.0a archives with the Community Networking Driver and USB Network Native Driver. I need to thank Gerard's Curious Tech for many of the commands used in this post, as well as Jonas Werner for a few contributions from his video. In addition let me thank Florian Grehl for some clutch commands I needed so Python 3.7 talked to VMWare's PowerCLI modules in PowerShell 5.1.

Step 1: make sure your Windows installation has PowerShell 5.1 installed by default. Click the Windows button and start typing p-o-w-e-r-s-h-e-l-l. Some time around S Windows should understand what you're looking for and display the app on the right. Look for a link below the icon which says Run as Administrator. Click it.

! In 2022 I tried to install VMWare's PowerCLI modules in PowerShell 7 and received a compatibility error so I pivoted to PowerShell 5.1 and everything installed just fine. It's 2023 now and VMWare may have added compatibility for PowerShell 6 or 7. If you decide to try and install PowerCLI on an updated version of PowerShell please let me know if it worked. In the meantime you can be assured everything works properly in PowerShell 5.1.

Step 2: with PowerShell open in administrator mode let's check the version number. Type $PSVersionTable in the PowerShell console. If you see PSVersion 5.1.xxx great! For now, please close PowerShell because we need to something else first.

Step 3: at this point we need to take a hard left and install Python 3.7.9. Please go to to the Python downloads page and search for 3.7.9 on the page. There should be two results. Click to download the Windows installer (64-bit).

! Why did I ask you to install Python 3.7.9 and not 3.7.16 (the latest version in the 3.7.x series) or 3.11.1 (the absolute latest version to date)? Two reasons: 3.7.9 is the last version in the 3.7 series to be compiled into a Windows installer, and I didn't test compatibility with 3.11.1. If you would like to try the VM

Step 4: please go to where the installer downloaded, double click it, and install it.

Step 5: Python likely installed itself in the following directory: C:\Users\[USERNAME]\AppData\Local\Programs\Python\Python37\python.exe. Although, in Windows 11 the username is probably ‘me' instead of the actual username. If you open up a Windows command prompt and type where python it will reply with the path to find the Python executable.

Step 6: please open this link and download the get-pip.py file. Find where the file downloaded then move it into the same folder as the python executable from the last step.

Step 7: if you have a Windows command prompt open please type python.exe .\get-pip.py to install PIP. If not, please open a command prompt and run the command. In case you're wondering PIP is apparently a package manager for Python and it will help us install what we need to make the VMWare PowerCLI modules happy.

Step 8: with your Windows command prompt still open please type pip3.7.exe install six psutil lxml pyopenssl then close your Windows command prompt.

Step 9: it's time to work in PowerShell again. Please open it as an administrator again then type Set-PowerCLIConfiguration -PythonPath $env:USERPROFILE\AppData\Local\Programs\Python\Python37\python.exe -Scope User.

Step 10: with Python installed and connected to PowerShell it's time to install the VMWare PowerCLI modules and work on making a custom ISO. Please copy and paste Install-Module -Name VMware.PowerCLI -Scope CurrentUser into PowerShell.

Step 11: now let's change PowerShell's execution policy on our local machine from Restricted to RemoteSigned: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine.

Step 12: please verify that LocalMachine is set to RemoteSigned: Get-ExecutionPolicy -List.

Step 13: now we need a local folder to work from. Please create a folder and add its path to the following command: cd "c:\change\this\to\your\working\folder\name". Personally, I worked from a folder on my desktop and the path looked like this: C:\Users\me\OneDrive\Desktop\ESXi-8.0a

Step 14: with the folder created and our current directory changed to it in PowerShell it's time to pull down the list of every version of ESXi available for download. Please copy and paste the following command into PowerShell and run it: Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml. It will take a while and then spit out a list of 540 image versions. When I made my ISOs the two which worked for me were ESXi-8.0a-20842819-standard and ESXi-7.0U2e-19290878-standard. When selecting an ISO it's important to know that the limiting factor will be what's compatible with the flings we're trying to weave into the image, specifically the USB Network Native Driver.

! Please note: the rest of this tutorial will be written with the ESXi-8.0a-20842819-standard image in mind, but you can easily adapt the commands for other images – future ones even – by substituting the name of one for another as long as it appeared in the XML list.

Step 15: download the 8.0a image with the following command: Export-ESXImageProfile -ImageProfile "ESXi-8.0a-20842819-standard" -ExportToBundle -filepath ESXi-8.0a-20842819-standard.zip. Please make sure you see it in your ESXI working folder.

Step 16: with the image downloaded we can detach PowerCLI from the list of ESXi images: Remove-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml.

Step 17: please download the Community Networking Driver to your ESXi working folder.

Step 18: now download the USB Network Native Driver to your ESXi working folder. Please make sure the dropdown box is set to a version number which matches the ESXi image downloaded in Steps 14, 15.

Step 19: in this step we're going to queue up all three files to be stitched together. Please paste each command into PowerShell then hit the enter key.
Add-EsxSoftwareDepot .\ESXi-8.0a-20842819-standard.zip
Add-EsxSoftwareDepot .\Net-Community-Driver_1.2.7.0-1vmw.700.1.0.15843807_19480755.zip
Add-EsxSoftwareDepot .\ESXi800-VMKUSB-NIC-FLING-61054763-component-20826251.zip

Step 20: now to change the name slightly, from ESXi-8.0a-20842819-standard to ESXi-8.0a-20842819-USBNIC, so we can tell which is the new image: New-EsxImageProfile -CloneProfile "ESXi-8.0a-20842819-standard" -name "ESXi-8.0a-20842819-USBNIC" -Vendor "VMW".

! Please note: you can set the name of the new image to whatever makes sense to you. At some point one of the tutorials I worked from changed the end of their image to -USBNIC, that made sense to me so I went with it. You could change yours to ESXi-8.0a-20842819-TotallyNewImageDude – it doesn't matter – as long as you're consistent and change the next set of commands in the proper places.

Step 21: next we strip out the existing network drivers: Remove-EsxSoftwarePackage -ImageProfile "ESXi-8.0a-20842819-USBNIC" -SoftwarePackage "ne1000".

Step 22: then we add the community network drivers fling: Add-EsxSoftwarePackage -ImageProfile "ESXi-8.0a-20842819-USBNIC" -SoftwarePackage "net-community"

Step 23: now weave in the USB network drivers fling: Add-EsxSoftwarePackage -ImageProfile "ESXi-8.0a-20842819-USBNIC" -SoftwarePackage "vmkusb-nic-fling".

Step 24: finally, we ask PowerCLI to spit out an ISO then a ZIP file of our new image with two commands:
Export-ESXImageProfile -ImageProfile "ESXi-8.0a-20842819-USBNIC" -ExportToIso -Force -filepath ESXi-8.0a-20842819-USBNIC.iso
Export-ESXImageProfile -ImageProfile "ESXi-8.0a-20842819-USBNIC" -ExportToBundle -Force -filepath ESXi-8.0a-20842819-USBNIC.zip

Step 25: with our ISO exported we can reverse the LocalMachine execution policy we set way back in Step 11 to restricted: Set-ExecutionPolicy -ExecutionPolicy Restricted -Scope LocalMachine.

Step 26: now verify we made the change correctly: Get-ExecutionPolicy -List.

And that's it – you just made a custom ESXi image using VMWare's PowerCLI modules in PowerShell! Hopefully. If not, feel free to google any errors or comment with any problems you're facing and I'll try to help. Cheers

Leave a reply