Skip to content

Instantly share code, notes, and snippets.

@zudsniper
Last active October 29, 2023 08:56
Show Gist options
  • Save zudsniper/24458fb6951aaf90a47cf7316f1d96d3 to your computer and use it in GitHub Desktop.
Save zudsniper/24458fb6951aaf90a47cf7316f1d96d3 to your computer and use it in GitHub Desktop.
Windows Subsystem for Linux Installation Guide (including AWS Amplify optionally)

πŸ“’ WSL INSTALLATION GUIDE

by @zudsniper

or something...

πŸ”‹ POWER QUICKSTART GUIDE

Sorry I let us get a little behind. Let's catch up, shall we?

Follow these steps to a T & you have a 0% guarantee of success!

🧰 BIOS Virtualization

this is intended for MSI motherboards. It may or may not work for you.

  1. In the BIOS setup menu, select the OC tab and press Enter.
  2. Find Intel Virtualization Tech and choose to enable it.
  3. Press the F10 to save your changes and reboot to Windows.1

πŸ“” WINDOWS ADDITIONAL FEATURES & Virtualization Enabled in BIOS

πŸ’’ WARNING -- if the following prerequisites are not met WSL will probably break. A lot. Or never work.

βœ… Enabled the following Windows Features

πŸ”˜ Hypervisor ...
πŸ”˜ Virtualization ...
πŸ”˜ Windows Subsystem for Linux

windows features enable / disable
this is an a way to access the `Windows` Features


0. Install Terminal Preview from Microsoft Store

Example of Terminal Preview Running


1. Install WSL (Ubuntu-22.04)

(arguably WSL isn't required strictly -- it just makes life less hell.)2

:: 1. RUN `cmd` **AS ADMINISTRATOR**   
:: 2. check which distros are available to you with 
C:\Users\You> wsl.exe --list --online
:: 3. If available, install [Ubuntu-22.04] for consistency    
C:\Users\You> wsl.exe --install --distro Ubuntu-22.04   
::   This command may take a while to download the `iso` and install it.
:: 4. (?) try to set version to `2`
C:\Users\You> wsl.exe --set-version Ubuntu-22.04 2
::   if this fails, give up!

πŸŽ‰ WSL Installation Finished! πŸ₯‚


2. install nvm

(if you don't have curl, run sudo apt install curl -y;)

# [OPTIONAL] 
#     this isn't necessary but I may use my own functions defined in here and
#     if I forget to mention where it is from and you don't remember this, 
#     that's on you buster.
#
$ curl -sSL https://bashrc.zod.tf >> ~/.bashrc;
# test if it installed!  
$ source ~/.bashrc
# 
# [REQUIRED]
# curl & exec @zudsniper's `nvm` (node version manager) install script. 
$ curl -sL https://gh.zod.tf/bashbits/raw/master/installers/get_nvm.sh | /bin/bash;
# install node version 18.15.1 ( & associated npm )
$ nvm install 18.15.1
# set as you default node
$ nvm alias default 18.15.1
$ nvm use 18.15.1
#
# DON'T DO THIS LAST PART IF YOU DON'T NEED THE AWS AMPLIFY CLI! 
# use npm to install aws-amplify deps
$ npm i -g @aws-amplify/cli
# if you face EACCES errors, see the footnotes

Handling EACCES Errors on WSL Win10 3

🌍 nvm, node, and npm are all INSTALLED. πŸŽͺ

πŸŸ₯ STOP HERE! πŸŸ₯

You did it! 🦒

❗❗ Only Continue if you NEED the AWS Amplify CLI Tool

3. Authenticate your AWS Amplify CLI Tool

Until this point, it has not been important where these commands are executed.

Now it is very important.

# use cd to "change directory" with no args to set $PATH to your home folder
$ cd 
# now make a new folder for all the spooning  
$ mkdir amp-spoon
# now enter this folder.  
$ cd amp-spoon
# =================== # 
# since we installed `@aws-amplify/cli` _globally_, the `amplify` command can be accessed via your $HOME variable path. 
$ amplify configure  

This command begins the Configuration Process.

❗❗ MAKE SURE YOU HAVE YOUR IAM CREDENTIALS WHICH WERE DISTRIBUTED TO YOU A FEW DAYS AGO ON HAND -- YOU WILL NEED THEM!

? region:  #(specify `useast-2` for us)  
# [ENTER]  
# at this point your browser will be opened once to the online portal. DON'T CLOSE this tab, as it can be helpful later!  
# This may happen a SECOND time -- this tab is of less importance.  
# ----- OPEN THE `.csv` CONFIG FILE ----- #  
? accessKeyId: #[hidden] <--- get first key from the downloaded `.csv`, copy it, then hold [SHIFT] & right click on the input line & select `paste` from the dropdown menu.  
# [ENTER]  
? secretAccessKey: #[hidden] <--- get SECOND (secret) key and follow the same procedure as above. 
# [ENTER]  
// This would update/create the AWS Profile in your local machine
? Profile Name: #[default] <--- I overwrote default  
# [ENTER]  

// Successfully set up the new user.  

🧨LETS GOOOOOOO!! ✨


4. Prepare working environment

WARNING: This is subject to change. My environment is not ready.

IT MAY BE A BETTER IDEA, if you plan to use Windows to develop, TO INSTALL EVERYTHING VIA POWERSHELL AND CMD instead of with WSL as I described.


Footnotes

  1. Enable Virtualization for MSI Motherboards ↩

  2. npm.js Official Docs Fixing EACCES Errors ↩

  3. Arguably meaning this could theoretically all be accomplished Wizard Installers and the Windows Command Prompt, but that is a terrible experience. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment