Details of the scenario you tried and the problem that is occurring
When trying to apply a machine configuration package using the GuestConfiguration cmdlets as seen in How to test machine configuration package artifacts on any of the supported distributions the following error occurs:
It seems the omi libraries needed by PowerShell DSC are not being found. Upon further inspection, it seems the default search path is not included which is why this issue occurs. Simply adding /opt/omi/lib/ to the search path fixes this problem.
Suggested solution to the issue
Add the OMI libraries to the system library search path
The DSC configuration that is used to reproduce the issue (if applicable)
# OMI install its libs in /opt/omi/lib/, include in search path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/omi/lib/
The operating system the target node is running
~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
Version and build of PowerShell the target node is running
$PSVersionTable
Name Value
---- -----
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Ubuntu 22.04.4 LTS
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version of the module that was used
Get-Module -Name 'Guestconfiguration' -ListAvailable | ft Name,Version,Path
Name Version Path
---- ------- ----
GuestConfiguration 4.5.0 /home/ahmed/.local/share/powershell/Modules/GuestConfiguration/4.5.0/GuestConfiguration.psd1
Details of the scenario you tried and the problem that is occurring
When trying to apply a machine configuration package using the GuestConfiguration cmdlets as seen in How to test machine configuration package artifacts on any of the supported distributions the following error occurs:
It seems the omi libraries needed by PowerShell DSC are not being found. Upon further inspection, it seems the default search path is not included which is why this issue occurs. Simply adding
/opt/omi/lib/
to the search path fixes this problem.Suggested solution to the issue
Add the OMI libraries to the system library search path
The DSC configuration that is used to reproduce the issue (if applicable)
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the module that was used