aws / session-manager-plugin

This plugin helps you to use the AWS Command Line Interface (AWS CLI) to start and end sessions to your managed instances
Apache License 2.0
263 stars 70 forks source link

Unable to install in Windows Subsystem for Linux (WSL) #25

Open benfortuna opened 3 years ago

benfortuna commented 3 years ago

Tried both the Ubuntu server deb package, and also tried using alien to convert the rpm to deb package.

Error returned as follows:

image

Gageperrin commented 2 years ago

Same issue here, it looks like preinst and some other files are missing shebang.

innix commented 2 years ago

I got the same errors as you when installing the Ubuntu Server .deb package and assumed the install failed. But a couple of weeks later I discovered it still installed successfully. I am using WSL2 with Ubuntu 20.04 on Windows 11.

I recommend you check if it did actually install. Try running:

session-manager-plugin --version

If that worked, then you should also test it's working properly by starting a session to an SSM-enabled EC2 instance using the AWS CLI:

aws ssm start-session --target '<ec2-instance-id>'

Here's my full console log, for reference:

~ ❯ curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3350k  100 3350k    0     0  2597k      0  0:00:01  0:00:01 --:--:-- 2597k

~ ❯ sudo dpkg -i session-manager-plugin.deb
[sudo] password for innix:
(Reading database ... 72450 files and directories currently installed.)
Preparing to unpack session-manager-plugin.deb ...
Preparing for install
/var/lib/dpkg/tmp.ci/preinst: 4: stop: not found
Unpacking session-manager-plugin (1.2.312.0-1) ...
Setting up session-manager-plugin (1.2.312.0-1) ...
Starting session-manager-plugin
/var/lib/dpkg/info/session-manager-plugin.postinst: 4: start: not found

~ ❯ session-manager-plugin --version
1.2.312.0

~ ❯ aws ssm start-session --target 'i-redacted'

Starting session with SessionId: redacted
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Windows> exit

Exiting session with sessionId: redacted.

~ ❯ rm session-manager-plugin.deb                                                                                                                                                                                                                     

~ ❯
ObaidUr-Rahmaan commented 1 year ago

Anyone found a solution to this?

ConercaoAlpha commented 1 year ago

I've installed the session-manager-plugin today with no issues. Nor have I had any previously.

From the Ubuntu WSL command line...

curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb"

and then

sudo dpkg -i session-manager-plugin.deb

Hope this fixes the issue for you!