This tutorial will demonstrate the steps to create a custom ESXi ISO image using VMware PowerCLI. Before beginning, it’s essential to install PowerCLI on your system.
Currently, version 13 of PowerCLI is available, but there are known issues with it. It’s recommended to install version 12.7 instead, which can be done using the following command:
Install-Module -Name VMware.PowerCLI -RequiredVersion 12.7.0.20091289
Next, you’ll need to set up the Python path in your environment. To do so, first install Python and then follow these steps using the following command to set the path.
Set-PowerCLIConfiguration -PythonPath <python3.7-directory>\python.exe -Scope User
With your environment set, the next step is to resolve the issues with the current Image Builder by installing an older version. In this case, version 7.0.3 will be installed.
To download it, you need to first remove the existing version using the following command:
Get-Module VMware.ImageBuilder | Uninstall-Module -Force
To delete the ImageBuilder, you need to navigate to the directory and remove all its contents as follows:
C:\Program Files\WindowsPowerShell\Modules\VMware.ImageBuilder
Once everything is deleted run the below command to install the VMware.ImageBuilder 7.0.3.
Install-Module -Name VMware.ImageBuilder -RequiredVersion 7.0.3.19599828
With the PowerCLI environment now set, the next step is to use the following commands to create a custom ISO image. For this example, we will be using the ESXi-7.0U3i-20842708-standard zip file and the Net Community Driver.
Here’s how to create the custom ISO:
Import-Module VMware.ImageBuilder
Add-EsxSoftwareDepot .\VMware-ESXi-7.0U2d-18538813-depot.zip
Add-EsxSoftwareDepot .\Net-Community-Driver_1.2.7.0-1vmw.700.1.0.15843807_19480755.zip
New-EsxImageProfile -CloneProfile "ESXi-7.0U3i-20842708-standard" -name "ESXi-7.0U3i-20842708-standard-customNIC" -vendor "corpit"
Add-EsxSoftwarePackage -ImageProfile "ESXi-7.0U3i-20842708-standard-customNIC" -SoftwarePackage "net-community"
Export-EsxImageProfile -ImageProfile "ESXi-7.0U3i-20842708-standard-customNIC" -ExportToIso ESXi-7.0U3i-20842708-standard-customNIC.iso -NoSignatureCheck
Once all the commands have been successfully executed, your custom ISO image will be ready. If you encounter any issues, please let us know in the comments section. We will be more than happy to provide additional support.
Sir, how to do the same in Linux?
You cannot do it from linux
Check this out maybe that will help
https://blog.zuthof.nl/2024/01/04/powercli-13-installation-hurdles-on-linux/