In November 2022, I wrote a post on my endeavor about installing PowerCLI on my Windows box. I needed PowerCLI 13 ImageBuilder feature, which was the only way to add the USB Network Native Driver for ESXi fling to a custom ESXi ISO image.
Check these posts here:
Over a year has passed and I wanted to do the same on my Ubuntu 23.10 (Mantic Minotaur) based Linux laptop. I quickly found out it’s the same hassle with little documentation from VMware.
Installing PowerCLI is the easy part. Configuring it to create ESXi ISO’s with ImageBuilder is another thing. This post shows you how to install PowerCLI and configure Python and OpenSSL.
- Python 3.7.1 or later, including pip and some additional packages
- OpenSSL 1.1 or later
- PowerShell 7.x
- .Net Core 3.1
Installing prerequisite software
The important thing here is to install all the required software from the Ubuntu repositories to prevent breaking package dependencies. Make sure to first update your Ubuntu system with the latest updates before going ahead.
Install Python and related packages
In my case Python 3.11 was already installed, but not all the additional Python packages. Install them via:
user@host:~$ sudo apt install python3 python3-pip python3-six python3-psutil python3-lxml python3-openssl
All Ubuntu versions as of 22.04 (Jammy Jellyfish) are using OpenSSL 3.x packages. ImageBuilder in PowerCLI only supports OpenSSL 1.1.x. If not, an error is thrown which pretty much says that OpenSSL 1.1.x is not installed.
The full error message is:
Get-DepotBaseImages: Failed to initialize the VMware.ImageBuilder PowerCLI module because of error: Failed to load VibSign Python module. Make sure OpenSSL 1.1 is installed.
Make sure that Python 3.7.1 or higher is installed and that you have set the path to the Python executable by using Set-PowerCLIConfiguration -PythonPath <executable_path>. See the PowerCLI Compatibility Matrixes for information on the Python requirements.
The workaround for this is to downgrade the OpenSSL packages to 1.1.x using Ubuntu Focal packages. Secondly the downgraded version need to be holded, so they’re not upgraded during the next Ubuntu patch cycle.
Be aware that the holded OpenSSL packages are not updated anymore and software that expects OpenSSL 3.x could throw errors.
1: Download old OpenSSL packages
2: Install replace OpenSSL packages
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb
sudo dpkg -i libssl-dev_1.1.1f-1ubuntu2.20_amd64.deb
sudo dpkg -i openssl_1.1.1f-1ubuntu2.20_amd64.deb
3: Hold OpenSSL packages to prevent updates
sudo apt-mark hold libssl1.1
sudo apt-mark hold libssl-dev
sudo apt-mark hold openssl
There are two ways to install PowerShell on Ubuntu.
Option 1: Via packages
The first is to use the package based variant as described in the PowerShell documentation.
Option 2: Via Snaps
The second variant is to install PowerShell via Ubuntu App Center and search for PowerShell. This way, PowerShell is installed as a Snap.
Either way works, it’s up to you.
Install and configure PowerCLI
The installation of PowerCLI itself is pretty simple and is described in the documentation.
Now a couple of settings need to be configured in PowerShell.
1: Configure response to untrusted certificates
For Linux, only the “Fail” and “Ignore” options are supported as mentioned in the documentation.
Let’s go for “Fail” which is the safest option:
PS /home/user> Set-PowerCLIConfiguration -InvalidCertificateAction Fail
2: Configure Python Path
First determine the Python path.
user@host:~$ which python3
Second configure the Python path and exit PowerShell afterwards.
PS /home/user> Set-PowerCLIConfiguration -PythonPath /usr/bin/python3
PS /home/user> exit
3: Get rid of the CEIP message
Set the VMware Customer Experience Improvement Program (CEIP) message to “true” or “false”. Personally I prefer “false”.
PS /home/user> Set-PowerCLIConfiguration -ParticipateInCeip $false
All steps are now done to get ImageBuilder working in Ubuntu. To test if an ESXi Base Image can be read from a ZIP based Depot, I’ve download the latest ESXi 8 patch to test.
Show the ESXi Base Image
PS /home/user> Get-DepotBaseImages -Depot /home/user/Downloads/VMware-ESXi-8.0U2-22380479-depot.zip
Version Vendor Release date
------- ------ ------------
8.0.2-0.0.22380479 VMware, Inc. 09/21/2023 00:00:00
That looks just fine. If any of the previous step were not performed, an error would be thrown by now.
To go ahead and create custom ISO file, take a look at my previous post below.
For getting PowerCLI ImageBuilder to work, I needed to read quite some blogs and documentation pages. Getting something so “basic” to work should not be needed.
Anyway, I hope it helps fixing you issues with PowerCLI on your favorite Ubuntu version.