How to build custom ESXi image

Introduction

Sometimes you need to create your own ESXi image with additional content. In my case, I had to add the community-created ne1000 VIB. Below you will find a short instruction on how to do this.

Create own image

Install PowerCLI and import Image Builder module:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> Install-Module -Name VMware.PowerCLI
PS C:\Windows\system32> Import-Module VMware.ImageBuilder
PS C:\Windows\system32> Set-ExecutionPolicy -ExecutionPolicy Unrestricted
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. 
Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): Y

Add an ESX software depot to the current PowerCLI session and get all available image profiles:

PS C:\Windows\system32> Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml

Depot Url
---------
https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml


PS C:\Windows\system32> Get-EsxImageProfile

Name                           Vendor          Last Modified   Acceptance Level
----                           ------          -------------   ----------------
ESXi-5.0.0-20110904001-notools VMware, Inc.    26.08.2011 1... PartnerSupported
ESXi-5.0.0-20110904001-stan... VMware, Inc.    26.08.2011 1... PartnerSupported
ESXi-5.0.0-20111104001-no-t... VMware, Inc.    13.10.2011 1... PartnerSupported
ESXi-5.0.0-20111104001-stan... VMware, Inc.    13.10.2011 1... PartnerSupported
ESXi-5.0.0-20111204001-no-t... VMware, Inc.    31.10.2011 1... PartnerSupported

...<snip>...
ESXi-6.7.0-20201104001-no-t... VMware, Inc.    11.11.2020 1... PartnerSupported
ESXi-6.7.0-20201104001-stan... VMware, Inc.    11.11.2020 1... PartnerSupported
ESXi-6.7.0-8169922-no-tools    VMware, Inc.    03.04.2018 2... PartnerSupported
ESXi-6.7.0-8169922-standard    VMware, Inc.    03.04.2018 2... PartnerSupported
ESXi-7.0.0-15843807-no-tools   VMware, Inc.    16.03.2020 1... PartnerSupported
ESXi-7.0.0-15843807-standard   VMware, Inc.    16.03.2020 1... PartnerSupported
ESXi-7.0.1-16850804-no-tools   VMware, Inc.    04.09.2020 1... PartnerSupported
ESXi-7.0.1-16850804-standard   VMware, Inc.    04.09.2020 1... PartnerSupported
ESXi-7.0U1a-17119627-no-tools  VMware, Inc.    01.11.2020 0... PartnerSupported
ESXi-7.0U1a-17119627-standard  VMware, Inc.    01.11.2020 0... PartnerSupported
ESXi-7.0U1b-17168206-no-tools  VMware, Inc.    11.11.2020 1... PartnerSupported
ESXi-7.0U1b-17168206-standard  VMware, Inc.    11.11.2020 1... PartnerSupported
ESXi-7.0U1c-17325551-no-tools  VMware, Inc.    15.12.2020 1... PartnerSupported
ESXi-7.0U1c-17325551-standard  VMware, Inc.    15.12.2020 1... PartnerSupported
ESXi-7.0U1d-17551050-no-tools  VMware, Inc.    01.02.2021 1... PartnerSupported
ESXi-7.0U1d-17551050-standard  VMware, Inc.    01.02.2021 1... PartnerSupported
ESXi-7.0U1sc-17325020-no-tools VMware, Inc.    15.12.2020 1... PartnerSupported
ESXi-7.0U1sc-17325020-standard VMware, Inc.    15.12.2020 1... PartnerSupported
ESXi-7.0b-16324942-no-tools    VMware, Inc.    02.06.2020 1... PartnerSupported
ESXi-7.0b-16324942-standard    VMware, Inc.    02.06.2020 1... PartnerSupported
ESXi-7.0bs-16321839-no-tools   VMware, Inc.    02.06.2020 0... PartnerSupported
ESXi-7.0bs-16321839-standard   VMware, Inc.    02.06.2020 0... PartnerSupported

Download image on disk then add local software depots (network driver in our case):

PS C:\Windows\system32> Export-ESXImageProfile -ImageProfile "ESXi-7.0U1d-17551050-standard" -ExportToBundle -filepath C:\ESXi-Bundle\ESXi-7.0U1d-17551050-standard.zip
PS C:\Windows\system32> Remove-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
PS C:\Windows\system32> Add-EsxSoftwareDepot C:\ESXi-Bundle\ESXi-7.0U1d-17551050-standard.zip
Depot Url
---------
zip:C:\ESXi-Bundle\ESXi-7.0U1d-17551050-standard.zip?index.xml

PS C:\Windows\system32> Add-EsxSoftwareDepot C:\ESXi-Bundle\Intel-NUC-ne1000_0.8.4-3vmw.670.0.0.8169922-offline_bundle-16654787.zip
Depot Url
---------
zip:C:\ESXi-Bundle\Intel-NUC-ne1000_0.8.4-3vmw.670.0.0.8169922-offline_bundle-16654787.zip?index.xml

Now create new image profile, remove old ne1000 driver and add new one:

PS C:\Windows\system32> New-EsxImageProfile -CloneProfile "ESXi-7.0U1d-17551050-standard" -name "ESXi-7.0U1d-17551050-standard-OWN"

cmdlet New-EsxImageProfile at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Vendor: BlanketVM

Name                           Vendor          Last Modified   Acceptance Level
----                           ------          -------------   ----------------
ESXi-7.0U1d-17551050-standa... BlanketVM       01.02.2021 1... PartnerSupported



PS C:\Windows\system32> Remove-EsxSoftwarePackage -ImageProfile "ESXi-7.0U1d-17551050-standard-OWN" -SoftwarePackage "ne1000"

Name                           Vendor          Last Modified   Acceptance Level
----                           ------          -------------   ----------------
ESXi-7.0U1d-17551050-standa... BlanketVM       11.02.2021 1... PartnerSupported


PS C:\Windows\system32> Add-EsxSoftwarePackage -ImageProfile "ESXi-7.0U1d-17551050-standard-OWN" -SoftwarePackage "ne1000-intelnuc 0.8.4-3vmw.670.0.0.8169922"

Name                           Vendor          Last Modified   Acceptance Level
----                           ------          -------------   ----------------
ESXi-7.0U1d-17551050-standa... BlanketVM       11.02.2021 1... PartnerSupported

And finally export our new image and install ESXi using it:

PS C:\Windows\system32> Export-ESXImageProfile -ImageProfile "ESXi-7.0U1d-17551050-standard-OWN" -ExportToISO -filepath C:\ESXi-Bundle\ESXi-7.0U1d-17551050-standard-OWN.iso

Resources

Developer Documentation – ESX Category

Update 17.02.2021

The great news!. VMware has published a new version of the community network driver on VMware Flings. HERE you can find a collection of ESXi Native Drivers, which adds support for various PCIe-based network adapters.

One thought on “How to build custom ESXi image

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s