How to Setup Leapp on Windows with WSL
Problem
You want to set up local AWS credentials but the primary documentation refers to MacOS and Homebrew. Leapp and Geodesic are supported in Windows using WSL. Please see the Solution below.
Solution
- Install latest version of Docker Desktop, Leapp, AWS CLI, WSL (Ubuntu 22)
-
Optional but useful to debug, install the AWS CLI in WSL
-
Start Docker Desktop
-
Launch Leapp UI and connect to Chained Role session
Please see How to Log into AWS, skipping all requirement steps. After you've connected to your identity profile via the Chained Role session, continue with the remaining steps here.
- Find your home directory for Windows.
Most likely this is C:\Users\YOUR_NAME
. Open WSL and run the following:
explorer.exe .
- Copy
.aws
from Windows Home to WSL home
In Powershell copy .\.aws\
to the your local WSL home path found above.
For example:
PS C:\Users\dan> cp -r .\.aws\ \\wsl.localhost\Ubuntu-22.04\home\dan
- Open WSL and verify your identity
dan@WSL:~$ aws sts get-caller-identity --profile acme-identity
{
"UserId": "xyz:acme-identity",
"Account": "123",
"Arn": "arn:aws:sts::111111111111:assumed-role/acme-core-gbl-identity-devops/acme-identity"
}
-
Clone and navigate to
infrastructure
directory -
Build your Geodesic image:
make all
- Done!
In Geodesic you should see the green checkmark next to your profile. You can also verify with aws sts
:
⧉ acme
√ : [acme-identity] (HOST) infrastructure ⨠ aws sts get-caller-identity
{
"UserId": "AROAXYKJQXXXXXXXXXXXX:acme-identity",
"Account": "111111111111",
"Arn": "arn:aws:sts::111111111111:assumed-role/acme-core-gbl-identity-devops/acme-identity"
}
FAQ
Can we configure Leapp to write credentials to the WSL home directory?
No, Leapp does not support changing the ~/.aws
directory path.
Please see this issue.
However thanks to the Leapp open source community, we have a workaround!
One way to do it:
- Install Leapp in Windows
- Open WSL
- In WSL backup your
~/.aws
- In WSL create symlink from
/mnt/c/Users/<username>/.aws
to~/.aws
Example:
# It is ok, if the command returns cp: cannot stat '.aws': No such file or directory
cp -av ~/.aws ~/.aws.bak
ln -s /mnt/c/Users/<username>/.aws ~/.aws
Then WSL will follow chosen session in Windows Leapp. One caveat is that Leapp CLI doesn't work in WSL.
Leapp fails to launch with AWS CLI Error
After I downloaded Leapp, I see this error when trying to start the app:
Error: An error occurred getting AWS CLI..
You must first install the AWS CLI. See AWS CLI - Getting Started or run this command in PowerShell:
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
Restart PowerShell and then verify that the AWS CLI installed successfully:
PS C:\Users\dan> aws --version
aws-cli/2.15.31 Python/3.11.8 Windows/10 exe/AMD64 prompt/off
Now restart Leapp.
Initializing Docker API Proxy Failed
When trying to start Docker Desktop I am getting this error:
Something went wrong.
Starting services: initializing Docker API Proxy: open \.\pipe\docker_engine: Access is denied.
See this issue: docker/for-win/issues/13663.
Run wsl --update
and restart Docker Desktop.
.local/bin
is not in my PATH
When I try to run make all
, I get this error:
Inadequate permissions to install to /usr/local/bin. Installing to /home/dan/.local/bin.
# Installing acme from acme/infrastructure:latest...
# Installed acme to /home/dan/.local/bin/acme
hash
# WARNING: It appears /home/dan/.local/bin is not on your PATH. Please add it.
make: *** [Makefile:56: install] Error 1
Add your .local/bin
to your PATH
export PATH=$PATH:/home/<YOUR USERNAME>/.local/bin
Now try to run make all
again