Tuesday 19 May 2020

Customizing ESXi ISO for RTL drivers

Since I had a laptop lying around with a broken video card and needed to do some VM experiments on it, I tried to deploy a recent VMware ESXi image on it but... ran into issues with the network card, a Realtek 8111/8168/8411 series, which the installer does not detect and thus is blocking.

So then I dug up a bit and found out that until ESXi 7.0 (which  you still have a change to inject a community-supported driver and produce a custom ISO from it. Normally there is an ESXi Customizer PS script that can help with it but, what do you know, you can't use unsigned PS files on some corporate laptops...

So then I turned back to this very targeted blog article and took the hard way, luckly still having the VMware PowerCLI at hand, to do it by hand in the PS shell.

The first hurdle to stumble over was fetching the VMware bundle files -- apparently VMware only offers the ISO images for "free" usage and the bundle files are kept for "licensed" users. Nevertheless, I was able to download the "security patches" bundle via the VMware Product patches page.

Then I had to work around some quirks about acceptance levels (VMware is serious about supported configurations both in hardware and in software) and some weird signature checks -- here is the "adapted" list of commands:

> Add-EsxSoftwareDepot "C:\...\esxi-customizer\drivers\net55-r8168-8.045a-napi-offline_bundle.zip", "C:\...\esxi-customizer\ESXi670-202004002.zip"
> Get-EsxImageProfile
Name                           Vendor          Last Modified   Acceptance Level
----                           ------          -------------   ----------------
ESXi-6.7.0-20200401001s-no-... VMware, Inc.    21-Apr-20 6:... PartnerSupported
ESXi-6.7.0-20200404001-stan... VMware, Inc.    21-Apr-20 6:... PartnerSupported
ESXi-6.7.0-20200401001s-sta... VMware, Inc.    21-Apr-20 6:... PartnerSupported
ESXi-6.7.0-20200404001-no-t... VMware, Inc.    21-Apr-20 6:... PartnerSupported
> New-EsxImageProfile -CloneProfile ESXi-6.7.0-20200404001-standard -name ESXi-6.7.0-20200404001-standard-RTL8111 -Vendor Custom
> Set-EsxImageProfile -ImageProfile ESXi-6.7.0-20200404001-standard-RTL8111 -AcceptanceLevel CommunitySupported
> Get-EsxSoftwarePackage | Where {$_.Vendor -eq "Realtek" }
Name                     Version                        Vendor     Creation Date
----                     -------                        ------     -------------
net55-r8168              8.045a-napi                    Realtek    16-Apr-18 9:2...
> Add-EsxSoftwarePackage -ImageProfile ESXi-6.7.0-20200404001-standard-RTL8111 -SoftwarePackage net55-r8168 -Force
> Export-EsxImageProfile -ImageProfile ESXi-6.7.0-20200404001-standard-RTL8111 -ExportToIso -filepath C:\...\esxi-customizer\VMware-ESXi-6.7.0-20200404001-RTL8111.iso -NoSignatureCheck