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:
PowerCLI 13 update and installation hurdles on Windows
Create ESXi 8 Customized ISO Installer
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.
Required software
PowerCLI 13.2.1 (which is the latest at time of writing, released 27 November 2023) requires the following software:
- Python 3.7.1 or later, including pip and some additional packages
- six
- psutil
- lxml
- pyopenssl
- 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
Downgrade 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.
VMware KB 93110: ImageBuilder Error – “failing to load VibSign Python module
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
openssl_1.1.1f-1ubuntu2.20_amd64.deb
libssl-dev_1.1.1f-1ubuntu2.20_amd64.deb
libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb
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
Install PowerShell
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.
Installing PowerShell on Ubuntu
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.
PowerCLI User’s Guide – Install PowerCLI
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.
PowerCLI User’s Guide – Configure the PowerCLI Response to Untrusted Certificates
Let’s go for “Fail” which is the safest option:
user@host:~$ pwsh
PowerShell 7.4.0
PS /home/user> Set-PowerCLIConfiguration -InvalidCertificateAction Fail
2: Configure Python Path
First determine the Python path.
user@host:~$ which python3
/usr/bin/python3
Second configure the Python path and exit PowerShell afterwards.
user@host:~$ pwsh
PowerShell 7.4.0
PS /home/user> Set-PowerCLIConfiguration -PythonPath /usr/bin/python3
...
PS /home/user> exit
user@host:~$
3: Get rid of the CEIP message
Set the VMware Customer Experience Improvement Program (CEIP) message to “true” or “false”. Personally I prefer “false”.
user@host:~$ pwsh
PowerShell 7.4.0
PS /home/user> Set-PowerCLIConfiguration -ParticipateInCeip $false
Using ImageBuilder
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.
Create ESXi 8 Customized ISO Installer
To conclude
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.
Cheers, Daniël
Useful links
Related Info on my blog
PowerCLI 13 update and installation hurdles on Windows
Create ESXi 8 Customized ISO Installer
Fixing the issues
TizuTech Blog – Installing VMware PowerCLI on Linux or macOS
GeeksforGeeks Blog – How to Install Python Six Module on Linux
DeviceTest Website – Use OpenSSL 1.1.1 in Ubuntu 22.04
StackOverflow – How do I know python path on linux ubuntu
AskUbuntu – How to prevent updating of a specific package
PowerShell Info
PowerShell documentation – Install PowerShell on Ubuntu
2 Comments
Petar · January 6, 2024 at 9:50 am
All in one place! Thanks for this procedure which has its own tweaks. I’ve just installed PowerCLI 13 following the instructions, and everything went fine.
Daniël Zuthof · January 6, 2024 at 9:54 am
Thanks Petar! Great to hear it worked for you. Cheers, Daniel.