canonical / canonical/powershell-snaps

PSWSMan Module Unable to Install Due to Read-Only File System

Open
#21 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Description

I was asked to post here by @mateusrodrigues with a screenshot showing an issue due to the read-only file system with PowerShell as a snap on Ubuntu. The module PSWSMan (by @jborean93) is used to patch the necessary libraries on PowerShell 7 to allow the use of WSMan as a connection protocol on Linux and macOS and it works well for me under regular PowerShell. With PowerShell installed from the Microsoft repository on Ubuntu 24.04, I can use a Kerberos ticket, gained by using kinit or login when joined to an AD domain via SSD, and then use the New-PSSession, Invoke-Command and Enter-PSSession cmdlets to interact with Windows Server instances from PowerShell on Linux without needing to go through SSH.

However when using PowerShell installed via Snap, the file system presented to PowerShell and thus PSWSMan is read-only and this was reported to Jordan back in April 2021 (Ref: https://github.com/jborean93/omi/issues/28). When you use the Install-WSMan cmdlet, the module is unable to update the following file paths due to being read-only:

* /snap/powershell/304/opt/powershell/libmi.so
* /snap/powershell/304/opt/powershell/libpsrpcclient.so

The image attached below shows me trying to do so just 15 minutes ago on a fresh Ubuntu Server 24.04.2 LTS virtual machine with the PowerShell snap selected to be installed during setup. A further thread (Ref: https://github.com/jborean93/omi/issues/24#issuecomment-798995921) mentions how PowerShell hardcodes the paths to those files and even mentions a workaround, however that was unsuccessful for me.

I hope the information helps as the Snap option for PowerShell would be a useful option to use non-LTS builds of Ubuntu Server if I happen to find a new feature that would be useful but without the module, it hampers a few automation workflows that I have implemented.

Image

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.